Files
ik_llama.cpp/examples/server/public_llamacpp/index_llamacpp.html
firecoperana d894998fa6 Add --webui arg to launch llama.cpp new webui (#786)
* Add new webui from llama.cpp

* Add new webui

* feat: Improve mobile UI for Settings Dialog (#16084)

* feat: Improve mobile UI for Settings Dialog

* chore: update webui build output

* fix: Linting errors

* chore: update webui build output
# Conflicts:
#	examples/server/webui_llamacpp/src/lib/components/app/chat/ChatSettings/ChatSettingsFields.svelte
#	examples/server/webui_llamacpp/src/lib/components/app/chat/ChatSettings/ChatSettingsSection.svelte
#	tools/server/public/index.html.gz

* webui : fix handling incomplete chunks (#16107)

* Always show message actions for mobile UI + improvements for user message sizing (#16076)

# Conflicts:
#	.gitignore
#	examples/server/webui_llamacpp/package.json
#	examples/server/webui_llamacpp/scripts/dev.sh
#	tools/server/webui/scripts/post-build.sh

* webui: switch to hash-based routing (alternative of #16079) (#16157)

* Switched web UI to hash-based routing

* Added hash to missed goto function call

* Removed outdated SPA handling code

* Fixed broken sidebar home link
# Conflicts:
#	examples/server/webui_llamacpp/src/routes/+layout.ts
#	tools/server/server.cpp

* Allow viewing conversations even when llama server is down (#16255)

* webui: allow viewing conversations and sending messages even if llama-server is down

- Cached llama.cpp server properties in browser localStorage on startup, persisting successful fetches and reloading them when refresh attempts fail so the chat UI continues to render while the backend is unavailable.
- Cleared the stored server properties when resetting the store to prevent stale capability data after cache-backed operation.
- Kept the original error-splash behavior when no cached props exist so fresh installs still surface a clear failure state instead of rendering stale data.

* feat: Add UI for `props` endpoint unavailable + cleanup logic

* webui: extend cached props fallback to offline errors

Treat connection failures (refused, DNS, timeout, fetch) the same way as
server 5xx so the warning banner shows up when cache is available, instead
of falling back to a full error screen.

* webui: Left the chat form enabled when a server warning is present so operators can keep sending messages

e.g., to restart the backend over llama-swap, even while cached /props data is in use

* chore: update webui build output

---------

Co-authored-by: Pascal <admin@serveurperso.com>
# Conflicts:
#	examples/server/webui_llamacpp/src/lib/components/app/chat/ChatScreen/ChatScreenWarning.svelte
#	examples/server/webui_llamacpp/src/lib/constants/localstorage-keys.ts

* Enhance text file detection logic for file attachments (#16199)

* feat: Enhances text file detection logic

* chore: Build static `webui` output

* chore: update webui build output
# Conflicts:
#	examples/server/webui_llamacpp/src/lib/constants/binary-detection.ts

* Show message actions by default (#16289)

* fix: preserved zero values in chat settings inputs and textareas by switching to nullish coalescing for field values and default placeholders (#16312)

* Improve Mobile UI for dialogs and action dropdowns (#16222)

* fix: Always show conversation item actions

* feat: Improve Alert Dialog and Dialog mobile UI

* feat: Add settings reset to default confirmation

* fix: Close Edit dialog on save

* chore: update webui build output

* webui: implement proper z-index system and scroll management

- Add CSS variable for centralized z-index control
- Fix dropdown positioning with Settings dialog conflicts
- Prevent external scroll interference with proper event handling
- Clean up hardcoded z-index values for maintainable architecture

* webui: ensured the settings dialog enforces dynamic viewport height on mobile while retaining existing desktop sizing overrides

* feat: Use `dvh` instead of computed px height for dialogs max height on mobile

* chore: update webui build output

* feat: Improve Settings fields UI

* chore: update webui build output

* chore: update webui build output

---------

Co-authored-by: Pascal <admin@serveurperso.com>

* Fix thinking blocks with quotes + add handling `[THINK]...[/THINK]` blocks (#16326)

* fix: prevent reasoning blocks with quotes from being truncated

* chore: update webui build output

* feat: Improve thinking content parsing

* test: Adds ChatMessage component stories for different thinking blocks

* chore: update webui build output

* fix: ChatMessage story fix

---------

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Chatapi ignore empty sampling (#16330)

* fix: skip empty sampling fields instead of coercing to 0 in chat API options

* chore: update webui build output

* webui: Remove running `llama-server` within WebUI `dev.sh` script (#16363)

* Add optional setting for showing "Model used:" information (#16337)

* feat: Add a setting to include model name used to generate the message

* feat: UI improvements

* feat: Save model info along with the database message entry creation

* chore: Build webui static output

* Improve code block color theming (#16325)

* feat: Improve code block theming

* chore: update webui build output

* chore: Update webui static build

* Conversation action dialogs as singletons from Chat Sidebar + apply conditional rendering for Actions Dropdown for Chat Conversation Items (#16369)

* fix: Render Conversation action dialogs as singletons from Chat Sidebar level

* chore: update webui build output

* fix: Render Actions Dropdown conditionally only when user hovers conversation item + remove unused markup

* chore: Update webui static build

* fix: Always truncate conversation names

* chore: Update webui static build

* fix: track viewportHeight via window.innerHeight to avoid unwanted scrolling (#16356)

Use <svelte:window bind:innerHeight> instead of manual resize listener

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* webui : Fix messages payload sent to chat completions (#16402)

* fix: Include just the currently active message branches instead of all in chat completions request

* chore: Build webui static output

* chore: Formatting

* chore: update webui build output

* Capture model name only after first token (streaming) or completed request (#16405)

* feat: Capture model name only after first token (streaming) or completed request (non-streaming)

* chore: update webui build output

* chore: update webui build output

* Fix missing messages on sibling navigation (#16408)

* fix: resolve message disappearing issue when navigating between regenerated siblings by using current leaf nodes instead of cached sibling IDs

* chore: update webui build output

* chore: update webui build output

* webui : added download action (#13552) (#16282)

* webui : added download action (#13552)

* webui : import and export (for all conversations)

* webui : fixed download-format, import of one conversation

* webui : add ExportedConversations type for chat import/export

* feat: Update naming & order

* chore: Linting

* webui : Updated static build output

---------

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* refactor: centralize CoT parsing in backend for streaming mode (#16394)

* refactor: unify reasoning handling via backend reasoning_content, drop frontend tag parsing

- Updated the chat message component to surface backend-supplied reasoning via message.thinking while showing the raw assistant content without inline tag scrubbing
- Simplified chat streaming to append content chunks directly, stream reasoning into the message model, and persist any partial reasoning when generation stops
- Refactored the chat service SSE handler to rely on server-provided reasoning_content, removing legacy <think> parsing logic
- Refreshed Storybook data and streaming flows to populate the thinking field explicitly for static and streaming assistant messages

* refactor: implement streaming-aware universal reasoning parser

Remove the streaming mode limitation from --reasoning-format by refactoring
try_parse_reasoning() to handle incremental parsing of <think> tags across
all formats.

- Rework try_parse_reasoning() to track whitespace, partial tags, and
  multiple reasoning segments, allowing proper separation of reasoning_content
  and content in streaming mode
- Parse reasoning tags before tool call handling in content-only and Llama 3.x
  formats to ensure inline <think> blocks are captured correctly
- Change default reasoning_format from 'auto' to 'deepseek' for consistent
  behavior
- Add 'deepseek-legacy' option to preserve old inline behavior when needed
- Update CLI help and documentation to reflect streaming support
- Add parser tests for inline <think>...</think> segments

The parser now continues processing content after </think> closes instead of
stopping, enabling proper message.reasoning_content and message.content
separation in both streaming and non-streaming modes.

Fixes the issue where streaming responses would dump everything (including
post-thinking content) into reasoning_content while leaving content empty.

* refactor: address review feedback from allozaur

- Passed the assistant message content directly to ChatMessageAssistant to drop the redundant derived state in the chat message component
- Simplified chat streaming updates by removing unused partial-thinking handling and persisting partial responses straight from currentResponse
- Refreshed the ChatMessage stories to cover standard and reasoning scenarios without the old THINK-tag parsing examples

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* refactor: restore forced reasoning prefix to pass test-chat ([chat] All tests passed)

- store the exact sequence seen on input when 'thinking_forced_open' enforces a reasoning block
- inject this prefix before the first accumulated segment in 'reasoning_content', then clear it to avoid duplication
- repeat the capture on every new 'start_think' detection to properly handle partial/streaming flows

* refactor: address review feedback from ngxson

* debug: say goodbye to curl -N, hello one-click raw stream

- adds a new checkbox in the WebUI to display raw LLM output without backend parsing or frontend Markdown rendering

* Update tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* webui: add Storybook example for raw LLM output and scope reasoning format toggle per story

- Added a Storybook example that showcases the chat message component in raw LLM output mode with the provided trace sample
- Updated every ChatMessage story to toggle the disableReasoningFormat setting so the raw-output rendering remains scoped to its own example

* npm run format

* chat-parser: address review feedback from ngxson

Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com>

---------

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com>
# Conflicts:
#	common/arg.cpp
#	examples/server/webui_llamacpp/src/lib/utils/thinking.ts
#	tools/server/README.md

* No markdown in cot (#16483)

* fix: let the model think in plaintext

* chore: npm run format + npm run build

* webui: updated the chat service to only include max_tokens in the req… (#16489)

* webui: updated the chat service to only include max_tokens in the request payload when the setting is explicitly provided, while still mapping explicit zero or null values to the infinite-token sentinel

* chore: update webui build output

* feat: render user content as markdown option (#16358)

* feat: render user content as markdown option
- Add a persisted 'renderUserContentAsMarkdown' preference to the settings defaults and info metadata so the choice survives reloads like other options
- Surface the new 'Render user content as Markdown' checkbox in the General section of the chat settings dialog, beneath the PDF toggle
- Render user chat messages with 'MarkdownContent' when the new setting is enabled, matching assistant formatting while preserving the existing card styling otherwise
- chore: update webui build output

* chore: update webui build output

* webui: remove client-side context pre-check and rely on backend for limits (#16506)

* fix: make SSE client robust to premature [DONE] in agentic proxy chains

* webui: remove client-side context pre-check and rely on backend for limits

Removed the client-side context window pre-check and now simply sends messages
while keeping the dialog imports limited to core components, eliminating the
maximum context alert path

Simplified streaming and non-streaming chat error handling to surface a generic
'No response received from server' error whenever the backend returns no content

Removed the obsolete maxContextError plumbing from the chat store so state
management now focuses on the core message flow without special context-limit cases

* webui: cosmetic rename of error messages

* Update tools/server/webui/src/lib/stores/chat.svelte.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/stores/chat.svelte.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* chore: update webui build output

---------

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
# Conflicts:
#	examples/server/webui_llamacpp/src/lib/components/app/dialogs/ChatErrorDialog.svelte
#	examples/server/webui_llamacpp/src/lib/components/app/dialogs/MaximumContextAlertDialog.svelte
#	examples/server/webui_llamacpp/src/lib/services/context.ts

* fix: add remark plugin to render raw HTML as literal text (#16505)

* fix: add remark plugin to render raw HTML as literal text

Implemented a missing MDAST stage to neutralize raw HTML like major LLM WebUIs
do ensuring consistent and safe Markdown rendering

Introduced 'remarkLiteralHtml', a plugin that converts raw HTML nodes in the
Markdown AST into plain-text equivalents while preserving indentation and
line breaks. This ensures consistent rendering and prevents unintended HTML
execution, without altering valid Markdown structure

Kept 'remarkRehype' in the pipeline since it performs the required conversion
from MDAST to HAST for KaTeX, syntax highlighting, and HTML serialization

Refined the link-enhancement logic to skip unnecessary DOM rewrites,
fixing a subtle bug where extra paragraphs were injected after the first
line due to full innerHTML reconstruction, and ensuring links open in new
tabs only when required

Final pipeline: remarkGfm -> remarkMath -> remarkBreaks -> remarkLiteralHtml
-> remarkRehype -> rehypeKatex -> rehypeHighlight -> rehypeStringify

* fix: address review feedback from allozaur

* chore: update webui build output
# Conflicts:
#	examples/server/webui_llamacpp/src/lib/constants/literal-html.ts

* Add server-driven parameter defaults and syncing (#16515)

# Conflicts:
#	examples/server/webui_llamacpp/src/lib/components/app/chat/ChatSettings/ParameterSourceIndicator.svelte
#	examples/server/webui_llamacpp/src/lib/constants/precision.ts
#	examples/server/webui_llamacpp/src/lib/services/parameter-sync.spec.ts
#	examples/server/webui_llamacpp/src/lib/services/parameter-sync.ts
#	examples/server/webui_llamacpp/src/lib/utils/config-helpers.ts
#	examples/server/webui_llamacpp/src/lib/utils/precision.ts

* fix: added a normalization step for MathJax-style \[\] and \(\) delimiters (#16599)

* fix: added a normalization step for MathJax-style \[\] and \(\) delimiters

So inline and block equations are converted before KaTeX rendering,
enabling proper display of model-generated LaTeX in the WebUI

* chore: update webui build output

* webui: reorganize settings layout (#16607)

* webui: reorganize settings layout

* chore: update webui build output

* fix: remove unused variable

* chore: update webui build output

* Enable per-conversation loading states to allow having parallel conversations (#16327)

* feat: Per-conversation loading states and tracking streaming stats

* chore: update webui build output

* refactor: Chat state management

Consolidates loading state management by using a global `isLoading` store synchronized with individual conversation states.

This change ensures proper reactivity and avoids potential race conditions when updating the UI based on the loading status of different conversations. It also improves the accuracy of statistics displayed.

Additionally, slots service methods are updated to use conversation IDs for per-conversation state management, avoiding global state pollution.

* feat: Adds loading indicator to conversation items

* chore: update webui build output

* fix: Fix aborting chat streaming

Improves the chat stream abortion process by ensuring that partial responses are saved before the abort signal is sent.

This avoids a race condition where the onError callback could clear the streaming state before the partial response is saved. Additionally, the stream reading loop and callbacks are now checked for abort signals to prevent further processing after abortion.

* refactor: Remove redundant comments

* chore: build webui static output

* refactor: Cleanup

* chore: update webui build output

* chore: update webui build output

* fix: Conversation loading indicator for regenerating messages

* chore: update webui static build

* feat: Improve configuration

* feat: Install `http-server` as dev dependency to not need to rely on `npx` in CI

* Import/Export UX improvements (#16619)

* webui : added download action (#13552)

* webui : import and export (for all conversations)

* webui : fixed download-format, import of one conversation

* webui : add ExportedConversations type for chat import/export

* feat: Update naming & order

* chore: Linting

* feat: Import/Export UX improvements

* chore: update webui build output

* feat: Update UI placement of Import/Export tab in Chat Settings Dialog

* refactor: Cleanup

chore: update webui build output

* feat: Enable shift-click multiple conversation items selection

* chore: update webui static build

* chore: update webui static build

---------

Co-authored-by: Sascha Rogmann <github@rogmann.org>
# Conflicts:
#	examples/server/webui_llamacpp/src/lib/components/app/chat/ChatSettings/ConversationSelectionDialog.svelte
#	examples/server/webui_llamacpp/src/lib/components/app/chat/ChatSettings/ImportExportTab.svelte
#	examples/server/webui_llamacpp/src/lib/utils/conversation-utils.ts

* Prevent premature submission on IME input (#16673)

* fix: Prevent premature submission on IME input

* chore: update webui static build

* refactor: Put IME completion checker in a helper function and add checking for `KeyboardEvent.eventKey === 229`

* chore: update webui static build

* chore: update webui static build

* chore: update webui static build
# Conflicts:
#	examples/server/webui_llamacpp/src/lib/utils/is-ime-composing.ts

* Handle legacy 'context' attachments (#16687)

* webui: introduce OpenAI-compatible model selector in JSON payload (#16562)

* webui: introduce OpenAI-compatible model selector in JSON payload

* webui: restore OpenAI-Compatible model source of truth and unify metadata capture

This change re-establishes a single, reliable source of truth for the active model:
fully aligned with the OpenAI-Compat API behavior

It introduces a unified metadata flow that captures the model field from both
streaming and non-streaming responses, wiring a new onModel callback through ChatService
The model name is now resolved directly from the API payload rather than relying on
server /props or UI assumptions

ChatStore records and persists the resolved model for each assistant message during
streaming, ensuring consistency across the UI and database
Type definitions for API and settings were also extended to include model metadata
and the onModel callback, completing the alignment with OpenAI-Compat semantics

* webui: address review feedback from allozaur

* webui: move model selector into ChatForm (idea by @allozaur)

* webui: make model selector more subtle and integrated into ChatForm

* webui: replaced the Flowbite selector with a native Svelte dropdown

* webui: add developer setting to toggle the chat model selector

* webui: address review feedback from allozaur

Normalized streamed model names during chat updates
by trimming input and removing directory components before saving
or persisting them, so the conversation UI shows only the filename

Forced model names within the chat form selector dropdown to render as
a single-line, truncated entry with a tooltip revealing the full name

* webui: toggle displayed model source for legacy vs OpenAI-Compat modes

When the selector is disabled, it falls back to the active server model name from /props

When the model selector is enabled, the displayed model comes from the message metadata
(the one explicitly selected and sent in the request)

* Update tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions.svelte

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/constants/localstorage-keys.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormModelSelector.svelte

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageAssistant.svelte

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/services/chat.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/services/chat.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* webui: refactor model selector and persistence helpers

- Replace inline portal and event listeners with proper Svelte bindings
- Introduce 'persisted' store helper for localStorage sync without runes
- Extract 'normalizeModelName' utils + Vitest coverage
- Simplify ChatFormModelSelector structure and cleanup logic

Replaced the persisted store helper's use of '$state/$effect' runes with
a plain TS implementation to prevent orphaned effect runtime errors
outside component context

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* webui: document normalizeModelName usage with inline examples

* Update tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormModelSelector.svelte

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/stores/models.svelte.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/stores/models.svelte.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* webui: extract ModelOption type into dedicated models.d.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* webui: refine ChatMessageAssistant displayedModel source logic

* webui: stabilize dropdown, simplify model extraction, and init assistant model field

* chore: update webui static build

* Update tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageAssistant.svelte

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* chore: npm format, update webui static build

* webui: align sidebar trigger position, remove z-index glitch

* chore: update webui build output

---------

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
# Conflicts:
#	examples/server/webui_llamacpp/src/lib/components/app/chat/ChatForm/ChatFormModelSelector.svelte
#	examples/server/webui_llamacpp/src/lib/services/models.ts
#	examples/server/webui_llamacpp/src/lib/stores/models.svelte.ts
#	examples/server/webui_llamacpp/src/lib/stores/persisted.svelte.ts
#	examples/server/webui_llamacpp/src/lib/types/models.d.ts
#	examples/server/webui_llamacpp/src/lib/utils/model-names.test.ts
#	examples/server/webui_llamacpp/src/lib/utils/model-names.ts
#	examples/server/webui_llamacpp/src/lib/utils/portal-to-body.ts

* webui: support q URL parameter (#16728)

* webui: support q URL parameter

Fixes #16722
I’ve checked that it works with Firefox’s AI tools

* webui: apply suggestions from code review

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* chore: update webui static build

---------

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* build fix

---------

Co-authored-by: firecoperana <firecoperana>
Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
Co-authored-by: Quentin Bramas <quentin.bramas@gmail.com>
Co-authored-by: Isaac McFadyen <isaac@imcf.me>
Co-authored-by: Pascal <admin@serveurperso.com>
Co-authored-by: Sascha Rogmann <59577610+srogmann@users.noreply.github.com>
Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com>
Co-authored-by: Sascha Rogmann <github@rogmann.org>
Co-authored-by: Florian Badie <florianbadie@odrling.xyz>
2025-10-27 14:22:02 +02:00

1366 lines
2.8 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-800:oklch(47% .157 37.304);--color-orange-900:oklch(40.8% .123 38.172);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-800:oklch(47.6% .114 61.907);--color-yellow-900:oklch(42.1% .095 57.708);--color-yellow-950:oklch(28.6% .066 53.813);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-gray-500:oklch(55.1% .027 264.364);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-5xl:64rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-widest:.1em;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1{top:calc(var(--spacing)*1)}.top-1\.5{top:calc(var(--spacing)*1.5)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-2\.5{top:calc(var(--spacing)*2.5)}.top-3\.5{top:calc(var(--spacing)*3.5)}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-1{right:calc(var(--spacing)*1)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.right-8{right:calc(var(--spacing)*8)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-999{z-index:999}.z-99999{z-index:99999}.z-999999{z-index:999999}.z-\[900\]{z-index:900}.z-\[1000\]{z-index:1000}.z-\[999999\]{z-index:999999}.z-\[1000000\]{z-index:1000000}.z-\[1000001\]{z-index:1000001}.z-\[var\(--layer-popover\,1000000\)\]{z-index:var(--layer-popover,1000000)}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-3\.5{margin-inline:calc(var(--spacing)*3.5)}.mx-auto{margin-inline:auto}.-my-1{margin-block:calc(var(--spacing)*-1)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing)*-1)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-auto{margin-right:auto}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.mb-16{margin-bottom:calc(var(--spacing)*16)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.aspect-square{aspect-ratio:1}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-2\.5{width:calc(var(--spacing)*2.5);height:calc(var(--spacing)*2.5)}.size-3{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.size-3\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-full{width:100%;height:100%}.h-\(--bits-select-anchor-height\){height:var(--bits-select-anchor-height)}.h-1{height:calc(var(--spacing)*1)}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-24{height:calc(var(--spacing)*24)}.h-80{height:calc(var(--spacing)*80)}.h-\[100dvh\]{height:100dvh}.h-\[100vh\]{height:100vh}.h-\[400px\]{height:400px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-\(--bits-dropdown-menu-content-available-height\){max-height:var(--bits-dropdown-menu-content-available-height)}.max-h-\(--bits-select-content-available-height\){max-height:var(--bits-select-content-available-height)}.max-h-32{max-height:calc(var(--spacing)*32)}.max-h-\[60vh\]{max-height:60vh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[100dvh\]{max-height:100dvh}.max-h-\[calc\(100dvh-13\.5rem\)\]{max-height:calc(100dvh - 13.5rem)}.max-h-full{max-height:100%}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-9{min-height:calc(var(--spacing)*9)}.min-h-12{min-height:calc(var(--spacing)*12)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\[48px\]{min-height:48px}.min-h-\[50vh\]{min-height:50vh}.min-h-\[60px\]{min-height:60px}.min-h-\[100dvh\]{min-height:100dvh}.min-h-\[100px\]{min-height:100px}.min-h-svh{min-height:100svh}.w-\(--sidebar-width\){width:var(--sidebar-width)}.w-1{width:calc(var(--spacing)*1)}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-32{width:calc(var(--spacing)*32)}.w-48{width:calc(var(--spacing)*48)}.w-64{width:calc(var(--spacing)*64)}.w-72{width:calc(var(--spacing)*72)}.w-\[56rem\]{width:56rem}.w-\[calc\(100vw-2rem\)\]{width:calc(100vw - 2rem)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\(--skeleton-width\){max-width:var(--skeleton-width)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-36{max-width:calc(var(--spacing)*36)}.max-w-\[17rem\]{max-width:17rem}.max-w-\[48rem\]{max-width:48rem}.max-w-\[50vw\]{max-width:50vw}.max-w-\[56rem\]{max-width:56rem}.max-w-\[80\%\]{max-width:80%}.max-w-\[160px\]{max-width:160px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.min-w-\(--bits-select-anchor-width\){min-width:var(--bits-select-anchor-width)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-5{min-width:calc(var(--spacing)*5)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[120px\]{min-width:120px}.min-w-max{min-width:max-content}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-\(--bits-dropdown-menu-content-transform-origin\){transform-origin:var(--bits-dropdown-menu-content-transform-origin)}.origin-\(--bits-select-content-transform-origin\){transform-origin:var(--bits-select-content-transform-origin)}.origin-\(--bits-tooltip-content-transform-origin\){transform-origin:var(--bits-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-px{--tw-translate-x:-1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-45{rotate:45deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.scroll-my-1{scroll-margin-block:calc(var(--spacing)*1)}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.auto-rows-min{grid-auto-rows:min-content}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*10)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*10)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*3)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.justify-self-start{justify-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\[1\.125rem\]{border-radius:1.125rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[4px\]{border-radius:4px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-t-3xl{border-top-left-radius:var(--radius-3xl);border-top-right-radius:var(--radius-3xl)}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500)40%,transparent)}}.border-border,.border-border\/30{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/30{border-color:color-mix(in oklab,var(--border)30%,transparent)}}.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border)50%,transparent)}}.border-current{border-color:currentColor}.border-destructive,.border-destructive\/40{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/40{border-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.border-green-500{border-color:var(--color-green-500)}.border-input{border-color:var(--input)}.border-muted{border-color:var(--muted)}.border-primary{border-color:var(--primary)}.border-sidebar-border{border-color:var(--sidebar-border)}.border-transparent{border-color:#0000}.border-yellow-200{border-color:var(--color-yellow-200)}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-accent{background-color:var(--accent)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-background,.bg-background\/40{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/40{background-color:color-mix(in oklab,var(--background)40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-border,.bg-border\/20{background-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.bg-border\/20{background-color:color-mix(in oklab,var(--border)20%,transparent)}}.bg-card{background-color:var(--card)}.bg-destructive,.bg-destructive\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.bg-foreground\/5{background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.bg-foreground\/5{background-color:color-mix(in oklab,var(--foreground)5%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-green-500{background-color:var(--color-green-500)}.bg-muted{background-color:var(--muted)}.bg-muted-foreground\/15{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.bg-muted-foreground\/15{background-color:color-mix(in oklab,var(--muted-foreground)15%,transparent)}}.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/30{background-color:color-mix(in oklab,var(--muted)30%,transparent)}}.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.bg-muted\/70{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/70{background-color:color-mix(in oklab,var(--muted)70%,transparent)}}.bg-orange-100{background-color:var(--color-orange-100)}.bg-popover{background-color:var(--popover)}.bg-primary,.bg-primary\/10{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,var(--primary)10%,transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-sidebar\/50{background-color:var(--sidebar)}@supports (color:color-mix(in lab,red,red)){.bg-sidebar\/50{background-color:color-mix(in oklab,var(--sidebar)50%,transparent)}}.bg-transparent{background-color:#0000}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-muted{--tw-gradient-from:var(--muted);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.fill-destructive{fill:var(--destructive)}.stroke-destructive{stroke:var(--destructive)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.\!p-10{padding:calc(var(--spacing)*10)!important}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-12{padding:calc(var(--spacing)*12)}.p-px{padding:1px}.px-0{padding-inline:calc(var(--spacing)*0)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\.75{padding-inline:calc(var(--spacing)*3.75)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0{padding-block:calc(var(--spacing)*0)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-0\.75{padding-block:calc(var(--spacing)*.75)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.pt-1\.5{padding-top:calc(var(--spacing)*1.5)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-5{padding-top:calc(var(--spacing)*5)}.pt-6{padding-top:calc(var(--spacing)*6)}.pt-16{padding-top:calc(var(--spacing)*16)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-8{padding-right:calc(var(--spacing)*8)}.pr-9{padding-right:calc(var(--spacing)*9)}.pr-10{padding-right:calc(var(--spacing)*10)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-6{padding-bottom:calc(var(--spacing)*6)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-9{padding-left:calc(var(--spacing)*9)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.leading-7\.5{--tw-leading:calc(var(--spacing)*7.5);line-height:calc(var(--spacing)*7.5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent-foreground{color:var(--accent-foreground)}.text-amber-500{color:var(--color-amber-500)}.text-amber-600{color:var(--color-amber-600)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-muted-foreground{color:var(--muted-foreground)}.text-orange-800{color:var(--color-orange-800)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground)70%,transparent)}}.text-transparent{color:#0000}.text-white{color:var(--color-white)}.text-yellow-600{color:var(--color-yellow-600)}.text-yellow-800{color:var(--color-yellow-800)}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-100{opacity:1}.shadow-\[0_0_0_1px_var\(--sidebar-border\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--sidebar-border));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-ring\/10{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.ring-ring\/10{--tw-ring-color:color-mix(in oklab,var(--ring)10%,transparent)}}.ring-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-ring\/50{outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.outline-ring\/50{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.running{animation-play-state:running}.group-focus-within\/menu-item\:opacity-100:is(:where(.group\/menu-item):focus-within *){opacity:1}@media (hover:hover){.group-hover\/menu-item\:opacity-100:is(:where(.group\/menu-item):hover *){opacity:1}}.group-has-data-\[sidebar\=menu-action\]\/menu-item\:pr-8:is(:where(.group\/menu-item):has([data-sidebar=menu-action]) *){padding-right:calc(var(--spacing)*8)}.group-data-\[collapsible\=icon\]\:-mt-8:is(:where(.group)[data-collapsible=icon] *){margin-top:calc(var(--spacing)*-8)}.group-data-\[collapsible\=icon\]\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\[collapsible\=icon\]\:size-8\!:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--spacing)*8)!important;height:calc(var(--spacing)*8)!important}.group-data-\[collapsible\=icon\]\:w-\(--sidebar-width-icon\):is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\+2px\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing)*4)) + 2px)}.group-data-\[collapsible\=icon\]\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.group-data-\[collapsible\=icon\]\:p-0\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*0)!important}.group-data-\[collapsible\=icon\]\:p-2\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*2)!important}.group-data-\[collapsible\=icon\]\:opacity-0:is(:where(.group)[data-collapsible=icon] *){opacity:0}.group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){right:calc(var(--sidebar-width)*-1)}.group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){left:calc(var(--sidebar-width)*-1)}.group-data-\[collapsible\=offcanvas\]\:w-0:is(:where(.group)[data-collapsible=offcanvas] *){width:calc(var(--spacing)*0)}.group-data-\[collapsible\=offcanvas\]\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\[side\=left\]\:-right-4:is(:where(.group)[data-side=left] *){right:calc(var(--spacing)*-4)}.group-data-\[side\=right\]\:left-0:is(:where(.group)[data-side=right] *){left:calc(var(--spacing)*0)}.group-data-\[side\=right\]\:rotate-180:is(:where(.group)[data-side=right] *){rotate:180deg}.group-data-\[state\=open\]\:-rotate-180:is(:where(.group)[data-state=open] *){rotate:-180deg}.group-data-\[variant\=floating\]\:rounded-lg:is(:where(.group)[data-variant=floating] *){border-radius:var(--radius)}.group-data-\[variant\=floating\]\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[variant\=floating\]\:border-sidebar-border:is(:where(.group)[data-variant=floating] *){border-color:var(--sidebar-border)}.group-data-\[variant\=floating\]\:shadow-sm:is(:where(.group)[data-variant=floating] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media (hover:hover){.peer-hover\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button):hover~*){color:var(--sidebar-accent-foreground)}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button)[data-active=true]~*){color:var(--sidebar-accent-foreground)}.peer-data-\[size\=default\]\/menu-button\:top-1\.5:is(:where(.peer\/menu-button)[data-size=default]~*){top:calc(var(--spacing)*1.5)}.peer-data-\[size\=lg\]\/menu-button\:top-2\.5:is(:where(.peer\/menu-button)[data-size=lg]~*){top:calc(var(--spacing)*2.5)}.peer-data-\[size\=sm\]\/menu-button\:top-1:is(:where(.peer\/menu-button)[data-size=sm]~*){top:calc(var(--spacing)*1)}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing)*-2)}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:left-\[calc\(1\/2\*100\%-1px\)\]:after{content:var(--tw-content);left:calc(50% - 1px)}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.group-data-\[collapsible\=offcanvas\]\:after\:left-full:is(:where(.group)[data-collapsible=offcanvas] *):after{content:var(--tw-content);left:100%}.first\:ml-4:first-child{margin-left:calc(var(--spacing)*4)}.last\:mr-4:last-child{margin-right:calc(var(--spacing)*4)}.focus-within\:border-border:focus-within{border-color:var(--border)}.focus-within\:shadow-md:focus-within{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media (hover:hover){.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/20:hover{background-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.hover\:bg-destructive\/80:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/80:hover{background-color:color-mix(in oklab,var(--destructive)80%,transparent)}}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\:bg-foreground\/10:hover{background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-foreground\/10:hover{background-color:color-mix(in oklab,var(--foreground)10%,transparent)}}.hover\:bg-muted:hover,.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\:bg-red-600:hover{background-color:var(--color-red-600)}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\:bg-white\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/30:hover{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\:bg-yellow-200:hover{background-color:var(--color-yellow-200)}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_var\(--sidebar-accent\)\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--sidebar-accent));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:group-data-\[collapsible\=offcanvas\]\:bg-sidebar:hover:is(:where(.group)[data-collapsible=offcanvas] *){background-color:var(--sidebar)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:bg-muted:focus{background-color:var(--muted)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-primary:focus{--tw-ring-color:var(--primary)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus-visible\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}:where([data-side=left]) .in-data-\[side\=left\]\:cursor-w-resize{cursor:w-resize}:where([data-side=right]) .in-data-\[side\=right\]\:cursor-e-resize{cursor:e-resize}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[variant\=inset\]\:bg-sidebar:has([data-variant=inset]){background-color:var(--sidebar)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.data-highlighted\:bg-accent[data-highlighted]{background-color:var(--accent)}.data-highlighted\:text-accent-foreground[data-highlighted]{color:var(--accent-foreground)}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\[active\=true\]\:font-medium[data-active=true]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[highlighted\]\:bg-accent[data-highlighted]{background-color:var(--accent)}.data-\[highlighted\]\:text-accent-foreground[data-highlighted]{color:var(--accent-foreground)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing)*8)}.data-\[multiline\]\:py-2\.5[data-multiline]{padding-block:calc(var(--spacing)*2.5)}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[side\=bottom\]\:-translate-x-1\/2[data-side=bottom]{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:-translate-y-\[calc\(-50\%_\+_1px\)\][data-side=bottom]{--tw-translate-y: calc((-50% + 1px)*-1) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:-translate-y-\[calc\(50\%_-_3px\)\][data-side=left]{--tw-translate-y: calc((50% - 3px)*-1) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:translate-x-\[calc\(50\%_\+_2px\)\][data-side=right]{--tw-translate-x: calc(50% + 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:translate-y-1\/2[data-side=right]{--tw-translate-y: 50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:translate-x-1\/2[data-side=top]{--tw-translate-x: 50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:translate-y-\[calc\(-50\%_\+_2px\)\][data-side=top]{--tw-translate-y: calc(-50% + 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing)*9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing)*8)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing)*2)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.data-\[state\=closed\]\:slide-out-to-bottom-full[data-state=closed]{--tw-exit-translate-y: 100% }.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x:-100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x:100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.data-\[state\=open\]\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100% }.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x:-100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x:100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}@media (hover:hover){.data-\[state\=open\]\:hover\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:data-highlighted\:bg-destructive\/10[data-variant=destructive][data-highlighted]{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:data-highlighted\:bg-destructive\/10[data-variant=destructive][data-highlighted]{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.data-\[variant\=destructive\]\:data-highlighted\:text-destructive[data-variant=destructive][data-highlighted]{color:var(--destructive)}@media (min-width:40rem){.sm\:top-\[50\%\]{top:50%}.sm\:right-auto{right:auto}.sm\:bottom-auto{bottom:auto}.sm\:left-\[50\%\]{left:50%}.sm\:z-99{z-index:99}.sm\:mt-0{margin-top:calc(var(--spacing)*0)}.sm\:flex{display:flex}.sm\:max-h-\[100vh\]{max-height:100vh}.sm\:w-auto{width:auto}.sm\:max-w-6xl{max-width:var(--container-6xl)}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.sm\:translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}.sm\:data-\[state\=closed\]\:slide-out-to-bottom-0[data-state=closed]{--tw-exit-translate-y: 0% }.sm\:data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.sm\:data-\[state\=open\]\:slide-in-from-bottom-0[data-state=open]{--tw-enter-translate-y: 0% }.sm\:data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}}@media (min-width:48rem){.md\:sticky{position:sticky}.md\:left-\[var\(--sidebar-width\)\]{left:var(--sidebar-width)}.md\:z-0{z-index:0}.md\:mb-24{margin-bottom:calc(var(--spacing)*24)}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-\[64vh\]{height:64vh}.md\:max-h-\[64vh\]{max-height:64vh}.md\:max-h-\[100vh\]{max-height:100vh}.md\:max-h-\[calc\(100vh-13\.5rem\)\]{max-height:calc(100vh - 13.5rem)}.md\:min-h-0{min-height:calc(var(--spacing)*0)}.md\:w-auto{width:auto}.md\:max-w-2xl{max-width:var(--container-2xl)}.md\:max-w-72{max-width:calc(var(--spacing)*72)}.md\:max-w-md{max-width:var(--container-md)}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:calc(var(--spacing)*2)}.md\:rounded-lg{border-radius:var(--radius)}.md\:p-6{padding:calc(var(--spacing)*6)}.md\:px-6{padding-inline:calc(var(--spacing)*6)}.md\:pt-24{padding-top:calc(var(--spacing)*24)}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:opacity-0{opacity:0}.md\:peer-data-\[variant\=inset\]\:m-2:is(:where(.peer)[data-variant=inset]~*){margin:calc(var(--spacing)*2)}.md\:peer-data-\[variant\=inset\]\:ml-0:is(:where(.peer)[data-variant=inset]~*){margin-left:calc(var(--spacing)*0)}.md\:peer-data-\[variant\=inset\]\:rounded-xl:is(:where(.peer)[data-variant=inset]~*){border-radius:calc(var(--radius) + 4px)}.md\:peer-data-\[variant\=inset\]\:shadow-sm:is(:where(.peer)[data-variant=inset]~*){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.md\:peer-data-\[variant\=inset\]\:peer-data-\[state\=collapsed\]\:ml-2:is(:where(.peer)[data-variant=inset]~*):is(:where(.peer)[data-state=collapsed]~*){margin-left:calc(var(--spacing)*2)}.md\:after\:hidden:after{content:var(--tw-content);display:none}}.dark\:border-border\/20:is(.dark *){border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.dark\:border-border\/20:is(.dark *){border-color:color-mix(in oklab,var(--border)20%,transparent)}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:border-yellow-800:is(.dark *){border-color:var(--color-yellow-800)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.dark\:bg-destructive\/70:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/70:is(.dark *){background-color:color-mix(in oklab,var(--destructive)70%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\:bg-muted\/85:is(.dark *){background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-muted\/85:is(.dark *){background-color:color-mix(in oklab,var(--muted)85%,transparent)}}.dark\:bg-orange-900:is(.dark *){background-color:var(--color-orange-900)}.dark\:bg-yellow-900:is(.dark *){background-color:var(--color-yellow-900)}.dark\:bg-yellow-950:is(.dark *){background-color:var(--color-yellow-950)}.dark\:text-amber-400:is(.dark *){color:var(--color-amber-400)}.dark\:text-orange-200:is(.dark *){color:var(--color-orange-200)}.dark\:text-yellow-200:is(.dark *){color:var(--color-yellow-200)}.dark\:text-yellow-400:is(.dark *){color:var(--color-yellow-400)}.dark\:ring-ring\/20:is(.dark *){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.dark\:ring-ring\/20:is(.dark *){--tw-ring-color:color-mix(in oklab,var(--ring)20%,transparent)}}.dark\:outline-ring\/40:is(.dark *){outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.dark\:outline-ring\/40:is(.dark *){outline-color:color-mix(in oklab,var(--ring)40%,transparent)}}.dark\:focus-within\:border-border:is(.dark *):focus-within{border-color:var(--border)}@media (hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}.dark\:hover\:bg-yellow-800:is(.dark *):hover{background-color:var(--color-yellow-800)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[variant\=destructive\]\:data-highlighted\:bg-destructive\/20:is(.dark *)[data-variant=destructive][data-highlighted]{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:data-highlighted\:bg-destructive\/20:is(.dark *)[data-variant=destructive][data-highlighted]{background-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing)*2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\[\&\>\*\]\:flex-1>*{flex:1}@media (min-width:40rem){.sm\:\[\&\>\*\]\:flex-none>*{flex:none}}.\[\&\>button\]\:hidden>button{display:none}@media (hover:hover){.hover\:\[\&\>kbd\]\:opacity-100:hover>kbd{opacity:1}}.\[\&\>span\:last-child\]\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:var(--sidebar-accent-foreground)}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:calc(var(--spacing)*-2)}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:calc(var(--spacing)*-2)}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}@media (hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary)90%,transparent)}}a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(87.5% 0 0);--input:oklch(92% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0);--code-background:oklch(97.5% 0 0);--code-foreground:oklch(14.5% 0 0);--layer-popover:1000000}.dark{--background:oklch(16% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.3);--input:oklch(100% 0 0/.3);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0);--code-background:oklch(22.5% 0 0);--code-foreground:oklch(87.5% 0 0)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0))}}[data-select-viewport],[data-combobox-viewport]{scrollbar-width:none!important;-ms-overflow-style:none!important;-webkit-overflow-scrolling:touch!important}[data-combobox-viewport]::-webkit-scrollbar{display:none!important}[data-select-viewport]::-webkit-scrollbar{display:none!important}[data-scroll-area-viewport]{scrollbar-width:none!important;-ms-overflow-style:none!important;-webkit-overflow-scrolling:touch!important}[data-scroll-area-viewport]::-webkit-scrollbar{display:none!important}:where([data-scroll-area-viewport]){display:flex;flex-direction:column;align-items:stretch}:where([data-scroll-area-content]){flex-grow:1}a.svelte-1fk696n,button.svelte-1fk696n{cursor:pointer}html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}@media (hover: none) and (pointer: coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:#00000014}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:#ffffff4d}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]:after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y: translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y: translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y: translateY( calc(var(--lift) * var(--offset) + var(--lift) * -100%) );opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 87%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 93%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 84%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 43%, 17%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 9%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}.processing-container.svelte-16qxm4u{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem}.processing-text.svelte-16qxm4u{background:linear-gradient(90deg,var(--muted-foreground),var(--foreground),var(--muted-foreground));background-size:200% 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:svelte-16qxm4u-shine 1s linear infinite;font-weight:500;font-size:.875rem}@keyframes svelte-16qxm4u-shine{to{background-position:-200% 0}}.raw-output.svelte-16qxm4u{width:100%;max-width:48rem;margin-top:1.5rem;padding:1rem 1.25rem;border-radius:1rem;background:hsl(var(--muted) / .3);color:var(--foreground);font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Cascadia Code,Roboto Mono,Consolas,Liberation Mono,Menlo,monospace;font-size:.875rem;line-height:1.6;white-space:pre-wrap;word-break:break-word}.chat-processing-info-container.svelte-1m2w9ag{position:sticky;top:0;z-index:10;padding:1.5rem 1rem;opacity:0;transform:translateY(50%);pointer-events:none;transition:opacity .3s ease-out,transform .3s ease-out}.chat-processing-info-container.visible.svelte-1m2w9ag{opacity:1;pointer-events:auto;transform:translateY(0)}.chat-processing-info-content.svelte-1m2w9ag{display:flex;flex-wrap:wrap;align-items:center;gap:1rem;justify-content:center;max-width:48rem;margin:0 auto}.chat-processing-info-detail.svelte-1m2w9ag{color:var(--muted-foreground);font-size:.75rem;padding:.25rem .75rem;background:var(--muted);border-radius:.375rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace;white-space:nowrap}@media (max-width: 768px){.chat-processing-info-content.svelte-1m2w9ag{gap:.5rem}.chat-processing-info-detail.svelte-1m2w9ag{font-size:.7rem;padding:.2rem .5rem}}.conversation-chat-form.svelte-sn2p3p{position:relative}.conversation-chat-form.svelte-sn2p3p:after{content:"";position:fixed;bottom:0;z-index:-1;left:0;right:0;width:100%;height:2.375rem;background-color:var(--background)}button.svelte-5d6dyd [data-slot=dropdown-menu-trigger]:not([data-state=open]){opacity:0}button.svelte-5d6dyd:is(:where(.svelte-5d6dyd):hover) [data-slot=dropdown-menu-trigger]{opacity:1}@media (max-width: 768px){button.svelte-5d6dyd [data-slot=dropdown-menu-trigger]{opacity:1!important}}@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(./KaTeX_AMS-Regular.BQhdFMY1.woff2) format("woff2"),url(./KaTeX_AMS-Regular.DMm9YOAa.woff) format("woff"),url(./KaTeX_AMS-Regular.DRggAlZN.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(./KaTeX_Caligraphic-Bold.Dq_IR9rO.woff2) format("woff2"),url(./KaTeX_Caligraphic-Bold.BEiXGLvX.woff) format("woff"),url(./KaTeX_Caligraphic-Bold.ATXxdsX0.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(./KaTeX_Caligraphic-Regular.Di6jR-x-.woff2) format("woff2"),url(./KaTeX_Caligraphic-Regular.CTRA-rTL.woff) format("woff"),url(./KaTeX_Caligraphic-Regular.wX97UBjC.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(./KaTeX_Fraktur-Bold.CL6g_b3V.woff2) format("woff2"),url(./KaTeX_Fraktur-Bold.BsDP51OF.woff) format("woff"),url(./KaTeX_Fraktur-Bold.BdnERNNW.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(./KaTeX_Fraktur-Regular.CTYiF6lA.woff2) format("woff2"),url(./KaTeX_Fraktur-Regular.Dxdc4cR9.woff) format("woff"),url(./KaTeX_Fraktur-Regular.CB_wures.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(./KaTeX_Main-Bold.Cx986IdX.woff2) format("woff2"),url(./KaTeX_Main-Bold.Jm3AIy58.woff) format("woff"),url(./KaTeX_Main-Bold.waoOVXN0.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(./KaTeX_Main-BoldItalic.DxDJ3AOS.woff2) format("woff2"),url(./KaTeX_Main-BoldItalic.SpSLRI95.woff) format("woff"),url(./KaTeX_Main-BoldItalic.DzxPMmG6.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(./KaTeX_Main-Italic.NWA7e6Wa.woff2) format("woff2"),url(./KaTeX_Main-Italic.BMLOBm91.woff) format("woff"),url(./KaTeX_Main-Italic.3WenGoN9.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(./KaTeX_Main-Regular.B22Nviop.woff2) format("woff2"),url(./KaTeX_Main-Regular.Dr94JaBh.woff) format("woff"),url(./KaTeX_Main-Regular.ypZvNtVU.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(./KaTeX_Math-BoldItalic.CZnvNsCZ.woff2) format("woff2"),url(./KaTeX_Math-BoldItalic.iY-2wyZ7.woff) format("woff"),url(./KaTeX_Math-BoldItalic.B3XSjfu4.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(./KaTeX_Math-Italic.t53AETM-.woff2) format("woff2"),url(./KaTeX_Math-Italic.DA0__PXp.woff) format("woff"),url(./KaTeX_Math-Italic.flOr_0UB.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(./KaTeX_SansSerif-Bold.D1sUS0GD.woff2) format("woff2"),url(./KaTeX_SansSerif-Bold.DbIhKOiC.woff) format("woff"),url(./KaTeX_SansSerif-Bold.CFMepnvq.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(./KaTeX_SansSerif-Italic.C3H0VqGB.woff2) format("woff2"),url(./KaTeX_SansSerif-Italic.DN2j7dab.woff) format("woff"),url(./KaTeX_SansSerif-Italic.YYjJ1zSn.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(./KaTeX_SansSerif-Regular.DDBCnlJ7.woff2) format("woff2"),url(./KaTeX_SansSerif-Regular.CS6fqUqJ.woff) format("woff"),url(./KaTeX_SansSerif-Regular.BNo7hRIc.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(./KaTeX_Script-Regular.D3wIWfF6.woff2) format("woff2"),url(./KaTeX_Script-Regular.D5yQViql.woff) format("woff"),url(./KaTeX_Script-Regular.C5JkGWo-.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(./KaTeX_Size1-Regular.mCD8mA8B.woff2) format("woff2"),url(./KaTeX_Size1-Regular.C195tn64.woff) format("woff"),url(./KaTeX_Size1-Regular.Dbsnue_I.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(./KaTeX_Size2-Regular.Dy4dx90m.woff2) format("woff2"),url(./KaTeX_Size2-Regular.oD1tc_U0.woff) format("woff"),url(./KaTeX_Size2-Regular.B7gKUWhC.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(./KaTeX_Size3-Regular.CTq5MqoE.woff) format("woff"),url(./KaTeX_Size3-Regular.DgpXs0kz.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(./KaTeX_Size4-Regular.Dl5lxZxV.woff2) format("woff2"),url(./KaTeX_Size4-Regular.BF-4gkZK.woff) format("woff"),url(./KaTeX_Size4-Regular.DWFBv043.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(./KaTeX_Typewriter-Regular.CO6r4hn1.woff2) format("woff2"),url(./KaTeX_Typewriter-Regular.C0xS9mPB.woff) format("woff"),url(./KaTeX_Typewriter-Regular.D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.22"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}div.svelte-1dx4x3o p:not(:last-child){margin-bottom:1rem;line-height:1.75}div.svelte-1dx4x3o h1{font-size:1.875rem;font-weight:700;margin:1.5rem 0 .75rem;line-height:1.2}div.svelte-1dx4x3o h2{font-size:1.5rem;font-weight:600;margin:1.25rem 0 .5rem;line-height:1.3}div.svelte-1dx4x3o h3{font-size:1.25rem;font-weight:600;margin:1.5rem 0 .5rem;line-height:1.4}div.svelte-1dx4x3o h4{font-size:1.125rem;font-weight:600;margin:.75rem 0 .25rem}div.svelte-1dx4x3o h5{font-size:1rem;font-weight:600;margin:.5rem 0 .25rem}div.svelte-1dx4x3o h6{font-size:.875rem;font-weight:600;margin:.5rem 0 .25rem}div.svelte-1dx4x3o strong{font-weight:600}div.svelte-1dx4x3o em{font-style:italic}div.svelte-1dx4x3o del{text-decoration:line-through;opacity:.7}div.svelte-1dx4x3o code:not(pre code){background:var(--muted);color:var(--muted-foreground);padding:.125rem .375rem;border-radius:.375rem;font-size:.875rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Cascadia Code,Roboto Mono,Consolas,Liberation Mono,Menlo,monospace}div.svelte-1dx4x3o a{color:var(--primary);text-decoration:underline;text-underline-offset:2px;transition:color .2s ease}div.svelte-1dx4x3o a:hover{color:var(--primary)}div.svelte-1dx4x3o ul{list-style-type:disc;margin-left:1.5rem;margin-bottom:1rem}div.svelte-1dx4x3o ol{list-style-type:decimal;margin-left:1.5rem;margin-bottom:1rem}div.svelte-1dx4x3o li{margin-bottom:.25rem;padding-left:.5rem}div.svelte-1dx4x3o li::marker{color:var(--muted-foreground)}div.svelte-1dx4x3o ul ul{list-style-type:circle;margin-top:.25rem;margin-bottom:.25rem}div.svelte-1dx4x3o ol ol{list-style-type:lower-alpha;margin-top:.25rem;margin-bottom:.25rem}div.svelte-1dx4x3o .task-list-item{list-style:none;margin-left:0;padding-left:0}div.svelte-1dx4x3o .task-list-item-checkbox{margin-right:.5rem;margin-top:.125rem}div.svelte-1dx4x3o blockquote{border-left:4px solid var(--border);padding:.5rem 1rem;margin:1.5rem 0;font-style:italic;color:var(--muted-foreground);background:var(--muted);border-radius:0 .375rem .375rem 0}div.svelte-1dx4x3o table{width:100%;margin:1.5rem 0;border-collapse:collapse;border:1px solid var(--border);border-radius:.375rem;overflow:hidden}div.svelte-1dx4x3o th{background:hsl(var(--muted) / .3);border:1px solid var(--border);padding:.5rem .75rem;text-align:left;font-weight:600}div.svelte-1dx4x3o td{border:1px solid var(--border);padding:.5rem .75rem}div.svelte-1dx4x3o tr:nth-child(2n){background:hsl(var(--muted) / .1)}div.svelte-1dx4x3o hr{border:none;border-top:1px solid var(--border);margin:1.5rem 0}div.svelte-1dx4x3o img{border-radius:.5rem;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a;margin:1.5rem 0;max-width:100%;height:auto}div.svelte-1dx4x3o .code-block-wrapper{margin:1.5rem 0;border-radius:.75rem;overflow:hidden;border:1px solid var(--border);background:var(--code-background)}div.svelte-1dx4x3o .code-block-header{display:flex;justify-content:space-between;align-items:center;padding:.5rem 1rem;background:hsl(var(--muted) / .5);border-bottom:1px solid var(--border);font-size:.875rem}div.svelte-1dx4x3o .code-language{color:var(--code-foreground);font-weight:500;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Cascadia Code,Roboto Mono,Consolas,Liberation Mono,Menlo,monospace;text-transform:uppercase;font-size:.75rem;letter-spacing:.05em}div.svelte-1dx4x3o .copy-code-btn{display:flex;align-items:center;justify-content:center;padding:0;background:transparent;color:var(--code-foreground);cursor:pointer;transition:all .2s ease}div.svelte-1dx4x3o .copy-code-btn:hover{transform:scale(1.05)}div.svelte-1dx4x3o .copy-code-btn:active{transform:scale(.95)}div.svelte-1dx4x3o .code-block-wrapper pre{background:transparent;padding:1rem;margin:0;overflow-x:auto;border-radius:0;border:none;font-size:.875rem;line-height:1.5}div.svelte-1dx4x3o pre{background:var(--muted);margin:1.5rem 0;overflow-x:auto;border-radius:1rem;border:none}div.svelte-1dx4x3o code{background:transparent;color:var(--code-foreground)}div.svelte-1dx4x3o .mention{color:hsl(var(--primary));font-weight:500;text-decoration:none}div.svelte-1dx4x3o .mention:hover{text-decoration:underline}div.svelte-1dx4x3o .hashtag{color:hsl(var(--primary));font-weight:500;text-decoration:none}div.svelte-1dx4x3o .hashtag:hover{text-decoration:underline}div.svelte-1dx4x3o table{transition:all .2s ease}div.svelte-1dx4x3o table:hover{box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}div.svelte-1dx4x3o th:hover,div.svelte-1dx4x3o td:hover{background:var(--muted)}div.svelte-1dx4x3o blockquote{transition:all .2s ease;position:relative}div.svelte-1dx4x3o blockquote:hover{border-left-width:6px;background:var(--muted);transform:translate(2px)}div.svelte-1dx4x3o blockquote:before{content:'"';position:absolute;top:-.5rem;left:.5rem;font-size:3rem;color:var(--muted-foreground);font-family:serif;line-height:1}div.svelte-1dx4x3o img{transition:all .3s ease;cursor:pointer}div.svelte-1dx4x3o img:hover{transform:scale(1.02);box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a}div.svelte-1dx4x3o .image-zoom-overlay{position:fixed;inset:0;background:#000c;display:flex;align-items:center;justify-content:center;z-index:1000;cursor:pointer}div.svelte-1dx4x3o .image-zoom-overlay img{max-width:90vw;max-height:90vh;border-radius:.5rem;box-shadow:0 25px 50px -12px #00000040}div.svelte-1dx4x3o hr{border:none;height:2px;background:linear-gradient(to right,transparent,var(--border),transparent);margin:2rem 0;position:relative}div.svelte-1dx4x3o hr:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:1rem;height:1rem;background:var(--border);border-radius:50%}div.svelte-1dx4x3o .table-wrapper{overflow-x:auto;margin:1.5rem 0;border-radius:.5rem;border:1px solid var(--border)}div.svelte-1dx4x3o .table-wrapper table{margin:0;border:none}@media (max-width: 640px){div.svelte-1dx4x3o h1{font-size:1.5rem}div.svelte-1dx4x3o h2{font-size:1.25rem}div.svelte-1dx4x3o h3{font-size:1.125rem}div.svelte-1dx4x3o table{font-size:.875rem}div.svelte-1dx4x3o th,div.svelte-1dx4x3o td{padding:.375rem .5rem}div.svelte-1dx4x3o .table-wrapper{margin:.5rem -1rem;border-radius:0;border-left:none;border-right:none}}@media (prefers-color-scheme: dark){div.svelte-1dx4x3o blockquote:hover{background:var(--muted)}}
</style>
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">
<script>
{
__sveltekit_b3qtxx = {
base: new URL('.', location).pathname.slice(0, -1)
};
const element = document.currentScript.parentElement;
var oA=kn=>{throw TypeError(kn)};var U5=(kn,Fr,vi)=>Fr.has(kn)||oA("Cannot "+vi);var In=(kn,Fr,vi)=>(U5(kn,Fr,"read from private field"),vi?vi.call(kn):Fr.get(kn)),zs=(kn,Fr,vi)=>Fr.has(kn)?oA("Cannot add the same private member more than once"):Fr instanceof WeakSet?Fr.add(kn):Fr.set(kn,vi),oa=(kn,Fr,vi,vl)=>(U5(kn,Fr,"write to private field"),vl?vl.call(kn,vi):Fr.set(kn,vi),vi),js=(kn,Fr,vi)=>(U5(kn,Fr,"access private method"),vi);var lA=(kn,Fr,vi,vl)=>({set _(Eo){oa(kn,Fr,Eo,vi)},get _(){return In(kn,Fr,vl)}});this.__sveltekit_b3qtxx=this.__sveltekit_b3qtxx||{};this.__sveltekit_b3qtxx.app=function(kn){"use strict";var dl,ns,xo,dc,F1,fc,gc,Gi,Q1,cA,uA,Nd,Ou,Z1;var Fr=typeof document<"u"?document.currentScript:null;const vi=!0,vl=!1;var Eo=Array.isArray,hA=Array.prototype.indexOf,eg=Array.from,Du=Object.defineProperty,To=Object.getOwnPropertyDescriptor,z5=Object.getOwnPropertyDescriptors,j5=Object.prototype,dA=Array.prototype,Rd=Object.getPrototypeOf,H5=Object.isExtensible;function wc(r){return typeof r=="function"}const Re=()=>{};function fA(r){return r()}function Pd(r){for(var e=0;e<r.length;e++)r[e]()}function gA(){var r,e,t=new Promise((n,i)=>{r=n,e=i});return{promise:t,resolve:r,reject:e}}function pA(r,e){if(Array.isArray(r))return r;if(!(Symbol.iterator in r))return Array.from(r);const t=[];for(const n of r)if(t.push(n),t.length===e)break;return t}const la=2,tg=4,Fd=8,xc=16,Hs=32,yl=64,q5=128,_a=256,Dd=512,ci=1024,$i=2048,wl=4096,Xa=8192,xl=16384,Ld=32768,Sl=65536,G5=1<<17,W5=1<<18,rg=1<<19,ng=1<<20,ig=1<<21,ag=1<<22,kl=1<<23,ss=Symbol("$state"),sg=Symbol("legacy props"),mA=Symbol(""),og=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},bA=1,lg=3,Io=8;function vA(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Sc(r){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function yA(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function wA(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function xA(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function SA(r){throw new Error("https://svelte.dev/e/effect_orphan")}function kA(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function AA(){throw new Error("https://svelte.dev/e/get_abort_signal_outside_reaction")}function _A(){throw new Error("https://svelte.dev/e/hydration_failed")}function V5(r){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function CA(r){throw new Error("https://svelte.dev/e/props_invalid_value")}function EA(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function TA(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function IA(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const Bd=1,Ud=2,X5=4,MA=8,OA=16,NA=1,RA=2,PA=4,FA=8,DA=16,LA=4,BA=1,UA=2,cg="[",ug="[!",hg="]",Al={},ii=Symbol(),zA="http://www.w3.org/1999/xhtml",jA="http://www.w3.org/2000/svg",$5="@attach";function Lu(r){console.warn("https://svelte.dev/e/hydration_mismatch")}function HA(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let er=!1;function Ri(r){er=r}let yr;function ui(r){if(r===null)throw Lu(),Al;return yr=r}function Ca(){return ui(Ta(yr))}function Q(r){if(er){if(Ta(yr)!==null)throw Lu(),Al;yr=r}}function Rt(r=1){if(er){for(var e=r,t=yr;e--;)t=Ta(t);yr=t}}function dg(){for(var r=0,e=yr;;){if(e.nodeType===Io){var t=e.data;if(t===hg){if(r===0)return e;r-=1}else(t===cg||t===ug)&&(r+=1)}var n=Ta(e);e.remove(),e=n}}function K5(r){if(!r||r.nodeType!==Io)throw Lu(),Al;return r.data}function Y5(r){return r===this.v}function fg(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function qA(r,e){return r!==e}function J5(r){return!fg(r,this.v)}let kc=!1,GA=!1;function WA(){kc=!0}const VA=[];function zd(r,e=!1){return jd(r,new Map,"",VA)}function jd(r,e,t,n,i=null){if(typeof r=="object"&&r!==null){var a=e.get(r);if(a!==void 0)return a;if(r instanceof Map)return new Map(r);if(r instanceof Set)return new Set(r);if(Eo(r)){var s=Array(r.length);e.set(r,s),i!==null&&e.set(i,s);for(var o=0;o<r.length;o+=1){var l=r[o];o in r&&(s[o]=jd(l,e,t,n))}return s}if(Rd(r)===j5){s={},e.set(r,s),i!==null&&e.set(i,s);for(var c in r)s[c]=jd(r[c],e,t,n);return s}if(r instanceof Date)return structuredClone(r);if(typeof r.toJSON=="function")return jd(r.toJSON(),e,t,n,r)}if(r instanceof EventTarget)return r;try{return structuredClone(r)}catch{return r}}let ln=null;function Hd(r){ln=r}function Ac(r){return Gd().get(r)}function qd(r,e){return Gd().set(r,e),e}function gg(r){return Gd().has(r)}function Q5(){return Gd()}function ge(r,e=!1,t){ln={p:ln,c:null,e:null,s:r,x:null,l:kc&&!e?{s:null,u:null,$:[]}:null}}function pe(r){var e=ln,t=e.e;if(t!==null){e.e=null;for(var n of t)m9(n)}return r!==void 0&&(e.x=r),ln=e.p,r??{}}function _l(){return!kc||ln!==null&&ln.l===null}function Gd(r){return ln===null&&Sc(),ln.c??=new Map(XA(ln)||void 0)}function XA(r){let e=r.p;for(;e!==null;){const t=e.c;if(t!==null)return t;e=e.p}return null}const $A=new WeakMap;function KA(r){var e=Dr;if(e===null)return Xr.f|=kl,r;if((e.f&Ld)===0){if((e.f&q5)===0)throw!e.parent&&r instanceof Error&&Z5(r),r;e.b.error(r)}else pg(r,e)}function pg(r,e){for(;e!==null;){if((e.f&q5)!==0)try{e.b.error(r);return}catch(t){r=t}e=e.parent}throw r instanceof Error&&Z5(r),r}function Z5(r){const e=$A.get(r);e&&(Du(r,"message",{value:e.message}),Du(r,"stack",{value:e.stack}))}const YA=typeof requestIdleCallback>"u"?r=>setTimeout(r,1):requestIdleCallback;let Bu=[],Uu=[];function e9(){var r=Bu;Bu=[],Pd(r)}function t9(){var r=Uu;Uu=[],Pd(r)}function _c(r){Bu.length===0&&queueMicrotask(e9),Bu.push(r)}function JA(r){Uu.length===0&&YA(t9),Uu.push(r)}function QA(){Bu.length>0&&e9(),Uu.length>0&&t9()}function Cl(r){let e=0,t=No(0),n;return()=>{s_()&&(g(t),Kd(()=>(e===0&&(n=dn(()=>r(()=>Ea(t)))),e+=1,()=>{_c(()=>{e-=1,e===0&&(n?.(),n=void 0)})})))}}function ZA(){for(var r=Dr.b;r!==null&&!r.has_pending_snippet();)r=r.parent;return r===null&&vA(),r}function zu(r){var e=la|$i,t=Xr!==null&&(Xr.f&la)!==0?Xr:null;return Dr===null||t!==null&&(t.f&_a)!==0?e|=_a:Dr.f|=rg,{ctx:ln,deps:null,effects:null,equals:Y5,f:e,fn:r,reactions:null,rv:0,v:ii,wv:0,parent:t??Dr,ac:null}}function e_(r,e){let t=Dr;t===null&&yA();var n=t.b,i=void 0,a=No(ii),s=null,o=!Xr;return l_(()=>{try{var l=r()}catch(f){l=Promise.reject(f)}var c=()=>l;i=s?.then(c,c)??Promise.resolve(l),s=i;var u=Bn,h=n.pending;o&&(n.update_pending_count(1),h||u.increment());const d=(f,p=void 0)=>{s=null,h||u.activate(),p?p!==og&&(a.f|=kl,ju(a,p)):((a.f&kl)!==0&&(a.f^=kl),ju(a,f)),o&&(n.update_pending_count(-1),h||u.decrement()),a9()};if(i.then(d,f=>d(null,f||"unknown")),u)return()=>{queueMicrotask(()=>u.neuter())}}),new Promise(l=>{function c(u){function h(){u===i?l(a):c(i)}u.then(h,h)}c(i)})}function j(r){const e=zu(r);return _9(e),e}function mg(r){const e=zu(r);return e.equals=J5,e}function r9(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)Pi(e[t])}}function t_(r){for(var e=r.parent;e!==null;){if((e.f&la)===0)return e;e=e.parent}return null}function bg(r){var e,t=Dr;Ro(t_(r));try{r9(r),e=I9(r)}finally{Ro(t)}return e}function n9(r){var e=bg(r);if(r.equals(e)||(r.v=e,r.wv=E9()),!Il)if(Cc!==null)Cc.set(r,r.v);else{var t=(Po||(r.f&_a)!==0)&&r.deps!==null?wl:ci;di(r,t)}}function i9(r,e,t){const n=_l()?zu:mg;if(e.length===0){t(r.map(n));return}var i=Bn,a=Dr,s=r_(),o=ZA();Promise.all(e.map(l=>e_(l))).then(l=>{i?.activate(),s();try{t([...r.map(n),...l])}catch(c){(a.f&xl)===0&&pg(c,a)}i?.deactivate(),a9()}).catch(l=>{o.error(l)})}function r_(){var r=Dr,e=Xr,t=ln;return function(){Ro(r),os(e),Hd(t)}}function a9(){Ro(null),os(null),Hd(null)}const Wd=new Set;let Bn=null,Cc=null,s9=new Set,Vd=[];function o9(){const r=Vd.shift();Vd.length>0&&queueMicrotask(o9),r()}let Ec=[],Xd=null,vg=!1;class Mo{#e=new Map;#t=new Map;#r=new Set;#n=0;#a=null;#i=!1;#s=[];#o=[];#l=[];#c=[];#h=[];skipped_effects=new Set;#u(e){Ec=[];var t=null;if(Wd.size>1){t=new Map,Cc=new Map;for(const[a,s]of this.#e)t.set(a,{v:a.v,wv:a.wv}),a.v=s;for(const a of Wd)if(a!==this)for(const[s,o]of a.#t)t.has(s)||(t.set(s,{v:s.v,wv:s.wv}),s.v=o)}for(const a of e)this.#g(a);if(this.#s.length===0&&this.#n===0){var n=this.#l,i=this.#c;this.#l=[],this.#c=[],this.#h=[],this.#p(),l9(n),l9(i),this.#a?.resolve()}else{for(const a of this.#l)di(a,ci);for(const a of this.#c)di(a,ci);for(const a of this.#h)di(a,ci)}if(t){for(const[a,{v:s,wv:o}]of t)a.wv<=o&&(a.v=s);Cc=null}for(const a of this.#s)Vu(a);for(const a of this.#o)Vu(a);this.#s=[],this.#o=[]}#g(e){e.f^=ci;for(var t=e.first;t!==null;){var n=t.f,i=(n&(Hs|yl))!==0,a=i&&(n&ci)!==0,s=a||(n&Xa)!==0||this.skipped_effects.has(t);if(!s&&t.fn!==null){if(i)t.f^=ci;else if((n&tg)!==0)this.#c.push(t);else if(Qd(t))if((n&ag)!==0){var o=t.b?.pending?this.#o:this.#s;o.push(t)}else(t.f&xc)!==0&&this.#h.push(t),Vu(t);var l=t.first;if(l!==null){t=l;continue}}var c=t.parent;for(t=t.next;t===null&&c!==null;)t=c.next,c=c.parent}}capture(e,t){this.#t.has(e)||this.#t.set(e,t),this.#e.set(e,e.v)}activate(){Bn=this}deactivate(){Bn=null;for(const e of s9)if(s9.delete(e),e(),Bn!==null)break}neuter(){this.#i=!0}flush(){Ec.length>0?this.flush_effects():this.#p(),Bn===this&&(this.#n===0&&Wd.delete(this),this.deactivate())}flush_effects(){var e=Mc;vg=!0;try{var t=0;for(k9(!0);Ec.length>0;){if(t++>1e3){var n,i;n_()}this.#u(Ec),El.clear()}}finally{vg=!1,k9(e),Xd=null}}#p(){if(!this.#i)for(const e of this.#r)e();this.#r.clear()}increment(){this.#n+=1}decrement(){if(this.#n-=1,this.#n===0){for(const e of this.#l)di(e,$i),Oo(e);for(const e of this.#c)di(e,$i),Oo(e);for(const e of this.#h)di(e,$i),Oo(e);this.#l=[],this.#c=[],this.flush()}else this.deactivate()}add_callback(e){this.#r.add(e)}settled(){return(this.#a??=gA()).promise}static ensure(e=!0){if(Bn===null){const t=Bn=new Mo;Wd.add(Bn),e&&Mo.enqueue(()=>{Bn===t&&t.flush()})}return Bn}static enqueue(e){Vd.length===0&&queueMicrotask(o9),Vd.unshift(e)}}function yg(r){var e;const t=Mo.ensure(!1);for(r&&(t.flush_effects(),e=r());;){if(QA(),Ec.length===0)return t===Bn&&t.flush(),Xd=null,e;t.flush_effects()}}function n_(){try{kA()}catch(r){pg(r,Xd)}}function l9(r){var e=r.length;if(e!==0){for(var t=0;t<e;t++){var n=r[t];if((n.f&(xl|Xa))===0&&Qd(n)){var i=Jd;if(Vu(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null&&n.ac===null?w9(n):n.fn=null),Jd>i&&(n.f&ng)!==0)break}}for(;t<e;t+=1)Oo(r[t])}}function Oo(r){for(var e=Xd=r;e.parent!==null;){e=e.parent;var t=e.f;if(vg&&e===Dr&&(t&xc)!==0)return;if((t&(yl|Hs))!==0){if((t&ci)===0)return;e.f^=ci}}Ec.push(e)}const El=new Map;function No(r,e){var t={f:0,v:r,reactions:null,equals:Y5,rv:0,wv:0};return t}function oe(r,e){const t=No(r);return _9(t),t}function wg(r,e=!1,t=!0){const n=No(r);return e||(n.equals=J5),kc&&t&&ln!==null&&ln.l!==null&&(ln.l.s??=[]).push(n),n}function O(r,e,t=!1){Xr!==null&&(!Ka||(Xr.f&G5)!==0)&&_l()&&(Xr.f&(la|xc|ag|G5))!==0&&!Gs?.includes(r)&&IA();let n=t?Mr(e):e;return ju(r,n)}function ju(r,e){if(!r.equals(e)){var t=r.v;Il?El.set(r,e):El.set(r,t),r.v=e,Mo.ensure().capture(r,t),(r.f&la)!==0&&((r.f&$i)!==0&&bg(r),di(r,(r.f&_a)===0?ci:wl)),r.wv=E9(),u9(r,$i),_l()&&Dr!==null&&(Dr.f&ci)!==0&&(Dr.f&(Hs|yl))===0&&(Ma===null?u_([r]):Ma.push(r))}return e}function c9(r,e=1){var t=g(r),n=e===1?t++:t--;return O(r,t),n}function Ea(r){O(r,r.v+1)}function u9(r,e){var t=r.reactions;if(t!==null)for(var n=_l(),i=t.length,a=0;a<i;a++){var s=t[a],o=s.f;!n&&s===Dr||((o&$i)===0&&di(s,e),(o&la)!==0?u9(s,wl):(o&$i)===0&&Oo(s))}}function Mr(r){if(typeof r!="object"||r===null||ss in r)return r;const e=Rd(r);if(e!==j5&&e!==dA)return r;var t=new Map,n=Eo(r),i=oe(0),a=Ya,s=o=>{if(Ya===a)return o();var l=Xr,c=Ya;os(null),C9(a);var u=o();return os(l),C9(c),u};return n&&t.set("length",oe(r.length)),new Proxy(r,{defineProperty(o,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&EA();var u=t.get(l);return u===void 0?u=s(()=>{var h=oe(c.value);return t.set(l,h),h}):O(u,c.value,!0),!0},deleteProperty(o,l){var c=t.get(l);if(c===void 0){if(l in o){const u=s(()=>oe(ii));t.set(l,u),Ea(i)}}else O(c,ii),Ea(i);return!0},get(o,l,c){if(l===ss)return r;var u=t.get(l),h=l in o;if(u===void 0&&(!h||To(o,l)?.writable)&&(u=s(()=>{var f=Mr(h?o[l]:ii),p=oe(f);return p}),t.set(l,u)),u!==void 0){var d=g(u);return d===ii?void 0:d}return Reflect.get(o,l,c)},getOwnPropertyDescriptor(o,l){var c=Reflect.getOwnPropertyDescriptor(o,l);if(c&&"value"in c){var u=t.get(l);u&&(c.value=g(u))}else if(c===void 0){var h=t.get(l),d=h?.v;if(h!==void 0&&d!==ii)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return c},has(o,l){if(l===ss)return!0;var c=t.get(l),u=c!==void 0&&c.v!==ii||Reflect.has(o,l);if(c!==void 0||Dr!==null&&(!u||To(o,l)?.writable)){c===void 0&&(c=s(()=>{var d=u?Mr(o[l]):ii,f=oe(d);return f}),t.set(l,c));var h=g(c);if(h===ii)return!1}return u},set(o,l,c,u){var h=t.get(l),d=l in o;if(n&&l==="length")for(var f=c;f<h.v;f+=1){var p=t.get(f+"");p!==void 0?O(p,ii):f in o&&(p=s(()=>oe(ii)),t.set(f+"",p))}if(h===void 0)(!d||To(o,l)?.writable)&&(h=s(()=>oe(void 0)),O(h,Mr(c)),t.set(l,h));else{d=h.v!==ii;var m=s(()=>Mr(c));O(h,m)}var y=Reflect.getOwnPropertyDescriptor(o,l);if(y?.set&&y.set.call(u,c),!d){if(n&&typeof l=="string"){var v=t.get("length"),x=Number(l);Number.isInteger(x)&&x>=v.v&&O(v,x+1)}Ea(i)}return!0},ownKeys(o){g(i);var l=Reflect.ownKeys(o).filter(h=>{var d=t.get(h);return d===void 0||d.v!==ii});for(var[c,u]of t)u.v!==ii&&!(c in o)&&l.push(c);return l},setPrototypeOf(){TA()}})}function h9(r){try{if(r!==null&&typeof r=="object"&&ss in r)return r[ss]}catch{}return r}function i_(r,e){return Object.is(h9(r),h9(e))}var Tl,Tc,d9,f9,g9;function xg(){if(Tl===void 0){Tl=window,Tc=document,d9=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;f9=To(e,"firstChild").get,g9=To(e,"nextSibling").get,H5(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),H5(t)&&(t.__t=void 0)}}function Ki(r=""){return document.createTextNode(r)}function hi(r){return f9.call(r)}function Ta(r){return g9.call(r)}function te(r,e){if(!er)return hi(r);var t=hi(yr);if(t===null)t=yr.appendChild(Ki());else if(e&&t.nodeType!==lg){var n=Ki();return t?.before(n),ui(n),n}return ui(t),t}function F(r,e){if(!er){var t=hi(r);return t instanceof Comment&&t.data===""?Ta(t):t}return yr}function ae(r,e=1,t=!1){let n=er?yr:r;for(var i;e--;)i=n,n=Ta(n);if(!er)return n;if(t&&n?.nodeType!==lg){var a=Ki();return n===null?i?.after(a):n.before(a),ui(a),a}return ui(n),n}function Sg(r){r.textContent=""}function $d(){return!1}function p9(r){Dr===null&&Xr===null&&SA(),Xr!==null&&(Xr.f&_a)!==0&&Dr===null&&xA(),Il&&wA()}function a_(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function $a(r,e,t,n=!0){var i=Dr;i!==null&&(i.f&Xa)!==0&&(r|=Xa);var a={ctx:ln,deps:null,nodes_start:null,nodes_end:null,f:r|$i,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(t)try{Vu(a),a.f|=Ld}catch(l){throw Pi(a),l}else e!==null&&Oo(a);var s=t&&a.deps===null&&a.first===null&&a.nodes_start===null&&a.teardown===null&&(a.f&rg)===0;if(!s&&n&&(i!==null&&a_(a,i),Xr!==null&&(Xr.f&la)!==0)){var o=Xr;(o.effects??=[]).push(a)}return a}function s_(){return Xr!==null&&!Ka}function Hu(r){const e=$a(Fd,null,!1);return di(e,ci),e.teardown=r,e}function Ft(r){p9();var e=Dr.f,t=!Xr&&(e&Hs)!==0&&(e&Ld)===0;if(t){var n=ln;(n.e??=[]).push(r)}else return m9(r)}function m9(r){return $a(tg|ng,r,!1)}function yi(r){return p9(),$a(Fd|ng,r,!0)}function qu(r){Mo.ensure();const e=$a(yl,r,!0);return()=>{Pi(e)}}function o_(r){Mo.ensure();const e=$a(yl,r,!0);return(t={})=>new Promise(n=>{t.outro?Ic(e,()=>{Pi(e),n(void 0)}):(Pi(e),n(void 0))})}function Gu(r){return $a(tg,r,!1)}function l_(r){return $a(ag|rg,r,!0)}function Kd(r,e=0){return $a(Fd|e,r,!0)}function qe(r,e=[],t=[]){i9(e,t,n=>{$a(Fd,()=>r(...n.map(g)),!0)})}function qs(r,e=0){var t=$a(xc|e,r,!0);return t}function Ia(r,e=!0){return $a(Hs,r,!0,e)}function b9(r){var e=r.teardown;if(e!==null){const t=Il,n=Xr;A9(!0),os(null);try{e.call(null)}finally{A9(t),os(n)}}}function v9(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){t.ac?.abort(og);var n=t.next;(t.f&yl)!==0?t.parent=null:Pi(t,e),t=n}}function c_(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&Hs)===0&&Pi(e),e=t}}function Pi(r,e=!0){var t=!1;(e||(r.f&W5)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(y9(r.nodes_start,r.nodes_end),t=!0),v9(r,e&&!t),Zd(r,0),di(r,xl);var n=r.transitions;if(n!==null)for(const a of n)a.stop();b9(r);var i=r.parent;i!==null&&i.first!==null&&w9(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=r.ac=null}function y9(r,e){for(;r!==null;){var t=r===e?null:Ta(r);r.remove(),r=t}}function w9(r){var e=r.parent,t=r.prev,n=r.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===r&&(e.first=n),e.last===r&&(e.last=t))}function Ic(r,e){var t=[];kg(r,t,!0),x9(t,()=>{Pi(r),e&&e()})}function x9(r,e){var t=r.length;if(t>0){var n=()=>--t||e();for(var i of r)i.out(n)}else e()}function kg(r,e,t){if((r.f&Xa)===0){if(r.f^=Xa,r.transitions!==null)for(const s of r.transitions)(s.is_global||t)&&e.push(s);for(var n=r.first;n!==null;){var i=n.next,a=(n.f&Sl)!==0||(n.f&Hs)!==0;kg(n,e,a?t:!1),n=i}}}function Yd(r){S9(r,!0)}function S9(r,e){if((r.f&Xa)!==0){r.f^=Xa,(r.f&ci)===0&&(di(r,$i),Oo(r));for(var t=r.first;t!==null;){var n=t.next,i=(t.f&Sl)!==0||(t.f&Hs)!==0;S9(t,i?e:!1),t=n}if(r.transitions!==null)for(const a of r.transitions)(a.is_global||e)&&a.in()}}let Mc=!1;function k9(r){Mc=r}let Il=!1;function A9(r){Il=r}let Xr=null,Ka=!1;function os(r){Xr=r}let Dr=null;function Ro(r){Dr=r}let Gs=null;function _9(r){Xr!==null&&(Gs===null?Gs=[r]:Gs.push(r))}let Fi=null,ca=0,Ma=null;function u_(r){Ma=r}let Jd=1,Wu=0,Ya=Wu;function C9(r){Ya=r}let Po=!1;function E9(){return++Jd}function Qd(r){var e=r.f;if((e&$i)!==0)return!0;if((e&wl)!==0){var t=r.deps,n=(e&_a)!==0;if(t!==null){var i,a,s=(e&Dd)!==0,o=n&&Dr!==null&&!Po,l=t.length;if((s||o)&&(Dr===null||(Dr.f&xl)===0)){var c=r,u=c.parent;for(i=0;i<l;i++)a=t[i],(s||!a?.reactions?.includes(c))&&(a.reactions??=[]).push(c);s&&(c.f^=Dd),o&&u!==null&&(u.f&_a)===0&&(c.f^=_a)}for(i=0;i<l;i++)if(a=t[i],Qd(a)&&n9(a),a.wv>r.wv)return!0}(!n||Dr!==null&&!Po)&&di(r,ci)}return!1}function T9(r,e,t=!0){var n=r.reactions;if(n!==null&&!Gs?.includes(r))for(var i=0;i<n.length;i++){var a=n[i];(a.f&la)!==0?T9(a,e,!1):e===a&&(t?di(a,$i):(a.f&ci)!==0&&di(a,wl),Oo(a))}}function I9(r){var e=Fi,t=ca,n=Ma,i=Xr,a=Po,s=Gs,o=ln,l=Ka,c=Ya,u=r.f;Fi=null,ca=0,Ma=null,Po=(u&_a)!==0&&(Ka||!Mc||Xr===null),Xr=(u&(Hs|yl))===0?r:null,Gs=null,Hd(r.ctx),Ka=!1,Ya=++Wu,r.ac!==null&&(r.ac.abort(og),r.ac=null);try{r.f|=ig;var h=(0,r.fn)(),d=r.deps;if(Fi!==null){var f;if(Zd(r,ca),d!==null&&ca>0)for(d.length=ca+Fi.length,f=0;f<Fi.length;f++)d[ca+f]=Fi[f];else r.deps=d=Fi;if(!Po||(u&la)!==0&&r.reactions!==null)for(f=ca;f<d.length;f++)(d[f].reactions??=[]).push(r)}else d!==null&&ca<d.length&&(Zd(r,ca),d.length=ca);if(_l()&&Ma!==null&&!Ka&&d!==null&&(r.f&(la|wl|$i))===0)for(f=0;f<Ma.length;f++)T9(Ma[f],r);return i!==null&&i!==r&&(Wu++,Ma!==null&&(n===null?n=Ma:n.push(...Ma))),(r.f&kl)!==0&&(r.f^=kl),h}catch(p){return KA(p)}finally{r.f^=ig,Fi=e,ca=t,Ma=n,Xr=i,Po=a,Gs=s,Hd(o),Ka=l,Ya=c}}function h_(r,e){let t=e.reactions;if(t!==null){var n=hA.call(t,r);if(n!==-1){var i=t.length-1;i===0?t=e.reactions=null:(t[n]=t[i],t.pop())}}t===null&&(e.f&la)!==0&&(Fi===null||!Fi.includes(e))&&(di(e,wl),(e.f&(_a|Dd))===0&&(e.f^=Dd),r9(e),Zd(e,0))}function Zd(r,e){var t=r.deps;if(t!==null)for(var n=e;n<t.length;n++)h_(r,t[n])}function Vu(r){var e=r.f;if((e&xl)===0){di(r,ci);var t=Dr,n=Mc;Dr=r,Mc=!0;try{(e&xc)!==0?c_(r):v9(r),b9(r);var i=I9(r);r.teardown=typeof i=="function"?i:null,r.wv=Jd;var a;vl&&GA&&(r.f&$i)!==0&&r.deps}finally{Mc=n,Dr=t}}}async function Oc(){await Promise.resolve(),yg()}function d_(){return Mo.ensure().settled()}function g(r){var e=r.f,t=(e&la)!==0;if(Xr!==null&&!Ka){var n=Dr!==null&&(Dr.f&xl)!==0;if(!n&&!Gs?.includes(r)){var i=Xr.deps;if((Xr.f&ig)!==0)r.rv<Wu&&(r.rv=Wu,Fi===null&&i!==null&&i[ca]===r?ca++:Fi===null?Fi=[r]:(!Po||!Fi.includes(r))&&Fi.push(r));else{(Xr.deps??=[]).push(r);var a=r.reactions;a===null?r.reactions=[Xr]:a.includes(Xr)||a.push(Xr)}}}else if(t&&r.deps===null&&r.effects===null){var s=r,o=s.parent;o!==null&&(o.f&_a)===0&&(s.f^=_a)}if(Il){if(El.has(r))return El.get(r);if(t){s=r;var l=s.v;return((s.f&ci)===0&&s.reactions!==null||M9(s))&&(l=bg(s)),El.set(s,l),l}}else if(t){if(s=r,Cc?.has(s))return Cc.get(s);Qd(s)&&n9(s)}if((r.f&kl)!==0)throw r.v;return r.v}function M9(r){if(r.v===ii)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(El.has(e)||(e.f&la)!==0&&M9(e))return!0;return!1}function dn(r){var e=Ka;try{return Ka=!0,r()}finally{Ka=e}}const f_=-7169;function di(r,e){r.f=r.f&f_|e}function g_(r){if(!(typeof r!="object"||!r||r instanceof EventTarget)){if(ss in r)Ag(r);else if(!Array.isArray(r))for(let e in r){const t=r[e];typeof t=="object"&&t&&ss in t&&Ag(t)}}}function Ag(r,e=new Set){if(typeof r=="object"&&r!==null&&!(r instanceof EventTarget)&&!e.has(r)){e.add(r),r instanceof Date&&r.getTime();for(let n in r)try{Ag(r[n],e)}catch{}const t=Rd(r);if(t!==Object.prototype&&t!==Array.prototype&&t!==Map.prototype&&t!==Set.prototype&&t!==Date.prototype){const n=z5(t);for(let i in n){const a=n[i].get;if(a)try{a.call(r)}catch{}}}}}function p_(){return Symbol($5)}function m_(r){return r.endsWith("capture")&&r!=="gotpointercapture"&&r!=="lostpointercapture"}const b_=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function v_(r){return b_.includes(r)}const y_={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function w_(r){return r=r.toLowerCase(),y_[r]??r}const x_=["touchstart","touchmove"];function S_(r){return x_.includes(r)}const k_=["textarea","script","style","title"];function A_(r){return k_.includes(r)}function __(r,e){if(e){const t=document.body;r.autofocus=!0,_c(()=>{document.activeElement===t&&r.focus()})}}function e0(r){er&&hi(r)!==null&&Sg(r)}let O9=!1;function N9(){O9||(O9=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{if(!r.defaultPrevented)for(const e of r.target.elements)e.__on_r?.()})},{capture:!0}))}function C_(r,e,t,n=!0){n&&t();for(var i of e)r.addEventListener(i,t);Hu(()=>{for(var a of e)r.removeEventListener(a,t)})}function Xu(r){var e=Xr,t=Dr;os(null),Ro(null);try{return r()}finally{os(e),Ro(t)}}function R9(r,e,t,n=t){r.addEventListener(e,()=>Xu(t));const i=r.__on_r;i?r.__on_r=()=>{i(),n(!0)}:r.__on_r=()=>n(!0),N9()}const P9=new Set,_g=new Set;function Cg(r,e,t,n={}){function i(a){if(n.capture||$u.call(e,a),!a.cancelBubble)return Xu(()=>t?.call(this,a))}return r.startsWith("pointer")||r.startsWith("touch")||r==="wheel"?_c(()=>{e.addEventListener(r,i,n)}):e.addEventListener(r,i,n),i}function $r(r,e,t,n={}){var i=Cg(e,r,t,n);return()=>{r.removeEventListener(e,i,n)}}function Rn(r,e,t,n,i){var a={capture:n,passive:i},s=Cg(r,e,t,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Hu(()=>{e.removeEventListener(r,s,a)})}function wi(r){for(var e=0;e<r.length;e++)P9.add(r[e]);for(var t of _g)t(r)}function $u(r){var e=this,t=e.ownerDocument,n=r.type,i=r.composedPath?.()||[],a=i[0]||r.target,s=0,o=r.__root;if(o){var l=i.indexOf(o);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var c=i.indexOf(e);if(c===-1)return;l<=c&&(s=l)}if(a=i[s]||r.target,a!==e){Du(r,"currentTarget",{configurable:!0,get(){return a||t}});var u=Xr,h=Dr;os(null),Ro(null);try{for(var d,f=[];a!==null;){var p=a.assignedSlot||a.parentNode||a.host||null;try{var m=a["__"+n];if(m!=null&&(!a.disabled||r.target===a))if(Eo(m)){var[y,...v]=m;y.apply(a,[r,...v])}else m.call(a,r)}catch(x){d?f.push(x):d=x}if(r.cancelBubble||p===e||p===null)break;a=p}if(d){for(let x of f)queueMicrotask(()=>{throw x});throw d}}finally{r.__root=e,delete r.currentTarget,os(u),Ro(h)}}}let Oa;function E_(){Oa=void 0}function t0(r){let e=null,t=er;var n;if(er){for(e=yr,Oa===void 0&&(Oa=hi(document.head));Oa!==null&&(Oa.nodeType!==Io||Oa.data!==cg);)Oa=Ta(Oa);Oa===null?Ri(!1):Oa=ui(Ta(Oa))}er||(n=document.head.appendChild(Ki()));try{qs(()=>r(n),W5)}finally{t&&(Ri(!0),Oa=yr,ui(e))}}function r0(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function Yi(r,e){var t=Dr;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function ee(r,e){var t=(e&BA)!==0,n=(e&UA)!==0,i,a=!r.startsWith("<!>");return()=>{if(er)return Yi(yr,null),yr;i===void 0&&(i=r0(a?r:"<!>"+r),t||(i=hi(i)));var s=n||d9?document.importNode(i,!0):i.cloneNode(!0);if(t){var o=hi(s),l=s.lastChild;Yi(o,l)}else Yi(s,s);return s}}function T_(r,e,t="svg"){var n=!r.startsWith("<!>"),i=`<${t}>${n?r:"<!>"+r}</${t}>`,a;return()=>{if(er)return Yi(yr,null),yr;if(!a){var s=r0(i),o=hi(s);a=hi(o)}var l=a.cloneNode(!0);return Yi(l,l),l}}function Ml(r,e){return T_(r,e,"svg")}function sr(r=""){if(!er){var e=Ki(r+"");return Yi(e,e),e}var t=yr;return t.nodeType!==lg&&(t.before(t=Ki()),ui(t)),Yi(t,t),t}function J(){if(er)return Yi(yr,null),yr;var r=document.createDocumentFragment(),e=document.createComment(""),t=Ki();return r.append(e,t),Yi(e,t),r}function _(r,e){if(er){Dr.nodes_end=yr,Ca();return}r!==null&&r.before(e)}function un(){if(er&&yr&&yr.nodeType===Io&&yr.textContent?.startsWith("#")){const r=yr.textContent.substring(1);return Ca(),r}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}let n0=!0;function F9(r){n0=r}function at(r,e){var t=e==null?"":typeof e=="object"?e+"":e;t!==(r.__t??=r.nodeValue)&&(r.__t=t,r.nodeValue=t+"")}function i0(r,e){return L9(r,e)}function D9(r,e){xg(),e.intro=e.intro??!1;const t=e.target,n=er,i=yr;try{for(var a=hi(t);a&&(a.nodeType!==Io||a.data!==cg);)a=Ta(a);if(!a)throw Al;Ri(!0),ui(a),Ca();const s=L9(r,{...e,anchor:a});if(yr===null||yr.nodeType!==Io||yr.data!==hg)throw Lu(),Al;return Ri(!1),s}catch(s){if(s===Al)return e.recover===!1&&_A(),xg(),Sg(t),Ri(!1),i0(r,e);throw s}finally{Ri(n),ui(i),E_()}}const Nc=new Map;function L9(r,{target:e,anchor:t,props:n={},events:i,context:a,intro:s=!0}){xg();var o=new Set,l=h=>{for(var d=0;d<h.length;d++){var f=h[d];if(!o.has(f)){o.add(f);var p=S_(f);e.addEventListener(f,$u,{passive:p});var m=Nc.get(f);m===void 0?(document.addEventListener(f,$u,{passive:p}),Nc.set(f,1)):Nc.set(f,m+1)}}};l(eg(P9)),_g.add(l);var c=void 0,u=o_(()=>{var h=t??e.appendChild(Ki());return Ia(()=>{if(a){ge({});var d=ln;d.c=a}i&&(n.$$events=i),er&&Yi(h,null),n0=s,c=r(h,n)||{},n0=!0,er&&(Dr.nodes_end=yr),a&&pe()}),()=>{for(var d of o){e.removeEventListener(d,$u);var f=Nc.get(d);--f===0?(document.removeEventListener(d,$u),Nc.delete(d)):Nc.set(d,f)}_g.delete(l),h!==t&&h.parentNode?.removeChild(h)}});return Eg.set(c,u),c}let Eg=new WeakMap;function Tg(r,e){const t=Eg.get(r);return t?(Eg.delete(r),t(e)):Promise.resolve()}function ce(r,e,t=!1){er&&Ca();var n=r,i=null,a=null,s=ii,o=t?Sl:0,l=!1;const c=(f,p=!0)=>{l=!0,d(p,f)};var u=null;function h(){u!==null&&(u.lastChild.remove(),n.before(u),u=null);var f=s?i:a,p=s?a:i;f&&Yd(f),p&&Ic(p,()=>{s?a=null:i=null})}const d=(f,p)=>{if(s===(s=f))return;let m=!1;if(er){const C=K5(n)===ug;!!s===C&&(n=dg(),ui(n),Ri(!1),m=!0)}var y=$d(),v=n;if(y&&(u=document.createDocumentFragment(),u.append(v=Ki())),s?i??=p&&Ia(()=>p(v)):a??=p&&Ia(()=>p(v)),y){var x=Bn,S=s?i:a,A=s?a:i;S&&x.skipped_effects.delete(S),A&&x.skipped_effects.add(A),x.add_callback(h)}else h();m&&Ri(!0)};qs(()=>{l=!1,e(c),l||d(null,null)},o),er&&(n=yr)}function I_(r,e,t){er&&Ca();var n=r,i=ii,a,s,o=null,l=_l()?qA:fg;function c(){a&&Ic(a),o!==null&&(o.lastChild.remove(),n.before(o),o=null),a=s}qs(()=>{if(l(i,i=e())){var u=n,h=$d();h&&(o=document.createDocumentFragment(),o.append(u=Ki())),s=Ia(()=>t(u)),h?Bn.add_callback(c):c()}}),er&&(n=yr)}function B9(r,e){return e}function M_(r,e,t){for(var n=r.items,i=[],a=e.length,s=0;s<a;s++)kg(e[s].e,i,!0);var o=a>0&&i.length===0&&t!==null;if(o){var l=t.parentNode;Sg(l),l.append(t),n.clear(),ls(r,e[0].prev,e[a-1].next)}x9(i,()=>{for(var c=0;c<a;c++){var u=e[c];o||(n.delete(u.k),ls(r,u.prev,u.next)),Pi(u.e,!o)}})}function _n(r,e,t,n,i,a=null){var s=r,o={flags:e,items:new Map,first:null},l=(e&X5)!==0;if(l){var c=r;s=er?ui(hi(c)):c.appendChild(Ki())}er&&Ca();var u=null,h=!1,d=new Map,f=mg(()=>{var v=t();return Eo(v)?v:v==null?[]:eg(v)}),p,m;function y(){O_(m,p,o,d,s,i,e,n,t),a!==null&&(p.length===0?u?Yd(u):u=Ia(()=>a(s)):u!==null&&Ic(u,()=>{u=null}))}qs(()=>{m??=Dr,p=g(f);var v=p.length;if(h&&v===0)return;h=v===0;let x=!1;if(er){var S=K5(s)===ug;S!==(v===0)&&(s=dg(),ui(s),Ri(!1),x=!0)}if(er){for(var A=null,C,k=0;k<v;k++){if(yr.nodeType===Io&&yr.data===hg){s=yr,x=!0,Ri(!1);break}var I=p[k],R=n(I,k);C=Ig(yr,o,A,null,I,R,k,i,e,t),o.items.set(R,C),A=C}v>0&&ui(dg())}if(er)v===0&&a&&(u=Ia(()=>a(s)));else if($d()){var U=new Set,D=Bn;for(k=0;k<v;k+=1){I=p[k],R=n(I,k);var $=o.items.get(R)??d.get(R);$?(e&(Bd|Ud))!==0&&U9($,I,k,e):(C=Ig(null,o,null,null,I,R,k,i,e,t,!0),d.set(R,C)),U.add(R)}for(const[H,V]of o.items)U.has(H)||D.skipped_effects.add(V.e);D.add_callback(y)}else y();x&&Ri(!0),g(f)}),er&&(s=yr)}function O_(r,e,t,n,i,a,s,o,l){var c=(s&MA)!==0,u=(s&(Bd|Ud))!==0,h=e.length,d=t.items,f=t.first,p=f,m,y=null,v,x=[],S=[],A,C,k,I;if(c)for(I=0;I<h;I+=1)A=e[I],C=o(A,I),k=d.get(C),k!==void 0&&(k.a?.measure(),(v??=new Set).add(k));for(I=0;I<h;I+=1){if(A=e[I],C=o(A,I),k=d.get(C),k===void 0){var R=n.get(C);if(R!==void 0){n.delete(C),d.set(C,R);var U=y?y.next:p;ls(t,y,R),ls(t,R,U),Mg(R,U,i),y=R}else{var D=p?p.e.nodes_start:i;y=Ig(D,t,y,y===null?t.first:y.next,A,C,I,a,s,l)}d.set(C,y),x=[],S=[],p=y.next;continue}if(u&&U9(k,A,I,s),(k.e.f&Xa)!==0&&(Yd(k.e),c&&(k.a?.unfix(),(v??=new Set).delete(k))),k!==p){if(m!==void 0&&m.has(k)){if(x.length<S.length){var $=S[0],H;y=$.prev;var V=x[0],z=x[x.length-1];for(H=0;H<x.length;H+=1)Mg(x[H],$,i);for(H=0;H<S.length;H+=1)m.delete(S[H]);ls(t,V.prev,z.next),ls(t,y,V),ls(t,z,$),p=$,y=z,I-=1,x=[],S=[]}else m.delete(k),Mg(k,p,i),ls(t,k.prev,k.next),ls(t,k,y===null?t.first:y.next),ls(t,y,k),y=k;continue}for(x=[],S=[];p!==null&&p.k!==C;)(p.e.f&Xa)===0&&(m??=new Set).add(p),S.push(p),p=p.next;if(p===null)continue;k=p}x.push(k),y=k,p=k.next}if(p!==null||m!==void 0){for(var Z=m===void 0?[]:eg(m);p!==null;)(p.e.f&Xa)===0&&Z.push(p),p=p.next;var q=Z.length;if(q>0){var re=(s&X5)!==0&&h===0?i:null;if(c){for(I=0;I<q;I+=1)Z[I].a?.measure();for(I=0;I<q;I+=1)Z[I].a?.fix()}M_(t,Z,re)}}c&&_c(()=>{if(v!==void 0)for(k of v)k.a?.apply()}),r.first=t.first&&t.first.e,r.last=y&&y.e;for(var X of n.values())Pi(X.e);n.clear()}function U9(r,e,t,n){(n&Bd)!==0&&ju(r.v,e),(n&Ud)!==0?ju(r.i,t):r.i=t}function Ig(r,e,t,n,i,a,s,o,l,c,u){var h=(l&Bd)!==0,d=(l&OA)===0,f=h?d?wg(i,!1,!1):No(i):i,p=(l&Ud)===0?s:No(s),m={i:p,v:f,k:a,a:null,e:null,prev:t,next:n};try{if(r===null){var y=document.createDocumentFragment();y.append(r=Ki())}return m.e=Ia(()=>o(r,f,p,c),er),m.e.prev=t&&t.e,m.e.next=n&&n.e,t===null?u||(e.first=m):(t.next=m,t.e.next=m.e),n!==null&&(n.prev=m,n.e.prev=m.e),m}finally{}}function Mg(r,e,t){for(var n=r.next?r.next.e.nodes_start:t,i=e?e.e.nodes_start:t,a=r.e.nodes_start;a!==null&&a!==n;){var s=Ta(a);i.before(a),a=s}}function ls(r,e,t){e===null?r.first=t:(e.next=t,e.e.next=t&&t.e),t!==null&&(t.prev=e,t.e.prev=e&&e.e)}function z9(r,e,t=!1,n=!1,i=!1){var a=r,s="";qe(()=>{var o=Dr;if(s===(s=e()??"")){er&&Ca();return}if(o.nodes_start!==null&&(y9(o.nodes_start,o.nodes_end),o.nodes_start=o.nodes_end=null),s!==""){if(er){yr.data;for(var l=Ca(),c=l;l!==null&&(l.nodeType!==Io||l.data!=="");)c=l,l=Ta(l);if(l===null)throw Lu(),Al;Yi(yr,c),a=ui(l);return}var u=s+"";t?u=`<svg>${u}</svg>`:n&&(u=`<math>${u}</math>`);var h=r0(u);if((t||n)&&(h=hi(h)),Yi(hi(h),h.lastChild),t||n)for(;hi(h);)a.before(hi(h));else a.before(h)}})}function Te(r,e,...t){var n=r,i=Re,a;qs(()=>{i!==(i=e())&&(a&&(Pi(a),a=null),a=Ia(()=>i(n,...t)))},Sl),er&&(n=yr)}function N_(r){return(e,...t)=>{var n=r(...t),i;if(er)i=yr,Ca();else{var a=n.render().trim(),s=r0(a);i=hi(s),e.before(i)}const o=n.setup?.(i);Yi(i,i),typeof o=="function"&&Hu(o)}}function ve(r,e,t){er&&Ca();var n=r,i,a,s=null,o=null;function l(){a&&(Ic(a),a=null),s&&(s.lastChild.remove(),n.before(s),s=null),a=o,o=null}qs(()=>{if(i!==(i=e())){var c=$d();if(i){var u=n;c&&(s=document.createDocumentFragment(),s.append(u=Ki())),o=Ia(()=>t(u,i))}c?Bn.add_callback(l):l()}},Sl),er&&(n=yr)}function j9(r,e,t,n,i,a){let s=er;er&&Ca();var o,l,c=null;er&&yr.nodeType===bA&&(c=yr,Ca());var u=er?yr:r,h;qs(()=>{const d=e()||null;var f=t||d==="svg"?jA:null;d!==o&&(h&&(d===null?Ic(h,()=>{h=null,l=null}):d===l?Yd(h):(Pi(h),F9(!1))),d&&d!==l&&(h=Ia(()=>{if(c=er?c:f?document.createElementNS(f,d):document.createElement(d),Yi(c,c),n){er&&A_(d)&&c.append(document.createComment(""));var p=er?hi(c):c.appendChild(Ki());er&&(p===null?Ri(!1):ui(p)),n(c,p)}Dr.nodes_end=c,u.before(c)})),o=d,o&&(l=o),F9(!0))},Sl),s&&(Ri(!0),ui(u))}function R_(r,e,t){Gu(()=>{var n=dn(()=>e(r,t?.())||{});if(n?.destroy)return()=>n.destroy()})}function P_(r,e){var t=void 0,n;qs(()=>{t!==(t=e())&&(n&&(Pi(n),n=null),t&&(n=Ia(()=>{Gu(()=>t(r))})))})}function H9(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var i=r.length;for(e=0;e<i;e++)r[e]&&(t=H9(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function Ku(){for(var r,e,t=0,n="",i=arguments.length;t<i;t++)(r=arguments[t])&&(e=H9(r))&&(n&&(n+=" "),n+=e);return n}function ai(r){return typeof r=="object"?Ku(r):r??""}const q9=[...`
\r\f \v\uFEFF`];function F_(r,e,t){var n=r==null?"":""+r;if(e&&(n=n?n+" "+e:e),t){for(var i in t)if(t[i])n=n?n+" "+i:i;else if(n.length)for(var a=i.length,s=0;(s=n.indexOf(i,s))>=0;){var o=s+a;(s===0||q9.includes(n[s-1]))&&(o===n.length||q9.includes(n[o]))?n=(s===0?"":n.substring(0,s))+n.substring(o+1):s=o}}return n===""?null:n}function G9(r,e=!1){var t=e?" !important;":";",n="";for(var i in r){var a=r[i];a!=null&&a!==""&&(n+=" "+i+": "+a+t)}return n}function Og(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function D_(r,e){if(e){var t="",n,i;if(Array.isArray(e)?(n=e[0],i=e[1]):n=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,s=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(Og)),i&&l.push(...Object.keys(i).map(Og));var c=0,u=-1;const m=r.length;for(var h=0;h<m;h++){var d=r[h];if(o?d==="/"&&r[h-1]==="*"&&(o=!1):a?a===d&&(a=!1):d==="/"&&r[h+1]==="*"?o=!0:d==='"'||d==="'"?a=d:d==="("?s++:d===")"&&s--,!o&&a===!1&&s===0){if(d===":"&&u===-1)u=h;else if(d===";"||h===m-1){if(u!==-1){var f=Og(r.substring(c,u).trim());if(!l.includes(f)){d!==";"&&h++;var p=r.substring(c,h).trim();t+=" "+p+";"}}c=h+1,u=-1}}}}return n&&(t+=G9(n)),i&&(t+=G9(i,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function tr(r,e,t,n,i,a){var s=r.__className;if(er||s!==t||s===void 0){var o=F_(t,n,a);(!er||o!==r.getAttribute("class"))&&(o==null?r.removeAttribute("class"):e?r.className=o:r.setAttribute("class",o)),r.__className=t}else if(a&&i!==a)for(var l in a){var c=!!a[l];(i==null||c!==!!i[l])&&r.classList.toggle(l,c)}return a}function Ng(r,e={},t,n){for(var i in t){var a=t[i];e[i]!==a&&(t[i]==null?r.style.removeProperty(i):r.style.setProperty(i,a,n))}}function Ol(r,e,t,n){var i=r.__style;if(er||i!==e){var a=D_(e,n);(!er||a!==r.getAttribute("style"))&&(a==null?r.removeAttribute("style"):r.style.cssText=a),r.__style=e}else n&&(Array.isArray(n)?(Ng(r,t?.[0],n[0]),Ng(r,t?.[1],n[1],"important")):Ng(r,t,n));return n}function Rg(r,e,t=!1){if(r.multiple){if(e==null)return;if(!Eo(e))return HA();for(var n of r.options)n.selected=e.includes(W9(n));return}for(n of r.options){var i=W9(n);if(i_(i,e)){n.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function L_(r){var e=new MutationObserver(()=>{Rg(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Hu(()=>{e.disconnect()})}function W9(r){return"__value"in r?r.__value:r.value}const Yu=Symbol("class"),Rc=Symbol("style"),V9=Symbol("is custom element"),X9=Symbol("is html");function a0(r){if(er){var e=!1,t=()=>{if(!e){if(e=!0,r.hasAttribute("value")){var n=r.value;Jt(r,"value",null),r.value=n}if(r.hasAttribute("checked")){var i=r.checked;Jt(r,"checked",null),r.checked=i}}};r.__on_r=t,JA(t),N9()}}function B_(r,e){e?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function Jt(r,e,t,n){var i=$9(r);er&&(i[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName==="LINK")||i[e]!==(i[e]=t)&&(e==="loading"&&(r[mA]=t),t==null?r.removeAttribute(e):typeof t!="string"&&Y9(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function U_(r,e,t,n,i=!1){var a=$9(r),s=a[V9],o=!a[X9];let l=er&&s;l&&Ri(!1);var c=e||{},u=r.tagName==="OPTION";for(var h in e)h in t||(t[h]=null);t.class?t.class=ai(t.class):(n||t[Yu])&&(t.class=null),t[Rc]&&(t.style??=null);var d=Y9(r);for(const S in t){let A=t[S];if(u&&S==="value"&&A==null){r.value=r.__value="",c[S]=A;continue}if(S==="class"){var f=r.namespaceURI==="http://www.w3.org/1999/xhtml";tr(r,f,A,n,e?.[Yu],t[Yu]),c[S]=A,c[Yu]=t[Yu];continue}if(S==="style"){Ol(r,A,e?.[Rc],t[Rc]),c[S]=A,c[Rc]=t[Rc];continue}var p=c[S];if(!(A===p&&!(A===void 0&&r.hasAttribute(S)))){c[S]=A;var m=S[0]+S[1];if(m!=="$$")if(m==="on"){const C={},k="$$"+S;let I=S.slice(2);var y=v_(I);if(m_(I)&&(I=I.slice(0,-7),C.capture=!0),!y&&p){if(A!=null)continue;r.removeEventListener(I,c[k],C),c[k]=null}if(A!=null)if(y)r[`__${I}`]=A,wi([I]);else{let R=function(U){c[S].call(this,U)};c[k]=Cg(I,r,R,C)}else y&&(r[`__${I}`]=void 0)}else if(S==="style")Jt(r,S,A);else if(S==="autofocus")__(r,!!A);else if(!s&&(S==="__value"||S==="value"&&A!=null))r.value=r.__value=A;else if(S==="selected"&&u)B_(r,A);else{var v=S;o||(v=w_(v));var x=v==="defaultValue"||v==="defaultChecked";if(A==null&&!s&&!x)if(a[S]=null,v==="value"||v==="checked"){let C=r;const k=e===void 0;if(v==="value"){let I=C.defaultValue;C.removeAttribute(v),C.defaultValue=I,C.value=C.__value=k?I:null}else{let I=C.defaultChecked;C.removeAttribute(v),C.defaultChecked=I,C.checked=k?I:!1}}else r.removeAttribute(S);else x||d.includes(v)&&(s||typeof A!="string")?r[v]=A:typeof A!="function"&&Jt(r,v,A)}}}return l&&Ri(!0),c}function Lt(r,e,t=[],n=[],i,a=!1){i9(t,n,s=>{var o=void 0,l={},c=r.nodeName==="SELECT",u=!1;if(qs(()=>{var d=e(...s.map(g)),f=U_(r,o,d,i,a);u&&c&&"value"in d&&Rg(r,d.value);for(let m of Object.getOwnPropertySymbols(l))d[m]||Pi(l[m]);for(let m of Object.getOwnPropertySymbols(d)){var p=d[m];m.description===$5&&(!o||p!==o[m])&&(l[m]&&Pi(l[m]),l[m]=Ia(()=>P_(r,()=>p))),f[m]=p}o=f}),c){var h=r;Gu(()=>{Rg(h,o.value,!0),L_(h)})}u=!0})}function $9(r){return r.__attributes??={[V9]:r.nodeName.includes("-"),[X9]:r.namespaceURI===zA}}var K9=new Map;function Y9(r){var e=K9.get(r.nodeName);if(e)return e;K9.set(r.nodeName,e=[]);for(var t,n=r,i=Element.prototype;i!==n;){t=z5(n);for(var a in t)t[a].set&&e.push(a);n=Rd(n)}return e}const z_=()=>performance.now(),Ws={tick:r=>requestAnimationFrame(r),now:()=>z_(),tasks:new Set};function J9(){const r=Ws.now();Ws.tasks.forEach(e=>{e.c(r)||(Ws.tasks.delete(e),e.f())}),Ws.tasks.size!==0&&Ws.tick(J9)}function j_(r){let e;return Ws.tasks.size===0&&Ws.tick(J9),{promise:new Promise(t=>{Ws.tasks.add(e={c:r,f:t})}),abort(){Ws.tasks.delete(e)}}}function Q9(r,e){Xu(()=>{r.dispatchEvent(new CustomEvent(e))})}function H_(r){if(r==="float")return"cssFloat";if(r==="offset")return"cssOffset";if(r.startsWith("--"))return r;const e=r.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function Z9(r){const e={},t=r.split(";");for(const n of t){const[i,a]=n.split(":");if(!i||a===void 0)break;const s=H_(i.trim());e[s]=a.trim()}return e}const q_=r=>r;function xi(r,e,t,n){var i=(r&LA)!==0,a="in",s,o=e.inert,l=e.style.overflow,c,u;function h(){return Xu(()=>s??=t()(e,n?.()??{},{direction:a}))}var d={is_global:i,in(){e.inert=o,c?.abort(),Q9(e,"introstart"),c=ev(e,h(),u,1,()=>{Q9(e,"introend"),c?.abort(),c=s=void 0,e.style.overflow=l})},out(y){{y?.(),s=void 0;return}},stop:()=>{c?.abort()}},f=Dr;if((f.transitions??=[]).push(d),n0){var p=i;if(!p){for(var m=f.parent;m&&(m.f&Sl)!==0;)for(;(m=m.parent)&&(m.f&xc)===0;);p=!m||(m.f&Ld)!==0}p&&Gu(()=>{dn(()=>d.in())})}}function ev(r,e,t,n,i){if(wc(e)){var a,s=!1;return _c(()=>{if(!s){var m=e({direction:"in"});a=ev(r,m,t,n,i)}}),{abort:()=>{s=!0,a?.abort()},deactivate:()=>a.deactivate(),reset:()=>a.reset(),t:()=>a.t()}}if(!e?.duration)return i(),{abort:Re,deactivate:Re,reset:Re,t:()=>n};const{delay:o=0,css:l,tick:c,easing:u=q_}=e;var h=[];if(c&&c(0,1),l){var d=Z9(l(0,1));h.push(d,d)}var f=()=>1-n,p=r.animate(h,{duration:o,fill:"forwards"});return p.onfinish=()=>{p.cancel();var m=1-n,y=n-m,v=e.duration*Math.abs(y),x=[];if(v>0){var S=!1;if(l)for(var A=Math.ceil(v/16.666666666666668),C=0;C<=A;C+=1){var k=m+y*u(C/A),I=Z9(l(k,1-k));x.push(I),S||=I.overflow==="hidden"}S&&(r.style.overflow="hidden"),f=()=>{var R=p.currentTime;return m+y*u(R/v)},c&&j_(()=>{if(p.playState!=="running")return!1;var R=f();return c(R,1-R),!0})}p=r.animate(x,{duration:v,fill:"forwards"}),p.onfinish=()=>{f=()=>n,c?.(n,1-n),i()}},{abort:()=>{p&&(p.cancel(),p.effect=null,p.onfinish=Re)},deactivate:()=>{i=Re},reset:()=>{},t:()=>f()}}function Nl(r,e,t=e){var n=_l(),i=new WeakSet;R9(r,"input",a=>{var s=a?r.defaultValue:r.value;if(s=Pg(r)?Fg(s):s,t(s),Bn!==null&&i.add(Bn),n&&s!==(s=e())){var o=r.selectionStart,l=r.selectionEnd;r.value=s??"",l!==null&&(r.selectionStart=o,r.selectionEnd=Math.min(l,r.value.length))}}),(er&&r.defaultValue!==r.value||dn(e)==null&&r.value)&&(t(Pg(r)?Fg(r.value):r.value),Bn!==null&&i.add(Bn)),Kd(()=>{var a=e();r===document.activeElement&&i.has(Bn)||Pg(r)&&a===Fg(r.value)||r.type==="date"&&!a&&!r.value||a!==r.value&&(r.value=a??"")})}function Pg(r){var e=r.type;return e==="number"||e==="range"}function Fg(r){return r===""?null:+r}function G_(r,e,t=e){R9(r,"change",()=>{t(r.files)}),er&&r.files&&t(r.files),Kd(()=>{r.files=e()})}function tv(r,e){return r===e||r?.[ss]===e}function Tr(r={},e,t,n){return Gu(()=>{var i,a;return Kd(()=>{i=a,a=[],dn(()=>{r!==t(...a)&&(e(r,...a),i&&tv(t(...i),r)&&e(null,...i))})}),()=>{_c(()=>{a&&tv(t(...a),r)&&e(null,...a)})}}),r}function W_(r,e){C_(window,["resize"],()=>Xu(()=>e(window[r])))}function V_(r=!1){const e=ln,t=e.l.u;if(!t)return;let n=()=>g_(e.s);if(r){let i=0,a={};const s=zu(()=>{let o=!1;const l=e.s;for(const c in l)l[c]!==a[c]&&(a[c]=l[c],o=!0);return o&&i++,i});n=()=>g(s)}t.b.length&&yi(()=>{rv(e,n),Pd(t.b)}),Ft(()=>{const i=dn(()=>t.m.map(fA));return()=>{for(const a of i)typeof a=="function"&&a()}}),t.a.length&&Ft(()=>{rv(e,n),Pd(t.a)})}function rv(r,e){if(r.l.s)for(const t of r.l.s)g(t);e()}function nv(r,e,t){if(r==null)return e(void 0),Re;const n=dn(()=>r.subscribe(e,t));return n.unsubscribe?()=>n.unsubscribe():n}const Pc=[];function Dg(r,e=Re){let t=null;const n=new Set;function i(o){if(fg(r,o)&&(r=o,t)){const l=!Pc.length;for(const c of n)c[1](),Pc.push(c,r);if(l){for(let c=0;c<Pc.length;c+=2)Pc[c][0](Pc[c+1]);Pc.length=0}}}function a(o){i(o(r))}function s(o,l=Re){const c=[o,l];return n.add(c),n.size===1&&(t=e(i,a)||Re),o(r),()=>{n.delete(c),n.size===0&&t&&(t(),t=null)}}return{set:i,update:a,subscribe:s}}function X_(r){let e;return nv(r,t=>e=t)(),e}let s0=!1,Lg=Symbol();function $_(r,e,t){const n=t[e]??={store:null,source:wg(void 0),unsubscribe:Re};if(n.store!==r&&!(Lg in t))if(n.unsubscribe(),n.store=r??null,r==null)n.source.v=void 0,n.unsubscribe=Re;else{var i=!0;n.unsubscribe=nv(r,a=>{i?n.source.v=a:O(n.source,a)}),i=!1}return r&&Lg in t?X_(r):g(n.source)}function K_(){const r={};function e(){Hu(()=>{for(var t in r)r[t].unsubscribe();Du(r,Lg,{enumerable:!1,value:!0})})}return[r,e]}function Y_(r){var e=s0;try{return s0=!1,[r(),s0]}finally{s0=e}}const J_={get(r,e){if(!r.exclude.includes(e))return r.props[e]},set(r,e){return!1},getOwnPropertyDescriptor(r,e){if(!r.exclude.includes(e)&&e in r.props)return{enumerable:!0,configurable:!0,value:r.props[e]}},has(r,e){return r.exclude.includes(e)?!1:e in r.props},ownKeys(r){return Reflect.ownKeys(r.props).filter(e=>!r.exclude.includes(e))}};function De(r,e,t){return new Proxy({props:r,exclude:e},J_)}const Q_={get(r,e){let t=r.props.length;for(;t--;){let n=r.props[t];if(wc(n)&&(n=n()),typeof n=="object"&&n!==null&&e in n)return n[e]}},set(r,e,t){let n=r.props.length;for(;n--;){let i=r.props[n];wc(i)&&(i=i());const a=To(i,e);if(a&&a.set)return a.set(t),!0}return!1},getOwnPropertyDescriptor(r,e){let t=r.props.length;for(;t--;){let n=r.props[t];if(wc(n)&&(n=n()),typeof n=="object"&&n!==null&&e in n){const i=To(n,e);return i&&!i.configurable&&(i.configurable=!0),i}}},has(r,e){if(e===ss||e===sg)return!1;for(let t of r.props)if(wc(t)&&(t=t()),t!=null&&e in t)return!0;return!1},ownKeys(r){const e=[];for(let t of r.props)if(wc(t)&&(t=t()),!!t){for(const n in t)e.includes(n)||e.push(n);for(const n of Object.getOwnPropertySymbols(t))e.includes(n)||e.push(n)}return e}};function $e(...r){return new Proxy({props:r},Q_)}function L(r,e,t,n){var i=!kc||(t&RA)!==0,a=(t&FA)!==0,s=(t&DA)!==0,o=n,l=!0,c=()=>(l&&(l=!1,o=s?dn(n):n),o),u;if(a){var h=ss in r||sg in r;u=To(r,e)?.set??(h&&e in r?S=>r[e]=S:void 0)}var d,f=!1;a?[d,f]=Y_(()=>r[e]):d=r[e],d===void 0&&n!==void 0&&(d=c(),u&&(i&&CA(),u(d)));var p;if(i?p=()=>{var S=r[e];return S===void 0?c():(l=!0,S)}:p=()=>{var S=r[e];return S!==void 0&&(o=void 0),S===void 0?o:S},i&&(t&PA)===0)return p;if(u){var m=r.$$legacy;return function(S,A){return arguments.length>0?((!i||!A||m||f)&&u(A?p():S),S):p()}}var y=!1,v=((t&NA)!==0?zu:mg)(()=>(y=!1,p()));a&&g(v);var x=Dr;return function(S,A){if(arguments.length>0){const C=A?g(v):i&&a?Mr(S):S;return O(v,C),y=!0,o!==void 0&&(o=C),S}return Il&&y||(x.f&xl)!==0?v.v:g(v)}}function Z_(r){return class extends eC{constructor(e){super({component:r,...e})}}}class eC{#e;#t;constructor(e){var t=new Map,n=(a,s)=>{var o=wg(s,!1,!1);return t.set(a,o),o};const i=new Proxy({...e.props||{},$$events:{}},{get(a,s){return g(t.get(s)??n(s,Reflect.get(a,s)))},has(a,s){return s===sg?!0:(g(t.get(s)??n(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,o){return O(t.get(s)??n(s,o),o),Reflect.set(a,s,o)}});this.#t=(e.hydrate?D9:i0)(e.component,{target:e.target,anchor:e.anchor,props:i,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&yg(),this.#e=i.$$events;for(const a of Object.keys(this.#t))a==="$set"||a==="$destroy"||a==="$on"||Du(this,a,{get(){return this.#t[a]},set(s){this.#t[a]=s},enumerable:!0});this.#t.$set=a=>{Object.assign(i,a)},this.#t.$destroy=()=>{Tg(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];const n=(...i)=>t.call(this,...i);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}function tC(){return Xr===null&&AA(),(Xr.ac??=new AbortController).signal}function Si(r){ln===null&&Sc(),kc&&ln.l!==null?Bg(ln).m.push(r):Ft(()=>{const e=dn(r);if(typeof e=="function")return e})}function iv(r){ln===null&&Sc(),Si(()=>()=>dn(r))}function rC(r,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(r,{detail:e,bubbles:t,cancelable:n})}function nC(){const r=ln;return r===null&&Sc(),(e,t,n)=>{const i=r.s.$$events?.[e];if(i){const a=Eo(i)?i.slice():[i],s=rC(e,t,n);for(const o of a)o.call(r.x,s);return!s.defaultPrevented}return!0}}function iC(r){ln===null&&Sc(),ln.l===null&&V5(),Bg(ln).b.push(r)}function aC(r){ln===null&&Sc(),ln.l===null&&V5(),Bg(ln).a.push(r)}function Bg(r){var e=r.l;return e.u??={a:[],b:[],m:[]}}const sC=Object.freeze(Object.defineProperty({__proto__:null,afterUpdate:aC,beforeUpdate:iC,createEventDispatcher:nC,createRawSnippet:N_,flushSync:yg,getAbortSignal:tC,getAllContexts:Q5,getContext:Ac,hasContext:gg,hydrate:D9,mount:i0,onDestroy:iv,onMount:Si,setContext:qd,settled:d_,tick:Oc,unmount:Tg,untrack:dn},Symbol.toStringTag,{value:"Module"}));class Ju{constructor(e,t){this.status=e,typeof t=="string"?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class Ug{constructor(e,t){this.status=e,this.location=t}}class zg extends Error{constructor(e,t,n){super(n),this.status=e,this.text=t}}new URL("sveltekit-internal://");function oC(r,e){return r==="/"||e==="ignore"?r:e==="never"?r.endsWith("/")?r.slice(0,-1):r:e==="always"&&!r.endsWith("/")?r+"/":r}function lC(r){return r.split("%25").map(decodeURI).join("%25")}function cC(r){for(const e in r)r[e]=decodeURIComponent(r[e]);return r}function jg({href:r}){return r.split("#")[0]}function uC(r,e,t,n=!1){const i=new URL(r);Object.defineProperty(i,"searchParams",{value:new Proxy(i.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return c=>(t(c),s[o](c));e();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const a=["href","pathname","search","toString","toJSON"];n&&a.push("hash");for(const s of a)Object.defineProperty(i,s,{get(){return e(),r[s]},enumerable:!0,configurable:!0});return i}function hC(...r){let e=5381;for(const t of r)if(typeof t=="string"){let n=t.length;for(;n;)e=e*33^t.charCodeAt(--n)}else if(ArrayBuffer.isView(t)){const n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let i=n.length;for(;i;)e=e*33^n[--i]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;const dC=new TextDecoder;function fC(r){const e=atob(r),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}const gC=window.fetch;window.fetch=(r,e)=>((r instanceof Request?r.method:e?.method||"GET")!=="GET"&&Qu.delete(Hg(r)),gC(r,e));const Qu=new Map;function pC(r,e){const t=Hg(r,e),n=document.querySelector(t);if(n?.textContent){n.remove();let{body:i,...a}=JSON.parse(n.textContent);const s=n.getAttribute("data-ttl");return s&&Qu.set(t,{body:i,init:a,ttl:1e3*Number(s)}),n.getAttribute("data-b64")!==null&&(i=fC(i)),Promise.resolve(new Response(i,a))}return window.fetch(r,e)}function mC(r,e,t){if(Qu.size>0){const n=Hg(r,t),i=Qu.get(n);if(i){if(performance.now()<i.ttl&&["default","force-cache","only-if-cached",void 0].includes(t?.cache))return new Response(i.body,i.init);Qu.delete(n)}}return window.fetch(e,t)}function Hg(r,e){let n=`script[data-sveltekit-fetched][data-url=${JSON.stringify(r instanceof Request?r.url:r)}]`;if(e?.headers||e?.body){const i=[];e.headers&&i.push([...new Headers(e.headers)].join(",")),e.body&&(typeof e.body=="string"||ArrayBuffer.isView(e.body))&&i.push(e.body),n+=`[data-hash="${hC(...i)}"]`}return n}const bC=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function vC(r){const e=[];return{pattern:r==="/"?/^\/$/:new RegExp(`^${wC(r).map(n=>{const i=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(n);if(i)return e.push({name:i[1],matcher:i[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const a=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(n);if(a)return e.push({name:a[1],matcher:a[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!n)return;const s=n.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return qg(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return qg(String.fromCharCode(...l.slice(2).split("-").map(m=>parseInt(m,16))));const u=bC.exec(l),[,h,d,f,p]=u;return e.push({name:f,matcher:p,optional:!!h,rest:!!d,chained:d?c===1&&s[0]==="":!1}),d?"([^]*?)":h?"([^/]*)?":"([^/]+?)"}return qg(l)}).join("")}).join("")}/?$`),params:e}}function yC(r){return r!==""&&!/^\([^)]+\)$/.test(r)}function wC(r){return r.slice(1).split("/").filter(yC)}function xC(r,e,t){const n={},i=r.slice(1),a=i.filter(o=>o!==void 0);let s=0;for(let o=0;o<e.length;o+=1){const l=e[o];let c=i[o-s];if(l.chained&&l.rest&&s&&(c=i.slice(o-s,o+1).filter(u=>u).join("/"),s=0),c===void 0){l.rest&&(n[l.name]="");continue}if(!l.matcher||t[l.matcher](c)){n[l.name]=c;const u=e[o+1],h=i[o+1];u&&!u.rest&&u.optional&&h&&l.chained&&(s=0),!u&&!h&&Object.keys(n).length===a.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return n}function qg(r){return r.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function SC({nodes:r,server_loads:e,dictionary:t,matchers:n}){const i=new Set(e);return Object.entries(t).map(([o,[l,c,u]])=>{const{pattern:h,params:d}=vC(o),f={id:o,exec:p=>{const m=h.exec(p);if(m)return xC(m,d,n)},errors:[1,...u||[]].map(p=>r[p]),layouts:[0,...c||[]].map(s),leaf:a(l)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function a(o){const l=o<0;return l&&(o=~o),[l,r[o]]}function s(o){return o===void 0?o:[i.has(o),r[o]]}}function av(r,e=JSON.parse){try{return e(sessionStorage[r])}catch{}}function sv(r,e,t=JSON.stringify){const n=t(e);try{sessionStorage[r]=n}catch{}}const ua=globalThis.__sveltekit_b3qtxx?.base??"",kC=globalThis.__sveltekit_b3qtxx?.assets??ua,AC="1761493915211",ov="sveltekit:snapshot",lv="sveltekit:scroll",cv="sveltekit:states",_C="sveltekit:pageurl",Fc="sveltekit:history",Zu="sveltekit:navigation",Rl={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},eh=location.origin;function Gg(r){if(r instanceof URL)return r;let e=document.baseURI;if(!e){const t=document.getElementsByTagName("base");e=t.length?t[0].href:document.URL}return new URL(r,e)}function o0(){return{x:pageXOffset,y:pageYOffset}}function Dc(r,e){return r.getAttribute(`data-sveltekit-${e}`)}const uv={...Rl,"":Rl.hover};function hv(r){let e=r.assignedSlot??r.parentNode;return e?.nodeType===11&&(e=e.host),e}function dv(r,e){for(;r&&r!==e;){if(r.nodeName.toUpperCase()==="A"&&r.hasAttribute("href"))return r;r=hv(r)}}function Wg(r,e,t){let n;try{if(n=new URL(r instanceof SVGAElement?r.href.baseVal:r.href,document.baseURI),t&&n.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";n.hash=`#${o}${n.hash}`}}catch{}const i=r instanceof SVGAElement?r.target.baseVal:r.target,a=!n||!!i||c0(n,e,t)||(r.getAttribute("rel")||"").split(/\s+/).includes("external"),s=n?.origin===eh&&r.hasAttribute("download");return{url:n,external:a,target:i,download:s}}function l0(r){let e=null,t=null,n=null,i=null,a=null,s=null,o=r;for(;o&&o!==document.documentElement;)n===null&&(n=Dc(o,"preload-code")),i===null&&(i=Dc(o,"preload-data")),e===null&&(e=Dc(o,"keepfocus")),t===null&&(t=Dc(o,"noscroll")),a===null&&(a=Dc(o,"reload")),s===null&&(s=Dc(o,"replacestate")),o=hv(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:uv[n??"off"],preload_data:uv[i??"off"],keepfocus:l(e),noscroll:l(t),reload:l(a),replace_state:l(s)}}function fv(r){const e=Dg(r);let t=!0;function n(){t=!0,e.update(s=>s)}function i(s){t=!1,e.set(s)}function a(s){let o;return e.subscribe(l=>{(o===void 0||t&&l!==o)&&s(o=l)})}return{notify:n,set:i,subscribe:a}}const gv={v:()=>{}};function CC(){const{set:r,subscribe:e}=Dg(!1);let t;async function n(){clearTimeout(t);try{const i=await fetch(`${kC}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!i.ok)return!1;const s=(await i.json()).version!==AC;return s&&(r(!0),gv.v(),clearTimeout(t)),s}catch{return!1}}return{subscribe:e,check:n}}function c0(r,e,t){return r.origin!==eh||!r.pathname.startsWith(e)?!0:t?!(r.pathname===e+"/"||r.pathname===e+"/index.html"||r.protocol==="file:"&&r.pathname.replace(/\/[^/]+\.html?$/,"")===e):!1}function EC(r){const e=IC(r),t=new ArrayBuffer(e.length),n=new DataView(t);for(let i=0;i<t.byteLength;i++)n.setUint8(i,e.charCodeAt(i));return t}const TC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function IC(r){r.length%4===0&&(r=r.replace(/==?$/,""));let e="",t=0,n=0;for(let i=0;i<r.length;i++)t<<=6,t|=TC.indexOf(r[i]),n+=6,n===24&&(e+=String.fromCharCode((t&16711680)>>16),e+=String.fromCharCode((t&65280)>>8),e+=String.fromCharCode(t&255),t=n=0);return n===12?(t>>=4,e+=String.fromCharCode(t)):n===18&&(t>>=2,e+=String.fromCharCode((t&65280)>>8),e+=String.fromCharCode(t&255)),e}const MC=-1,OC=-2,NC=-3,RC=-4,PC=-5,FC=-6;function DC(r,e){if(typeof r=="number")return i(r,!0);if(!Array.isArray(r)||r.length===0)throw new Error("Invalid input");const t=r,n=Array(t.length);function i(a,s=!1){if(a===MC)return;if(a===NC)return NaN;if(a===RC)return 1/0;if(a===PC)return-1/0;if(a===FC)return-0;if(s||typeof a!="number")throw new Error("Invalid input");if(a in n)return n[a];const o=t[a];if(!o||typeof o!="object")n[a]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const l=o[0],c=e?.[l];if(c)return n[a]=c(i(o[1]));switch(l){case"Date":n[a]=new Date(o[1]);break;case"Set":const u=new Set;n[a]=u;for(let f=1;f<o.length;f+=1)u.add(i(o[f]));break;case"Map":const h=new Map;n[a]=h;for(let f=1;f<o.length;f+=2)h.set(i(o[f]),i(o[f+1]));break;case"RegExp":n[a]=new RegExp(o[1],o[2]);break;case"Object":n[a]=Object(o[1]);break;case"BigInt":n[a]=BigInt(o[1]);break;case"null":const d=Object.create(null);n[a]=d;for(let f=1;f<o.length;f+=2)d[o[f]]=i(o[f+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const f=globalThis[l],p=new f(i(o[1]));n[a]=o[2]!==void 0?p.subarray(o[2],o[3]):p;break}case"ArrayBuffer":{const f=o[1],p=EC(f);n[a]=p;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const f=l.slice(9);n[a]=Temporal[f].from(o[1]);break}case"URL":{const f=new URL(o[1]);n[a]=f;break}case"URLSearchParams":{const f=new URLSearchParams(o[1]);n[a]=f;break}default:throw new Error(`Unknown type ${l}`)}}else{const l=new Array(o.length);n[a]=l;for(let c=0;c<o.length;c+=1){const u=o[c];u!==OC&&(l[c]=i(u))}}else{const l={};n[a]=l;for(const c in o){if(c==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const u=o[c];l[c]=i(u)}}return n[a]}return i(0)}const pv=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...pv],[...new Set([...pv])];function LC(r){return r.filter(e=>e!=null)}const BC="x-sveltekit-invalidated",UC="x-sveltekit-trailing-slash";function u0(r){return r instanceof Ju||r instanceof zg?r.status:500}function zC(r){return r instanceof zg?r.text:"Internal Error"}let si,th,Vg;Si.toString().includes("$$")||/function \w+\(\) \{\}/.test(Si.toString())?(si={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},th={current:null},Vg={current:!1}):(si=new class{#e=oe({});get data(){return g(this.#e)}set data(e){O(this.#e,e)}#t=oe(null);get form(){return g(this.#t)}set form(e){O(this.#t,e)}#r=oe(null);get error(){return g(this.#r)}set error(e){O(this.#r,e)}#n=oe({});get params(){return g(this.#n)}set params(e){O(this.#n,e)}#a=oe({id:null});get route(){return g(this.#a)}set route(e){O(this.#a,e)}#i=oe({});get state(){return g(this.#i)}set state(e){O(this.#i,e)}#s=oe(-1);get status(){return g(this.#s)}set status(e){O(this.#s,e)}#o=oe(new URL("https://example.com"));get url(){return g(this.#o)}set url(e){O(this.#o,e)}},th=new class{#e=oe(null);get current(){return g(this.#e)}set current(e){O(this.#e,e)}},Vg=new class{#e=oe(!1);get current(){return g(this.#e)}set current(e){O(this.#e,e)}},gv.v=()=>Vg.current=!0);function jC(r){Object.assign(si,r)}const HC="/__data.json",qC=".html__data.json";function GC(r){return r.endsWith(".html")?r.replace(/\.html$/,qC):r.replace(/\/$/,"")+HC}const mv={spanContext(){return WC},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},WC={traceId:"",spanId:"",traceFlags:0},{onMount:VC,tick:XC}=sC,$C=new Set(["icon","shortcut icon","apple-touch-icon"]),Pl=av(lv)??{},rh=av(ov)??{},cs={url:fv({}),page:fv({}),navigating:Dg(null),updated:CC()};function Xg(r){Pl[r]=o0()}function KC(r,e){let t=r+1;for(;Pl[t];)delete Pl[t],t+=1;for(t=e+1;rh[t];)delete rh[t],t+=1}function Lc(r){return location.href=r.href,new Promise(()=>{})}async function bv(){if("serviceWorker"in navigator){const r=await navigator.serviceWorker.getRegistration(ua||"/");r&&await r.update()}}function vv(){}let $g,Kg,h0,Vs,Yg,Un;globalThis.__sveltekit_b3qtxx?.data;const d0=[],f0=[];let Fo=null;const g0=new Map,yv=new Set,YC=new Set,Bc=new Set;let An={branch:[],error:null,url:null},Jg=!1,p0=!1,wv=!0,nh=!1,ih=!1,xv=!1,Qg=!1,Sv,ki,Na,Fl;const ah=new Set,kv=new Map;async function JC(r,e,t){document.URL!==location.href&&(location.href=location.href),Un=r,await r.hooks.init?.(),$g=SC(r),Vs=document.documentElement,Yg=e,Kg=r.nodes[0],h0=r.nodes[1],Kg(),h0(),ki=history.state?.[Fc],Na=history.state?.[Zu],ki||(ki=Na=Date.now(),history.replaceState({...history.state,[Fc]:ki,[Zu]:Na},""));const n=Pl[ki];function i(){n&&(history.scrollRestoration="manual",scrollTo(n.x,n.y))}t?(i(),await lE(Yg,t)):(await sh({type:"enter",url:Gg(Un.hash?uE(new URL(location.href)):location.href),replace_state:!0}),i()),oE()}function QC(){d0.length=0,Qg=!1}function Av(r){f0.some(e=>e?.snapshot)&&(rh[r]=f0.map(e=>e?.snapshot?.capture()))}function _v(r){rh[r]?.forEach((e,t)=>{f0[t]?.snapshot?.restore(e)})}function Cv(){Xg(ki),sv(lv,Pl),Av(Na),sv(ov,rh)}async function Zg(r,e,t,n){let i;const a=await sh({type:"goto",url:Gg(r),keepfocus:e.keepFocus,noscroll:e.noScroll,replace_state:e.replaceState,state:e.state,redirect_count:t,nav_token:n,accept:()=>{e.invalidateAll&&(Qg=!0,i=[...kv.keys()]),e.invalidate&&e.invalidate.forEach(sE)}});return e.invalidateAll&&Oc().then(Oc).then(()=>{kv.forEach(({resource:s},o)=>{i?.includes(o)&&s.refresh?.()})}),a}async function ZC(r){if(r.id!==Fo?.id){const e={};ah.add(e),Fo={id:r.id,token:e,promise:Ov({...r,preload:e}).then(t=>(ah.delete(e),t.type==="loaded"&&t.state.error&&(Fo=null),t))}}return Fo.promise}async function ep(r){const e=(await v0(r,!1))?.route;e&&await Promise.all([...e.layouts,e.leaf].map(t=>t?.[1]()))}function Ev(r,e,t){An=r.state;const n=document.querySelector("style[data-sveltekit]");if(n&&n.remove(),Object.assign(si,r.props.page),Sv=new Un.root({target:e,props:{...r.props,stores:cs,components:f0},hydrate:t,sync:!1}),_v(Na),t){const i={from:null,to:{params:An.params,route:{id:An.route?.id??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};Bc.forEach(a=>a(i))}p0=!0}function m0({url:r,params:e,branch:t,status:n,error:i,route:a,form:s}){let o="never";if(ua&&(r.pathname===ua||r.pathname===ua+"/"))o="always";else for(const f of t)f?.slash!==void 0&&(o=f.slash);r.pathname=oC(r.pathname,o),r.search=r.search;const l={type:"loaded",state:{url:r,params:e,branch:t,error:i,route:a},props:{constructors:LC(t).map(f=>f.node.component),page:ap(si)}};s!==void 0&&(l.props.form=s);let c={},u=!si,h=0;for(let f=0;f<Math.max(t.length,An.branch.length);f+=1){const p=t[f],m=An.branch[f];p?.data!==m?.data&&(u=!0),p&&(c={...c,...p.data},u&&(l.props[`data_${h}`]=c),h+=1)}return(!An.url||r.href!==An.url.href||An.error!==i||s!==void 0&&s!==si.form||u)&&(l.props.page={error:i,params:e,route:{id:a?.id??null},state:{},status:n,url:new URL(r),form:s??null,data:u?c:si.data}),l}async function tp({loader:r,parent:e,url:t,params:n,route:i,server_data_node:a}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await r();if(c.universal?.load){let u=function(...d){for(const f of d){const{href:p}=new URL(f,t);l.dependencies.add(p)}};const h={tracing:{enabled:!1,root:mv,current:mv},route:new Proxy(i,{get:(d,f)=>(o&&(l.route=!0),d[f])}),params:new Proxy(n,{get:(d,f)=>(o&&l.params.add(f),d[f])}),data:a?.data??null,url:uC(t,()=>{o&&(l.url=!0)},d=>{o&&l.search_params.add(d)},Un.hash),async fetch(d,f){d instanceof Request&&(f={body:d.method==="GET"||d.method==="HEAD"?void 0:await d.blob(),cache:d.cache,credentials:d.credentials,headers:[...d.headers].length>0?d?.headers:void 0,integrity:d.integrity,keepalive:d.keepalive,method:d.method,mode:d.mode,redirect:d.redirect,referrer:d.referrer,referrerPolicy:d.referrerPolicy,signal:d.signal,...f});const{resolved:p,promise:m}=Tv(d,f,t);return o&&u(p.href),m},setHeaders:()=>{},depends:u,parent(){return o&&(l.parent=!0),e()},untrack(d){o=!1;try{return d()}finally{o=!0}}};s=await c.universal.load.call(null,h)??null}return{node:c,loader:r,server:a,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??a?.data??null,slash:c.universal?.trailingSlash??a?.slash}}function Tv(r,e,t){let n=r instanceof Request?r.url:r;const i=new URL(n,t);i.origin===t.origin&&(n=i.href.slice(t.origin.length));const a=p0?mC(n,i.href,e):pC(n,e);return{resolved:i,promise:a}}function Iv(r,e,t,n,i,a){if(Qg)return!0;if(!i)return!1;if(i.parent&&r||i.route&&e||i.url&&t)return!0;for(const s of i.search_params)if(n.has(s))return!0;for(const s of i.params)if(a[s]!==An.params[s])return!0;for(const s of i.dependencies)if(d0.some(o=>o(new URL(s))))return!0;return!1}function rp(r,e){return r?.type==="data"?r:r?.type==="skip"?e??null:null}function eE(r,e){if(!r)return new Set(e.searchParams.keys());const t=new Set([...r.searchParams.keys(),...e.searchParams.keys()]);for(const n of t){const i=r.searchParams.getAll(n),a=e.searchParams.getAll(n);i.every(s=>a.includes(s))&&a.every(s=>i.includes(s))&&t.delete(n)}return t}function Mv({error:r,url:e,route:t,params:n}){return{type:"loaded",state:{error:r,url:e,route:t,params:n,branch:[]},props:{page:ap(si),constructors:[]}}}async function Ov({id:r,invalidating:e,url:t,params:n,route:i,preload:a}){if(Fo?.id===r)return ah.delete(Fo.token),Fo.promise;const{errors:s,layouts:o,leaf:l}=i,c=[...o,l];s.forEach(A=>A?.().catch(()=>{})),c.forEach(A=>A?.[1]().catch(()=>{}));let u=null;const h=An.url?r!==y0(An.url):!1,d=An.route?i.id!==An.route.id:!1,f=eE(An.url,t);let p=!1;const m=c.map((A,C)=>{const k=An.branch[C],I=!!A?.[0]&&(k?.loader!==A[1]||Iv(p,d,h,f,k.server?.uses,n));return I&&(p=!0),I});if(m.some(Boolean)){try{u=await Fv(t,m)}catch(A){const C=await Uc(A,{url:t,params:n,route:{id:r}});return ah.has(a)?Mv({error:C,url:t,params:n,route:i}):b0({status:u0(A),error:C,url:t,route:i})}if(u.type==="redirect")return u}const y=u?.nodes;let v=!1;const x=c.map(async(A,C)=>{if(!A)return;const k=An.branch[C],I=y?.[C];if((!I||I.type==="skip")&&A[1]===k?.loader&&!Iv(v,d,h,f,k.universal?.uses,n))return k;if(v=!0,I?.type==="error")throw I;return tp({loader:A[1],url:t,params:n,route:i,parent:async()=>{const U={};for(let D=0;D<C;D+=1)Object.assign(U,(await x[D])?.data);return U},server_data_node:rp(I===void 0&&A[0]?{type:"skip"}:I??null,A[0]?k?.server:void 0)})});for(const A of x)A.catch(()=>{});const S=[];for(let A=0;A<c.length;A+=1)if(c[A])try{S.push(await x[A])}catch(C){if(C instanceof Ug)return{type:"redirect",location:C.location};if(ah.has(a))return Mv({error:await Uc(C,{params:n,url:t,route:{id:i.id}}),url:t,params:n,route:i});let k=u0(C),I;if(y?.includes(C))k=C.status??k,I=C.error;else if(C instanceof Ju)I=C.body;else{if(await cs.updated.check())return await bv(),await Lc(t);I=await Uc(C,{params:n,url:t,route:{id:i.id}})}const R=await tE(A,S,s);return R?m0({url:t,params:n,branch:S.slice(0,R.idx).concat(R.node),status:k,error:I,route:i}):await Rv(t,{id:i.id},I,k)}else S.push(void 0);return m0({url:t,params:n,branch:S,status:200,error:null,route:i,form:e?void 0:null})}async function tE(r,e,t){for(;r--;)if(t[r]){let n=r;for(;!e[n];)n-=1;try{return{idx:n+1,node:{node:await t[r](),loader:t[r],data:{},server:null,universal:null}}}catch{continue}}}async function b0({status:r,error:e,url:t,route:n}){const i={};let a=null;if(Un.server_loads[0]===0)try{const o=await Fv(t,[!0]);if(o.type!=="data"||o.nodes[0]&&o.nodes[0].type!=="data")throw 0;a=o.nodes[0]??null}catch{(t.origin!==eh||t.pathname!==location.pathname||Jg)&&await Lc(t)}try{const o=await tp({loader:Kg,url:t,params:i,route:n,parent:()=>Promise.resolve({}),server_data_node:rp(a)}),l={node:await h0(),loader:h0,universal:null,server:null,data:null};return m0({url:t,params:i,branch:[o,l],status:r,error:e,route:null})}catch(o){if(o instanceof Ug)return Zg(new URL(o.location,location.href),{},0);throw o}}async function rE(r){const e=r.href;if(g0.has(e))return g0.get(e);let t;try{const n=(async()=>{let i=await Un.hooks.reroute({url:new URL(r),fetch:async(a,s)=>Tv(a,s,r).promise})??r;if(typeof i=="string"){const a=new URL(r);Un.hash?a.hash=i:a.pathname=i,i=a}return i})();g0.set(e,n),t=await n}catch{g0.delete(e);return}return t}async function v0(r,e){if(r&&!c0(r,ua,Un.hash)){const t=await rE(r);if(!t)return;const n=nE(t);for(const i of $g){const a=i.exec(n);if(a)return{id:y0(r),invalidating:e,route:i,params:cC(a),url:r}}}}function nE(r){return lC(Un.hash?r.hash.replace(/^#/,"").replace(/[?#].+/,""):r.pathname.slice(ua.length))||"/"}function y0(r){return(Un.hash?r.hash.replace(/^#/,""):r.pathname)+r.search}function Nv({url:r,type:e,intent:t,delta:n}){let i=!1;const a=ip(An,t,r,e);n!==void 0&&(a.navigation.delta=n);const s={...a.navigation,cancel:()=>{i=!0,a.reject(new Error("navigation cancelled"))}};return nh||yv.forEach(o=>o(s)),i?null:a}async function sh({type:r,url:e,popped:t,keepfocus:n,noscroll:i,replace_state:a,state:s={},redirect_count:o=0,nav_token:l={},accept:c=vv,block:u=vv}){const h=Fl;Fl=l;const d=await v0(e,!1),f=r==="enter"?ip(An,d,e,r):Nv({url:e,type:r,delta:t?.delta,intent:d});if(!f){u(),Fl===l&&(Fl=h);return}const p=ki,m=Na;c(),nh=!0,p0&&f.navigation.type!=="enter"&&cs.navigating.set(th.current=f.navigation);let y=d&&await Ov(d);if(!y){if(c0(e,ua,Un.hash))return await Lc(e);y=await Rv(e,{id:null},await Uc(new zg(404,"Not Found",`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=d?.url||e,Fl!==l)return f.reject(new Error("navigation aborted")),!1;if(y.type==="redirect")if(o>=20)y=await b0({status:500,error:await Uc(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return await Zg(new URL(y.location,e).href,{},o+1,l),!1;else y.props.page.status>=400&&await cs.updated.check()&&(await bv(),await Lc(e));if(QC(),Xg(p),Av(m),y.props.page.url.pathname!==e.pathname&&(e.pathname=y.props.page.url.pathname),s=t?t.state:s,!t){const A=a?0:1,C={[Fc]:ki+=A,[Zu]:Na+=A,[cv]:s};(a?history.replaceState:history.pushState).call(history,C,"",e),a||KC(ki,Na)}if(Fo=null,y.props.page.state=s,p0){const A=(await Promise.all(Array.from(YC,C=>C(f.navigation)))).filter(C=>typeof C=="function");if(A.length>0){let C=function(){A.forEach(k=>{Bc.delete(k)})};A.push(C),A.forEach(k=>{Bc.add(k)})}An=y.state,y.props.page&&(y.props.page.url=e),Sv.$set(y.props),jC(y.props.page),xv=!0}else Ev(y,Yg,!1);const{activeElement:v}=document;await XC();const x=t?t.scroll:i?o0():null;if(wv){const A=e.hash&&document.getElementById(Lv(e));x?scrollTo(x.x,x.y):A?A.scrollIntoView():scrollTo(0,0)}const S=document.activeElement!==v&&document.activeElement!==document.body;!n&&!S&&cE(e),wv=!0,y.props.page&&Object.assign(si,y.props.page),nh=!1,r==="popstate"&&_v(Na),f.fulfil(void 0),Bc.forEach(A=>A(f.navigation)),cs.navigating.set(th.current=null)}async function Rv(r,e,t,n){return r.origin===eh&&r.pathname===location.pathname&&!Jg?await b0({status:n,error:t,url:r,route:e}):await Lc(r)}function iE(){let r,e,t;Vs.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(r),r=setTimeout(()=>{a(l,Rl.hover)},20)});function n(o){o.defaultPrevented||a(o.composedPath()[0],Rl.tap)}Vs.addEventListener("mousedown",n),Vs.addEventListener("touchstart",n,{passive:!0});const i=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(ep(new URL(l.target.href)),i.unobserve(l.target))},{threshold:0});async function a(o,l){const c=dv(o,Vs),u=c===e&&l>=t;if(!c||u)return;const{url:h,external:d,download:f}=Wg(c,ua,Un.hash);if(d||f)return;const p=l0(c),m=h&&y0(An.url)===y0(h);if(!(p.reload||m))if(l<=p.preload_data){e=c,t=Rl.tap;const y=await v0(h,!1);if(!y)return;ZC(y)}else l<=p.preload_code&&(e=c,t=l,ep(h))}function s(){i.disconnect();for(const o of Vs.querySelectorAll("a")){const{url:l,external:c,download:u}=Wg(o,ua,Un.hash);if(c||u)continue;const h=l0(o);h.reload||(h.preload_code===Rl.viewport&&i.observe(o),h.preload_code===Rl.eager&&ep(l))}}Bc.add(s),s()}function Uc(r,e){if(r instanceof Ju)return r.body;const t=u0(r),n=zC(r);return Un.hooks.handleError({error:r,event:e,status:t,message:n})??{message:n}}function aE(r,e){VC(()=>(r.add(e),()=>{r.delete(e)}))}function Pv(r){aE(Bc,r)}function Do(r,e={}){return r=new URL(Gg(r)),r.origin!==eh?Promise.reject(new Error("goto: invalid URL")):Zg(r,e,0)}function sE(r){if(typeof r=="function")d0.push(r);else{const{href:e}=new URL(r,location.href);d0.push(t=>t.href===e)}}function oE(){history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let t=!1;if(Cv(),!nh){const n=ip(An,void 0,null,"leave"),i={...n.navigation,cancel:()=>{t=!0,n.reject(new Error("navigation cancelled"))}};yv.forEach(a=>a(i))}t?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Cv()}),navigator.connection?.saveData||iE(),Vs.addEventListener("click",async e=>{if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const t=dv(e.composedPath()[0],Vs);if(!t)return;const{url:n,external:i,target:a,download:s}=Wg(t,ua,Un.hash);if(!n)return;if(a==="_parent"||a==="_top"){if(window.parent!==window)return}else if(a&&a!=="_self")return;const o=l0(t);if(!(t instanceof SVGAElement)&&n.protocol!==location.protocol&&!(n.protocol==="https:"||n.protocol==="http:")||s)return;const[c,u]=(Un.hash?n.hash.replace(/^#/,""):n.href).split("#"),h=c===jg(location);if(i||o.reload&&(!h||!u)){Nv({url:n,type:"link"})?nh=!0:e.preventDefault();return}if(u!==void 0&&h){const[,d]=An.url.href.split("#");if(d===u){if(e.preventDefault(),u===""||u==="top"&&t.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const f=t.ownerDocument.getElementById(decodeURIComponent(u));f&&(f.scrollIntoView(),f.focus())}return}if(ih=!0,Xg(ki),r(n),!o.replace_state)return;ih=!1}e.preventDefault(),await new Promise(d=>{requestAnimationFrame(()=>{setTimeout(d,0)}),setTimeout(d,100)}),await sh({type:"link",url:n,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??n.href===location.href})}),Vs.addEventListener("submit",e=>{if(e.defaultPrevented)return;const t=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if((n?.formTarget||t.target)==="_blank"||(n?.formMethod||t.method)!=="get")return;const s=new URL(n?.hasAttribute("formaction")&&n?.formAction||t.action);if(c0(s,ua,!1))return;const o=e.target,l=l0(o);if(l.reload)return;e.preventDefault(),e.stopPropagation();const c=new FormData(o),u=n?.getAttribute("name");u&&c.append(u,n?.getAttribute("value")??""),s.search=new URLSearchParams(c).toString(),sh({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href})}),addEventListener("popstate",async e=>{if(!np){if(e.state?.[Fc]){const t=e.state[Fc];if(Fl={},t===ki)return;const n=Pl[t],i=e.state[cv]??{},a=new URL(e.state[_C]??location.href),s=e.state[Zu],o=An.url?jg(location)===jg(An.url):!1;if(s===Na&&(xv||o)){i!==si.state&&(si.state=i),r(a),Pl[ki]=o0(),n&&scrollTo(n.x,n.y),ki=t;return}const c=t-ki;await sh({type:"popstate",url:a,popped:{state:i,scroll:n,delta:c},accept:()=>{ki=t,Na=s},block:()=>{history.go(-c)},nav_token:Fl})}else if(!ih){const t=new URL(location.href);r(t),Un.hash&&location.reload()}}}),addEventListener("hashchange",()=>{ih&&(ih=!1,history.replaceState({...history.state,[Fc]:++ki,[Zu]:Na},"",location.href))});for(const e of document.querySelectorAll("link"))$C.has(e.rel)&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&cs.navigating.set(th.current=null)});function r(e){An.url=si.url=e,cs.page.set(ap(si)),cs.page.notify()}}async function lE(r,{status:e=200,error:t,node_ids:n,params:i,route:a,server_route:s,data:o,form:l}){Jg=!0;const c=new URL(location.href);let u;({params:i={},route:a={id:null}}=await v0(c,!1)||{}),u=$g.find(({id:f})=>f===a.id);let h,d=!0;try{const f=n.map(async(m,y)=>{const v=o[y];return v?.uses&&(v.uses=Dv(v.uses)),tp({loader:Un.nodes[m],url:c,params:i,route:a,parent:async()=>{const x={};for(let S=0;S<y;S+=1)Object.assign(x,(await f[S]).data);return x},server_data_node:rp(v)})}),p=await Promise.all(f);if(u){const m=u.layouts;for(let y=0;y<m.length;y++)m[y]||p.splice(y,0,void 0)}h=m0({url:c,params:i,branch:p,status:e,error:t,form:l,route:u??null})}catch(f){if(f instanceof Ug){await Lc(new URL(f.location,location.href));return}h=await b0({status:u0(f),error:await Uc(f,{url:c,params:i,route:a}),url:c,route:a}),r.textContent="",d=!1}h.props.page&&(h.props.page.state={}),Ev(h,r,d)}async function Fv(r,e){const t=new URL(r);t.pathname=GC(r.pathname),r.pathname.endsWith("/")&&t.searchParams.append(UC,"1"),t.searchParams.append(BC,e.map(a=>a?"1":"0").join(""));const n=window.fetch,i=await n(t.href,{});if(!i.ok){let a;throw i.headers.get("content-type")?.includes("application/json")?a=await i.json():i.status===404?a="Not Found":i.status===500&&(a="Internal Error"),new Ju(i.status,a)}return new Promise(async a=>{const s=new Map,o=i.body.getReader();function l(u){return DC(u,{...Un.decoders,Promise:h=>new Promise((d,f)=>{s.set(h,{fulfil:d,reject:f})})})}let c="";for(;;){const{done:u,value:h}=await o.read();if(u&&!c)break;for(c+=!h&&c?`
`:dC.decode(h,{stream:!0});;){const d=c.indexOf(`
`);if(d===-1)break;const f=JSON.parse(c.slice(0,d));if(c=c.slice(d+1),f.type==="redirect")return a(f);if(f.type==="data")f.nodes?.forEach(p=>{p?.type==="data"&&(p.uses=Dv(p.uses),p.data=l(p.data))}),a(f);else if(f.type==="chunk"){const{id:p,data:m,error:y}=f,v=s.get(p);s.delete(p),y?v.reject(l(y)):v.fulfil(l(m))}}}})}function Dv(r){return{dependencies:new Set(r?.dependencies??[]),params:new Set(r?.params??[]),parent:!!r?.parent,route:!!r?.route,url:!!r?.url,search_params:new Set(r?.search_params??[])}}let np=!1;function cE(r){const e=document.querySelector("[autofocus]");if(e)e.focus();else{const t=Lv(r);if(t&&document.getElementById(t)){const{x:i,y:a}=o0();setTimeout(()=>{const s=history.state;np=!0,location.replace(`#${t}`),Un.hash&&location.replace(r.hash),history.replaceState(s,"",r.hash),scrollTo(i,a),np=!1})}else{const i=document.body,a=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),a!==null?i.setAttribute("tabindex",a):i.removeAttribute("tabindex")}const n=getSelection();if(n&&n.type!=="None"){const i=[];for(let a=0;a<n.rangeCount;a+=1)i.push(n.getRangeAt(a));setTimeout(()=>{if(n.rangeCount===i.length){for(let a=0;a<n.rangeCount;a+=1){const s=i[a],o=n.getRangeAt(a);if(s.commonAncestorContainer!==o.commonAncestorContainer||s.startContainer!==o.startContainer||s.endContainer!==o.endContainer||s.startOffset!==o.startOffset||s.endOffset!==o.endOffset)return}n.removeAllRanges()}})}}}function ip(r,e,t,n){let i,a;const s=new Promise((l,c)=>{i=l,a=c});return s.catch(()=>{}),{navigation:{from:{params:r.params,route:{id:r.route?.id??null},url:r.url},to:t&&{params:e?.params??null,route:{id:e?.route?.id??null},url:t},willUnload:!e,type:n,complete:s},fulfil:i,reject:a}}function ap(r){return{data:r.data,error:r.error,form:r.form,params:r.params,route:r.route,state:r.state,status:r.status,url:r.url}}function uE(r){const e=new URL(r);return e.hash=decodeURIComponent(r.hash),e}function Lv(r){let e;if(Un.hash){const[,,t]=r.hash.split("#",3);e=t??""}else e=r.hash.slice(1);return decodeURIComponent(e)}const Xne="modulepreload",$ne=function(r,e){return new URL(r,e).href},Kne={},zc=function(e,t,n){let i=Promise.resolve();function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})},hE={},dE="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(dE);var fE=ee('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),gE=ee("<!> <!>",1);function pE(r,e){ge(e,!0);let t=L(e,"components",23,()=>[]),n=L(e,"data_0",3,null),i=L(e,"data_1",3,null);yi(()=>e.stores.page.set(e.page)),Ft(()=>{e.stores,e.page,e.constructors,t(),e.form,n(),i(),e.stores.page.notify()});let a=oe(!1),s=oe(!1),o=oe(null);Si(()=>{const m=e.stores.page.subscribe(()=>{g(a)&&(O(s,!0),Oc().then(()=>{O(o,document.title||"untitled page",!0)}))});return O(a,!0),m});const l=j(()=>e.constructors[1]);var c=gE(),u=F(c);{var h=m=>{var y=J();const v=j(()=>e.constructors[0]);var x=F(y);ve(x,()=>g(v),(S,A)=>{Tr(A(S,{get data(){return n()},get form(){return e.form},get params(){return e.page.params},children:(C,k)=>{var I=J(),R=F(I);ve(R,()=>g(l),(U,D)=>{Tr(D(U,{get data(){return i()},get form(){return e.form},get params(){return e.page.params}}),$=>t()[1]=$,()=>t()?.[1])}),_(C,I)},$$slots:{default:!0}}),C=>t()[0]=C,()=>t()?.[0])}),_(m,y)},d=m=>{var y=J();const v=j(()=>e.constructors[0]);var x=F(y);ve(x,()=>g(v),(S,A)=>{Tr(A(S,{get data(){return n()},get form(){return e.form},get params(){return e.page.params}}),C=>t()[0]=C,()=>t()?.[0])}),_(m,y)};ce(u,m=>{e.constructors[1]?m(h):m(d,!1)})}var f=ae(u,2);{var p=m=>{var y=fE(),v=te(y);{var x=S=>{var A=sr();qe(()=>at(A,g(o))),_(S,A)};ce(v,S=>{g(s)&&S(x)})}Q(y),_(m,y)};ce(f,m=>{g(a)&&m(p)})}_(r,c),pe()}const mE=Z_(pE),bE=[()=>zc(()=>Promise.resolve().then(()=>fne),void 0,Fr&&Fr.tagName.toUpperCase()==="SCRIPT"&&Fr.src||new URL("_app/immutable/bundle.DkfpbWnE.js",document.baseURI).href),()=>zc(()=>Promise.resolve().then(()=>yne),void 0,Fr&&Fr.tagName.toUpperCase()==="SCRIPT"&&Fr.src||new URL("_app/immutable/bundle.DkfpbWnE.js",document.baseURI).href),()=>zc(()=>Promise.resolve().then(()=>kne),void 0,Fr&&Fr.tagName.toUpperCase()==="SCRIPT"&&Fr.src||new URL("_app/immutable/bundle.DkfpbWnE.js",document.baseURI).href),()=>zc(()=>Promise.resolve().then(()=>Cne),void 0,Fr&&Fr.tagName.toUpperCase()==="SCRIPT"&&Fr.src||new URL("_app/immutable/bundle.DkfpbWnE.js",document.baseURI).href)],vE=[],yE={"/":[2],"/chat/[id]":[3]},Bv={handleError:({error:r})=>{console.error(r)},reroute:()=>{},transport:{}},Uv=Object.fromEntries(Object.entries(Bv.transport).map(([r,e])=>[r,e.decode])),zv=Object.freeze(Object.defineProperty({__proto__:null,decode:(r,e)=>Uv[r](e),decoders:Uv,dictionary:yE,hash:!0,hooks:Bv,matchers:hE,nodes:bE,root:mE,server_loads:vE},Symbol.toStringTag,{value:"Module"}));function wE(r,e){JC(zv,r,e)}const xE={get params(){return si.params},get route(){return si.route},get status(){return si.status},get url(){return si.url}};cs.updated.check;const us=xE;var tn=(r=>(r.IMAGE="image",r.AUDIO="audio",r.PDF="pdf",r.TEXT="text",r))(tn||{}),jc=(r=>(r.JPEG="jpeg",r.PNG="png",r.GIF="gif",r.WEBP="webp",r.SVG="svg",r))(jc||{}),sp=(r=>(r.MP3="mp3",r.WAV="wav",r.WEBM="webm",r))(sp||{}),jv=(r=>(r.PDF="pdf",r))(jv||{}),on=(r=>(r.PLAIN_TEXT="plainText",r.MARKDOWN="markdown",r.JAVASCRIPT="javascript",r.TYPESCRIPT="typescript",r.JSX="jsx",r.TSX="tsx",r.CSS="css",r.HTML="html",r.JSON="json",r.XML="xml",r.YAML="yaml",r.CSV="csv",r.LOG="log",r.PYTHON="python",r.JAVA="java",r.CPP="cpp",r.PHP="php",r.RUBY="ruby",r.GO="go",r.RUST="rust",r.SHELL="shell",r.SQL="sql",r.R="r",r.SCALA="scala",r.KOTLIN="kotlin",r.SWIFT="swift",r.DART="dart",r.VUE="vue",r.SVELTE="svelte",r.LATEX="latex",r.BIBTEX="bibtex",r))(on||{}),Xs=(r=>(r.JPG=".jpg",r.JPEG=".jpeg",r.PNG=".png",r.GIF=".gif",r.WEBP=".webp",r.SVG=".svg",r))(Xs||{}),oh=(r=>(r.MP3=".mp3",r.WAV=".wav",r))(oh||{}),w0=(r=>(r.PDF=".pdf",r))(w0||{}),Rr=(r=>(r.TXT=".txt",r.MD=".md",r.JS=".js",r.TS=".ts",r.JSX=".jsx",r.TSX=".tsx",r.CSS=".css",r.HTML=".html",r.HTM=".htm",r.JSON=".json",r.XML=".xml",r.YAML=".yaml",r.YML=".yml",r.CSV=".csv",r.LOG=".log",r.PY=".py",r.JAVA=".java",r.CPP=".cpp",r.C=".c",r.H=".h",r.PHP=".php",r.RB=".rb",r.GO=".go",r.RS=".rs",r.SH=".sh",r.BAT=".bat",r.SQL=".sql",r.R=".r",r.SCALA=".scala",r.KT=".kt",r.SWIFT=".swift",r.DART=".dart",r.VUE=".vue",r.SVELTE=".svelte",r.TEX=".tex",r.BIB=".bib",r))(Rr||{}),Dl=(r=>(r.PDF="application/pdf",r))(Dl||{}),Ai=(r=>(r.MP3_MPEG="audio/mpeg",r.MP3="audio/mp3",r.MP4="audio/mp4",r.WAV="audio/wav",r.WEBM="audio/webm",r.WEBM_OPUS="audio/webm;codecs=opus",r))(Ai||{}),ha=(r=>(r.JPEG="image/jpeg",r.PNG="image/png",r.GIF="image/gif",r.WEBP="image/webp",r.SVG="image/svg+xml",r))(ha||{}),_r=(r=>(r.PLAIN="text/plain",r.MARKDOWN="text/markdown",r.JAVASCRIPT="text/javascript",r.JAVASCRIPT_APP="application/javascript",r.TYPESCRIPT="text/typescript",r.JSX="text/jsx",r.TSX="text/tsx",r.CSS="text/css",r.HTML="text/html",r.JSON="application/json",r.XML_TEXT="text/xml",r.XML_APP="application/xml",r.YAML_TEXT="text/yaml",r.YAML_APP="application/yaml",r.CSV="text/csv",r.PYTHON="text/x-python",r.JAVA="text/x-java-source",r.CPP_SRC="text/x-c++src",r.C_SRC="text/x-csrc",r.C_HDR="text/x-chdr",r.PHP="text/x-php",r.RUBY="text/x-ruby",r.GO="text/x-go",r.RUST="text/x-rust",r.SHELL="text/x-shellscript",r.BAT="application/x-bat",r.SQL="text/x-sql",r.R="text/x-r",r.SCALA="text/x-scala",r.KOTLIN="text/x-kotlin",r.SWIFT="text/x-swift",r.DART="text/x-dart",r.VUE="text/x-vue",r.SVELTE="text/x-svelte",r.LATEX="text/x-tex",r.BIBTEX="text/x-bibtex",r))(_r||{});const Hv={[sp.MP3]:{extensions:[oh.MP3],mimeTypes:[Ai.MP3_MPEG,Ai.MP3]},[sp.WAV]:{extensions:[oh.WAV],mimeTypes:[Ai.WAV]}},qv={[jc.JPEG]:{extensions:[Xs.JPG,Xs.JPEG],mimeTypes:[ha.JPEG]},[jc.PNG]:{extensions:[Xs.PNG],mimeTypes:[ha.PNG]},[jc.GIF]:{extensions:[Xs.GIF],mimeTypes:[ha.GIF]},[jc.WEBP]:{extensions:[Xs.WEBP],mimeTypes:[ha.WEBP]},[jc.SVG]:{extensions:[Xs.SVG],mimeTypes:[ha.SVG]}},Gv={[jv.PDF]:{extensions:[w0.PDF],mimeTypes:[Dl.PDF]}},Wv={[on.PLAIN_TEXT]:{extensions:[Rr.TXT],mimeTypes:[_r.PLAIN]},[on.MARKDOWN]:{extensions:[Rr.MD],mimeTypes:[_r.MARKDOWN]},[on.JAVASCRIPT]:{extensions:[Rr.JS],mimeTypes:[_r.JAVASCRIPT,_r.JAVASCRIPT_APP]},[on.TYPESCRIPT]:{extensions:[Rr.TS],mimeTypes:[_r.TYPESCRIPT]},[on.JSX]:{extensions:[Rr.JSX],mimeTypes:[_r.JSX]},[on.TSX]:{extensions:[Rr.TSX],mimeTypes:[_r.TSX]},[on.CSS]:{extensions:[Rr.CSS],mimeTypes:[_r.CSS]},[on.HTML]:{extensions:[Rr.HTML,Rr.HTM],mimeTypes:[_r.HTML]},[on.JSON]:{extensions:[Rr.JSON],mimeTypes:[_r.JSON]},[on.XML]:{extensions:[Rr.XML],mimeTypes:[_r.XML_TEXT,_r.XML_APP]},[on.YAML]:{extensions:[Rr.YAML,Rr.YML],mimeTypes:[_r.YAML_TEXT,_r.YAML_APP]},[on.CSV]:{extensions:[Rr.CSV],mimeTypes:[_r.CSV]},[on.LOG]:{extensions:[Rr.LOG],mimeTypes:[_r.PLAIN]},[on.PYTHON]:{extensions:[Rr.PY],mimeTypes:[_r.PYTHON]},[on.JAVA]:{extensions:[Rr.JAVA],mimeTypes:[_r.JAVA]},[on.CPP]:{extensions:[Rr.CPP,Rr.C,Rr.H],mimeTypes:[_r.CPP_SRC,_r.C_SRC,_r.C_HDR]},[on.PHP]:{extensions:[Rr.PHP],mimeTypes:[_r.PHP]},[on.RUBY]:{extensions:[Rr.RB],mimeTypes:[_r.RUBY]},[on.GO]:{extensions:[Rr.GO],mimeTypes:[_r.GO]},[on.RUST]:{extensions:[Rr.RS],mimeTypes:[_r.RUST]},[on.SHELL]:{extensions:[Rr.SH,Rr.BAT],mimeTypes:[_r.SHELL,_r.BAT]},[on.SQL]:{extensions:[Rr.SQL],mimeTypes:[_r.SQL]},[on.R]:{extensions:[Rr.R],mimeTypes:[_r.R]},[on.SCALA]:{extensions:[Rr.SCALA],mimeTypes:[_r.SCALA]},[on.KOTLIN]:{extensions:[Rr.KT],mimeTypes:[_r.KOTLIN]},[on.SWIFT]:{extensions:[Rr.SWIFT],mimeTypes:[_r.SWIFT]},[on.DART]:{extensions:[Rr.DART],mimeTypes:[_r.DART]},[on.VUE]:{extensions:[Rr.VUE],mimeTypes:[_r.VUE]},[on.SVELTE]:{extensions:[Rr.SVELTE],mimeTypes:[_r.SVELTE]},[on.LATEX]:{extensions:[Rr.TEX],mimeTypes:[_r.LATEX]},[on.BIBTEX]:{extensions:[Rr.BIB],mimeTypes:[_r.BIBTEX]}};function da(r){return Object.values(qv).some(e=>e.mimeTypes.includes(r))?tn.IMAGE:Object.values(Hv).some(e=>e.mimeTypes.includes(r))?tn.AUDIO:Object.values(Gv).some(e=>e.mimeTypes.includes(r))?tn.PDF:Object.values(Wv).some(e=>e.mimeTypes.includes(r))?tn.TEXT:null}function SE(r){const e=r.toLowerCase().substring(r.lastIndexOf("."));for(const[t,n]of Object.entries(qv))if(n.extensions.includes(e))return`${tn.IMAGE}:${t}`;for(const[t,n]of Object.entries(Hv))if(n.extensions.includes(e))return`${tn.AUDIO}:${t}`;for(const[t,n]of Object.entries(Gv))if(n.extensions.includes(e))return`${tn.PDF}:${t}`;for(const[t,n]of Object.entries(Wv))if(n.extensions.includes(e))return`${tn.TEXT}:${t}`;return null}function kE(r,e){return e&&da(e)?!0:SE(r)!==null}function AE(r){return typeof r=="function"}function lh(r){return r!==null&&typeof r=="object"}const _E=["string","number","bigint","boolean"];function op(r){return r==null||_E.includes(typeof r)?!0:Array.isArray(r)?r.every(e=>op(e)):typeof r=="object"?Object.getPrototypeOf(r)===Object.prototype:!1}const ch=Symbol("box"),lp=Symbol("is-writable");function CE(r){return lh(r)&&ch in r}function EE(r){return fe.isBox(r)&&lp in r}function fe(r){let e=oe(Mr(r));return{[ch]:!0,[lp]:!0,get current(){return g(e)},set current(t){O(e,t,!0)}}}function TE(r,e){const t=j(r);return e?{[ch]:!0,[lp]:!0,get current(){return g(t)},set current(n){e(n)}}:{[ch]:!0,get current(){return r()}}}function IE(r){return fe.isBox(r)?r:AE(r)?fe.with(r):fe(r)}function ME(r){return Object.entries(r).reduce((e,[t,n])=>fe.isBox(n)?(fe.isWritableBox(n)?Object.defineProperty(e,t,{get(){return n.current},set(i){n.current=i}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function OE(r){return fe.isWritableBox(r)?{[ch]:!0,get current(){return r.current}}:r}fe.from=IE,fe.with=TE,fe.flatten=ME,fe.readonly=OE,fe.isBox=CE,fe.isWritableBox=EE;function Vv(...r){return function(e){for(const t of r)if(t){if(e.defaultPrevented)return;typeof t=="function"?t.call(this,e):t.current?.call(this,e)}}}var NE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function x0(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Hc={},cp,Xv;function RE(){if(Xv)return cp;Xv=1;var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,l=`
`,c="/",u="*",h="",d="comment",f="declaration";cp=function(m,y){if(typeof m!="string")throw new TypeError("First argument must be a string");if(!m)return[];y=y||{};var v=1,x=1;function S(V){var z=V.match(e);z&&(v+=z.length);var Z=V.lastIndexOf(l);x=~Z?V.length-Z:x+V.length}function A(){var V={line:v,column:x};return function(z){return z.position=new C(V),R(),z}}function C(V){this.start=V,this.end={line:v,column:x},this.source=y.source}C.prototype.content=m;function k(V){var z=new Error(y.source+":"+v+":"+x+": "+V);if(z.reason=V,z.filename=y.source,z.line=v,z.column=x,z.source=m,!y.silent)throw z}function I(V){var z=V.exec(m);if(z){var Z=z[0];return S(Z),m=m.slice(Z.length),z}}function R(){I(t)}function U(V){var z;for(V=V||[];z=D();)z!==!1&&V.push(z);return V}function D(){var V=A();if(!(c!=m.charAt(0)||u!=m.charAt(1))){for(var z=2;h!=m.charAt(z)&&(u!=m.charAt(z)||c!=m.charAt(z+1));)++z;if(z+=2,h===m.charAt(z-1))return k("End of comment missing");var Z=m.slice(2,z-2);return x+=2,S(Z),m=m.slice(z),x+=2,V({type:d,comment:Z})}}function $(){var V=A(),z=I(n);if(z){if(D(),!I(i))return k("property missing ':'");var Z=I(a),q=V({type:f,property:p(z[0].replace(r,h)),value:Z?p(Z[0].replace(r,h)):h});return I(s),q}}function H(){var V=[];U(V);for(var z;z=$();)z!==!1&&(V.push(z),U(V));return V}return R(),H()};function p(m){return m?m.replace(o,h):h}return cp}var $v;function PE(){if($v)return Hc;$v=1;var r=Hc&&Hc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.default=t;var e=r(RE());function t(n,i){var a=null;if(!n||typeof n!="string")return a;var s=(0,e.default)(n),o=typeof i=="function";return s.forEach(function(l){if(l.type==="declaration"){var c=l.property,u=l.value;o?i(c,u,l):u&&(a=a||{},a[c]=u)}}),a}return Hc}var FE=PE();const Kv=x0(FE),DE=Kv.default||Kv,LE=/\d/,BE=["-","_","/","."];function UE(r=""){if(!LE.test(r))return r!==r.toLowerCase()}function zE(r){const e=[];let t="",n,i;for(const a of r){const s=BE.includes(a);if(s===!0){e.push(t),t="",n=void 0;continue}const o=UE(a);if(i===!1){if(n===!1&&o===!0){e.push(t),t=a,n=o;continue}if(n===!0&&o===!1&&t.length>1){const l=t.at(-1);e.push(t.slice(0,Math.max(0,t.length-1))),t=l+a,n=o;continue}}t+=a,n=o,i=s}return e.push(t),e}function Yv(r){return r?zE(r).map(e=>HE(e)).join(""):""}function jE(r){return qE(Yv(r||""))}function HE(r){return r?r[0].toUpperCase()+r.slice(1):""}function qE(r){return r?r[0].toLowerCase()+r.slice(1):""}function uh(r){if(!r)return{};const e={};function t(n,i){if(n.startsWith("-moz-")||n.startsWith("-webkit-")||n.startsWith("-ms-")||n.startsWith("-o-")){e[Yv(n)]=i;return}if(n.startsWith("--")){e[n]=i;return}e[jE(n)]=i}return DE(r,t),e}function $s(...r){return(...e)=>{for(const t of r)typeof t=="function"&&t(...e)}}function GE(r,e){const t=RegExp(r,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(t)?n.replace(t,e):n}}const WE=GE(/[A-Z]/,r=>`-${r.toLowerCase()}`);function VE(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError(`expected an argument of type object, but got ${typeof r}`);return Object.keys(r).map(e=>`${WE(e)}: ${r[e]};`).join(`
`)}function up(r={}){return VE(r).replace(`
`," ")}const XE=up({position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"}),$E=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],KE=new Set($E);function YE(r){return KE.has(r)}function rr(...r){const e={...r[0]};for(let t=1;t<r.length;t++){const n=r[t];if(n){for(const i of Object.keys(n)){const a=e[i],s=n[i],o=typeof a=="function",l=typeof s=="function";if(o&&YE(i)){const c=a,u=s;e[i]=Vv(c,u)}else if(o&&l)e[i]=$s(a,s);else if(i==="class"){const c=op(a),u=op(s);c&&u?e[i]=Ku(a,s):c?e[i]=Ku(a):u&&(e[i]=Ku(s))}else if(i==="style"){const c=typeof a=="object",u=typeof s=="object",h=typeof a=="string",d=typeof s=="string";if(c&&u)e[i]={...a,...s};else if(c&&d){const f=uh(s);e[i]={...a,...f}}else if(h&&u){const f=uh(a);e[i]={...f,...s}}else if(h&&d){const f=uh(a),p=uh(s);e[i]={...f,...p}}else c?e[i]=a:u?e[i]=s:h?e[i]=a:d&&(e[i]=s)}else e[i]=s!==void 0?s:a}for(const i of Object.getOwnPropertySymbols(n)){const a=e[i],s=n[i];e[i]=s!==void 0?s:a}}}return typeof e.style=="object"&&(e.style=up(e.style).replaceAll(`
`," ")),e.hidden!==!0&&(e.hidden=void 0,delete e.hidden),e.disabled!==!0&&(e.disabled=void 0,delete e.disabled),e}const Jv=typeof window<"u"?window:void 0;function JE(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}var QE=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],ZE=["difference","intersection","symmetricDifference","union"],Qv=!1;class Ks extends Set{#e=new Map;#t=oe(0);#r=oe(0);#n=Ya||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#r.v=super.size}Qv||this.#i()}#a(e){return Ya===this.#n?oe(e):No(e)}#i(){Qv=!0;var e=Ks.prototype,t=Set.prototype;for(const n of QE)e[n]=function(...i){return g(this.#t),t[n].apply(this,i)};for(const n of ZE)e[n]=function(...i){g(this.#t);var a=t[n].apply(this,i);return new Ks(a)}}has(e){var t=super.has(e),n=this.#e,i=n.get(e);if(i===void 0){if(!t)return g(this.#t),!1;i=this.#a(!0),n.set(e,i)}return g(i),t}add(e){return super.has(e)||(super.add(e),O(this.#r,super.size),Ea(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,i=n.get(e);return i!==void 0&&(n.delete(e),O(i,!1)),t&&(O(this.#r,super.size),Ea(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())O(t,!1);e.clear(),O(this.#r,0),Ea(this.#t)}}keys(){return this.values()}values(){return g(this.#t),super.values()}entries(){return g(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return g(this.#r)}}class hp extends Map{#e=new Map;#t=oe(0);#r=oe(0);#n=Ya||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#r.v=super.size}}#a(e){return Ya===this.#n?oe(e):No(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){var i=super.get(e);if(i!==void 0)n=this.#a(0),t.set(e,n);else return g(this.#t),!1}return g(n),!0}forEach(e,t){this.#i(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){var i=super.get(e);if(i!==void 0)n=this.#a(0),t.set(e,n);else{g(this.#t);return}}return g(n),super.get(e)}set(e,t){var n=this.#e,i=n.get(e),a=super.get(e),s=super.set(e,t),o=this.#t;if(i===void 0)i=this.#a(0),n.set(e,i),O(this.#r,super.size),Ea(o);else if(a!==t){Ea(i);var l=o.reactions===null?null:new Set(o.reactions),c=l===null||!i.reactions?.every(u=>l.has(u));c&&Ea(o)}return s}delete(e){var t=this.#e,n=t.get(e),i=super.delete(e);return n!==void 0&&(t.delete(e),O(this.#r,super.size),O(n,-1),Ea(this.#t)),i}clear(){if(super.size!==0){super.clear();var e=this.#e;O(this.#r,0);for(var t of e.values())O(t,-1);Ea(this.#t),e.clear()}}#i(){g(this.#t);var e=this.#e;if(this.#r.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#a(0);e.set(t,n)}}for([,n]of this.#e)g(n)}keys(){return g(this.#t),super.keys()}values(){return this.#i(),super.values()}entries(){return this.#i(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return g(this.#r),super.size}}class eT{#e;#t;constructor(e,t){this.#e=e,this.#t=Cl(t)}get current(){return this.#t(),this.#e()}}const tT=/\(.+\)/,rT=new Set(["all","print","screen","and","or","not","only"]);class Zv extends eT{constructor(e,t){let n=tT.test(e)||e.split(/[\s,]+/).some(a=>rT.has(a.trim()))?e:`(${e})`;const i=window.matchMedia(n);super(()=>i.matches,a=>$r(i,"change",a))}}let nT=class{#e;#t;constructor(e={}){const{window:t=Jv,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Cl(i=>{const a=$r(t,"focusin",i),s=$r(t,"focusout",i);return()=>{a(),s()}}))}get current(){return this.#t?.(),this.#e?JE(this.#e):null}};new nT;function e4(r){return typeof r=="function"}function iT(r,e){if(e4(r)){const n=r();return n===void 0?e:n}return r===void 0?e:r}let Gn=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return gg(this.#t)}get(){const e=Ac(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=Ac(this.#t);return t===void 0?e:t}set(e){return qd(this.#t,e)}};function S0(r,e){let t=oe(null);const n=j(()=>iT(e,250));function i(...a){if(g(t))g(t).timeout&&clearTimeout(g(t).timeout);else{let s,o;const l=new Promise((c,u)=>{s=c,o=u});O(t,{timeout:null,runner:null,promise:l,resolve:s,reject:o},!0)}return g(t).runner=async()=>{if(!g(t))return;const s=g(t);O(t,null);try{s.resolve(await r.apply(this,a))}catch(o){s.reject(o)}},g(t).timeout=setTimeout(g(t).runner,g(n)),g(t).promise}return i.cancel=async()=>{(!g(t)||g(t).timeout===null)&&(await new Promise(a=>setTimeout(a,0)),!g(t)||g(t).timeout===null)||(clearTimeout(g(t).timeout),g(t).reject("Cancelled"),O(t,null))},i.runScheduledNow=async()=>{(!g(t)||!g(t).timeout)&&(await new Promise(a=>setTimeout(a,0)),!g(t)||!g(t).timeout)||(clearTimeout(g(t).timeout),g(t).timeout=null,await g(t).runner?.())},Object.defineProperty(i,"pending",{enumerable:!0,get(){return!!g(t)?.timeout}}),i}function aT(r,e){switch(r){case"post":Ft(e);break;case"pre":yi(e);break}}function t4(r,e,t,n={}){const{lazy:i=!1}=n;let a=!i,s=Array.isArray(r)?[]:void 0;aT(e,()=>{const o=Array.isArray(r)?r.map(c=>c()):r();if(!a){a=!0,s=o;return}const l=dn(()=>t(o,s));return s=o,l})}function zr(r,e,t){t4(r,"post",e,t)}function sT(r,e,t){t4(r,"pre",e,t)}zr.pre=sT;function r4(r){return e4(r)?r():r}class oT{#e={width:0,height:0};#t=!1;#r;#n;#a;#i=j(()=>(g(this.#o)?.(),this.getSize().width));#s=j(()=>(g(this.#o)?.(),this.getSize().height));#o=j(()=>{const e=r4(this.#n);if(e)return Cl(t=>{if(!this.#a)return;const n=new this.#a.ResizeObserver(i=>{this.#t=!0;for(const a of i){const s=this.#r.box==="content-box"?a.contentBoxSize:a.borderBoxSize,o=Array.isArray(s)?s:[s];this.#e.width=o.reduce((l,c)=>Math.max(l,c.inlineSize),0),this.#e.height=o.reduce((l,c)=>Math.max(l,c.blockSize),0)}t()});return n.observe(e),()=>{this.#t=!1,n.disconnect()}})});constructor(e,t={box:"border-box"}){this.#a=t.window??Jv,this.#r=t,this.#n=e,this.#e={width:0,height:0}}calculateSize(){const e=r4(this.#n);if(!e||!this.#a)return;const t=e.offsetWidth,n=e.offsetHeight;if(this.#r.box==="border-box")return{width:t,height:n};const i=this.#a.getComputedStyle(e),a=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),s=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),o=parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth),l=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),c=t-a-o,u=n-s-l;return{width:c,height:u}}getSize(){return this.#t?this.#e:this.calculateSize()??this.#e}get current(){return g(this.#o)?.(),this.getSize()}get width(){return g(this.#i)}get height(){return g(this.#s)}}class dp{#e=oe(!1);constructor(){Ft(()=>(dn(()=>O(this.#e,!0)),()=>{O(this.#e,!1)}))}get current(){return g(this.#e)}}class n4{#e=oe(void 0);constructor(e,t){t!==void 0&&O(this.#e,t,!0),zr(()=>e(),(n,i)=>{O(this.#e,i,!0)})}get current(){return g(this.#e)}}function Lo(r){Ft(()=>()=>{r()})}function qc(r,e){return setTimeout(e,r)}function Ra(r){Oc().then(r)}function fp(r){Ft(()=>dn(()=>r()))}const lT=1,cT=9,uT=11;function gp(r){return lh(r)&&r.nodeType===lT&&typeof r.nodeName=="string"}function i4(r){return lh(r)&&r.nodeType===cT}function hT(r){return lh(r)&&r.constructor?.name==="VisualViewport"}function dT(r){return lh(r)&&r.nodeType!==void 0}function a4(r){return dT(r)&&r.nodeType===uT&&"host"in r}function fT(r,e){if(!r||!e||!gp(r)||!gp(e))return!1;const t=e.getRootNode?.();if(r===e||r.contains(e))return!0;if(t&&a4(t)){let n=e;for(;n;){if(r===n)return!0;n=n.parentNode||n.host}}return!1}function hh(r){return i4(r)?r:hT(r)?r.document:r?.ownerDocument??document}function k0(r){return a4(r)?k0(r.host):i4(r)?r.defaultView??window:gp(r)?r.ownerDocument?.defaultView??window:window}function gT(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class Bo{element;#e=j(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return g(this.#e)}set root(e){O(this.#e,e)}constructor(e){typeof e=="function"?this.element=fe.with(e):this.element=e}getDocument=()=>hh(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>gT(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)}function rn(r,e){return{[p_()]:t=>fe.isBox(r)?(r.current=t,dn(()=>e?.(t)),()=>{"isConnected"in t&&t.isConnected||(r.current=null,e?.(null))}):(r(t),dn(()=>e?.(t)),()=>{"isConnected"in t&&t.isConnected||(r(null),e?.(null))})}}function Uo(r){return r?"open":"closed"}function pT(r){return r?"true":"false"}function pp(r){return r?"true":"false"}function hs(r){return r?"":void 0}function mT(r){return r?"true":"false"}function bT(r,e){return e?"mixed":r?"true":"false"}function Zne(r){return r}function vT(r){return r?"true":void 0}function yT(r){return r?!0:void 0}function wT(r){return r?!0:void 0}class xT{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(t=>[t,this.getAttr(t)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}}function zo(r){const e=new xT(r);return{...e.attrs,selector:e.selector,getAttr:e.getAttr}}const ds="ArrowDown",mp="ArrowLeft",bp="ArrowRight",fs="ArrowUp",A0="End",jo="Enter",ST="Escape",_0="Home",vp="PageDown",yp="PageUp",gs=" ",wp="Tab";function kT(r){return window.getComputedStyle(r).getPropertyValue("direction")}function AT(r="ltr",e="horizontal"){return{horizontal:r==="rtl"?mp:bp,vertical:ds}[e]}function _T(r="ltr",e="horizontal"){return{horizontal:r==="rtl"?bp:mp,vertical:fs}[e]}function CT(r="ltr",e="horizontal"){return["ltr","rtl"].includes(r)||(r="ltr"),["horizontal","vertical"].includes(e)||(e="horizontal"),{nextKey:AT(r,e),prevKey:_T(r,e)}}class ET{#e;#t=fe(null);constructor(e){this.#e=e}getCandidateNodes(){return this.#e.rootNode.current?this.#e.candidateSelector?Array.from(this.#e.rootNode.current.querySelectorAll(this.#e.candidateSelector)):this.#e.candidateAttr?Array.from(this.#e.rootNode.current.querySelectorAll(`[${this.#e.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const e=this.getCandidateNodes();e.length&&e[0]?.focus()}handleKeydown(e,t,n=!1){const i=this.#e.rootNode.current;if(!i||!e)return;const a=this.getCandidateNodes();if(!a.length)return;const s=a.indexOf(e),o=kT(i),{nextKey:l,prevKey:c}=CT(o,this.#e.orientation.current),u=this.#e.loop.current,h={[l]:s+1,[c]:s-1,[_0]:0,[A0]:a.length-1};if(n){const p=l===ds?bp:ds,m=c===fs?mp:fs;h[p]=s+1,h[m]=s-1}let d=h[t.key];if(d===void 0)return;t.preventDefault(),d<0&&u?d=a.length-1:d===a.length&&u&&(d=0);const f=a[d];if(f)return f.focus(),this.#t.current=f.id,this.#e.onCandidateFocus?.(f),f}getTabIndex(e){const t=this.getCandidateNodes(),n=this.#t.current!==null;return e&&!n&&t[0]===e?(this.#t.current=e.id,0):e?.id===this.#t.current?0:-1}setCurrentTabStopId(e){this.#t.current=e}}function br(){}function hn(r,e){return`bits-${r}`}class s4{state;#e;constructor(e,t){this.state=fe(e),this.#e=t,this.dispatch=this.dispatch.bind(this)}#t(e){return this.#e[this.state.current][e]??this.state.current}dispatch(e){this.state.current=this.#t(e)}}const TT={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}};class IT{opts;#e=oe("none");get prevAnimationNameState(){return g(this.#e)}set prevAnimationNameState(e){O(this.#e,e,!0)}#t=oe(Mr({}));get styles(){return g(this.#t)}set styles(e){O(this.#t,e,!0)}initialStatus;previousPresent;machine;present;constructor(e){this.opts=e,this.present=this.opts.open,this.initialStatus=e.open.current?"mounted":"unmounted",this.previousPresent=new n4(()=>this.present.current),this.machine=new s4(this.initialStatus,TT),this.handleAnimationEnd=this.handleAnimationEnd.bind(this),this.handleAnimationStart=this.handleAnimationStart.bind(this),MT(this),OT(this),NT(this)}handleAnimationEnd(e){if(!this.opts.ref.current)return;const t=C0(this.opts.ref.current),n=t.includes(e.animationName)||t==="none";e.target===this.opts.ref.current&&n&&this.machine.dispatch("ANIMATION_END")}handleAnimationStart(e){this.opts.ref.current&&e.target===this.opts.ref.current&&(this.prevAnimationNameState=C0(this.opts.ref.current))}#r=j(()=>["mounted","unmountSuspended"].includes(this.machine.state.current));get isPresent(){return g(this.#r)}set isPresent(e){O(this.#r,e)}}function MT(r){zr(()=>r.present.current,()=>{if(!r.opts.ref.current||!(r.present.current!==r.previousPresent.current))return;const t=r.prevAnimationNameState,n=C0(r.opts.ref.current);if(r.present.current)r.machine.dispatch("MOUNT");else if(n==="none"||r.styles.display==="none")r.machine.dispatch("UNMOUNT");else{const i=t!==n;r.previousPresent.current&&i?r.machine.dispatch("ANIMATION_OUT"):r.machine.dispatch("UNMOUNT")}})}function OT(r){zr(()=>r.machine.state.current,()=>{if(!r.opts.ref.current)return;const e=C0(r.opts.ref.current);r.prevAnimationNameState=r.machine.state.current==="mounted"?e:"none"})}function NT(r){zr(()=>r.opts.ref.current,()=>{if(r.opts.ref.current)return r.styles=getComputedStyle(r.opts.ref.current),$s($r(r.opts.ref.current,"animationstart",r.handleAnimationStart),$r(r.opts.ref.current,"animationcancel",r.handleAnimationEnd),$r(r.opts.ref.current,"animationend",r.handleAnimationEnd))})}function C0(r){return r&&getComputedStyle(r).animationName||"none"}function Ys(r,e){ge(e,!0);const t=new IT({open:fe.with(()=>e.open),ref:e.ref});var n=J(),i=F(n);{var a=s=>{var o=J(),l=F(o);Te(l,()=>e.presence??Re,()=>({present:t.isPresent})),_(s,o)};ce(i,s=>{(e.forceMount||e.open||t.isPresent)&&s(a)})}_(r,n),pe()}class RT{#e;#t=void 0;#r=!1;constructor(e){this.#e=e,Lo(()=>this.#n())}#n(){this.#t&&(window.cancelAnimationFrame(this.#t),this.#t=void 0),this.#r=!1}run(e){if(this.#r)return;this.#n(),this.#r=!0;const t=this.#e.ref.current;if(!t){this.#r=!1;return}if(typeof t.getAnimations!="function"){this.#a(e);return}this.#t=window.requestAnimationFrame(()=>{const n=t.getAnimations();if(n.length===0){this.#a(e);return}Promise.allSettled(n.map(i=>i.finished)).then(()=>{this.#a(e)})})}#a(e){const t=()=>{e(),this.#r=!1};this.#e.afterTick?Ra(t):t()}}class dh{#e;#t;#r;constructor(e){this.#e=e,this.#t=e.enabled??!0,this.#r=new RT({ref:this.#e.ref,afterTick:this.#e.open}),zr([()=>this.#e.open.current],([t])=>{this.#t&&this.#r.run(()=>{t===this.#e.open.current&&this.#e.onComplete()})})}}const PT=zo({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),Ho=new Gn("Dialog.Root | AlertDialog.Root");class E0{static create(e){return Ho.set(new E0(e))}opts;#e=oe(null);get triggerNode(){return g(this.#e)}set triggerNode(e){O(this.#e,e,!0)}#t=oe(null);get contentNode(){return g(this.#t)}set contentNode(e){O(this.#t,e,!0)}#r=oe(null);get descriptionNode(){return g(this.#r)}set descriptionNode(e){O(this.#r,e,!0)}#n=oe(void 0);get contentId(){return g(this.#n)}set contentId(e){O(this.#n,e,!0)}#a=oe(void 0);get titleId(){return g(this.#a)}set titleId(e){O(this.#a,e,!0)}#i=oe(void 0);get triggerId(){return g(this.#i)}set triggerId(e){O(this.#i,e,!0)}#s=oe(void 0);get descriptionId(){return g(this.#s)}set descriptionId(e){O(this.#s,e,!0)}#o=oe(null);get cancelNode(){return g(this.#o)}set cancelNode(e){O(this.#o,e,!0)}constructor(e){this.opts=e,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),new dh({ref:fe.with(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>PT.getAttr(e,this.opts.variant.current);#l=j(()=>({"data-state":Uo(this.opts.open.current)}));get sharedProps(){return g(this.#l)}set sharedProps(e){O(this.#l,e)}}class xp{static create(e){return new xp(e,Ho.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===gs||e.key===jo)&&(e.preventDefault(),this.root.handleClose())}#e=j(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return g(this.#e)}set props(e){O(this.#e,e)}}class Sp{static create(e){return new Sp(e,Ho.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(this.opts.ref)}#e=j(()=>({id:this.opts.id.current,[this.root.getBitsAttr("action")]:"",...this.root.sharedProps,...this.attachment}));get props(){return g(this.#e)}set props(e){O(this.#e,e)}}class kp{static create(e){return new kp(e,Ho.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=rn(this.opts.ref),zr.pre(()=>this.opts.id.current,n=>{this.root.titleId=n})}#e=j(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment}));get props(){return g(this.#e)}set props(e){O(this.#e,e)}}class Ap{static create(e){return new Ap(e,Ho.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=rn(this.opts.ref,n=>{this.root.descriptionNode=n}),zr.pre(()=>this.opts.id.current,n=>{this.root.descriptionId=n})}#e=j(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment}));get props(){return g(this.#e)}set props(e){O(this.#e,e)}}class T0{static create(e){return new T0(e,Ho.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(this.opts.ref,n=>{this.root.contentNode=n,this.root.contentId=n?.id})}#e=j(()=>({open:this.root.opts.open.current}));get snippetProps(){return g(this.#e)}set snippetProps(e){O(this.#e,e)}#t=j(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,...this.root.sharedProps,...this.attachment}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}class _p{static create(e){return new _p(e,Ho.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(this.opts.ref)}#e=j(()=>({open:this.root.opts.open.current}));get snippetProps(){return g(this.#e)}set snippetProps(e){O(this.#e,e)}#t=j(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto"},...this.root.sharedProps,...this.attachment}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}class Cp{static create(e){return new Cp(e,Ho.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(this.opts.ref,n=>this.root.cancelNode=n),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===gs||e.key===jo)&&(e.preventDefault(),this.root.handleClose())}#e=j(()=>({id:this.opts.id.current,[this.root.getBitsAttr("cancel")]:"",onclick:this.onclick,onkeydown:this.onkeydown,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return g(this.#e)}set props(e){O(this.#e,e)}}function FT(r,e){ge(e,!0);let t=L(e,"open",15,!1),n=L(e,"onOpenChange",3,br),i=L(e,"onOpenChangeComplete",3,br);E0.create({variant:fe.with(()=>"alert-dialog"),open:fe.with(()=>t(),o=>{t(o),n()(o)}),onOpenChangeComplete:fe.with(()=>i())});var a=J(),s=F(a);Te(s,()=>e.children??Re),_(r,a),pe()}var DT=ee("<div><!></div>");function Ep(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"level",3,2),s=De(e,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);const o=kp.create({id:fe.with(()=>n()),level:fe.with(()=>a()),ref:fe.with(()=>i(),f=>i(f))}),l=j(()=>rr(s,o.props));var c=J(),u=F(c);{var h=f=>{var p=J(),m=F(p);Te(m,()=>e.child,()=>({props:g(l)})),_(f,p)},d=f=>{var p=DT();Lt(p,()=>({...g(l)}));var m=te(p);Te(m,()=>e.children??Re),Q(p),_(f,p)};ce(u,f=>{e.child?f(h):f(d,!1)})}_(r,c),pe()}var LT=ee("<button><!></button>");function BT(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=De(e,["$$slots","$$events","$$legacy","children","child","id","ref"]);const s=Sp.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),d=>i(d))}),o=j(()=>rr(a,s.props));var l=J(),c=F(l);{var u=d=>{var f=J(),p=F(f);Te(p,()=>e.child,()=>({props:g(o)})),_(d,f)},h=d=>{var f=LT();Lt(f,()=>({...g(o)}));var p=te(f);Te(p,()=>e.children??Re),Q(f),_(d,f)};ce(c,d=>{e.child?d(u):d(h,!1)})}_(r,l),pe()}var UT=ee("<button><!></button>");function zT(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"disabled",3,!1),s=De(e,["$$slots","$$events","$$legacy","id","ref","children","child","disabled"]);const o=Cp.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),f=>i(f)),disabled:fe.with(()=>!!a())}),l=j(()=>rr(s,o.props));var c=J(),u=F(c);{var h=f=>{var p=J(),m=F(p);Te(m,()=>e.child,()=>({props:g(l)})),_(f,p)},d=f=>{var p=UT();Lt(p,()=>({...g(l)}));var m=te(p);Te(m,()=>e.children??Re),Q(p),_(f,p)};ce(u,f=>{e.child?f(h):f(d,!1)})}_(r,c),pe()}function jT(r,e){var t=J(),n=F(t);I_(n,()=>e.children,i=>{var a=J(),s=F(a);Te(s,()=>e.children??Re),_(i,a)}),_(r,t)}const Tp=typeof document<"u",Ip=HT();function HT(){return Tp&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function qo(r){return r instanceof HTMLElement}function fh(r){return r instanceof Element}function qT(r){return r instanceof Element||r instanceof SVGElement}function GT(r){return r.matches(":focus-visible")}function WT(r){return r!==null}function VT(r){return r instanceof HTMLInputElement&&"select"in r}const XT=new Gn("BitsConfig");function $T(){const r=new KT(null,{});return XT.getOr(r).opts}class KT{opts;constructor(e,t){const n=YT(e,t);this.opts={defaultPortalTo:n(i=>i.defaultPortalTo),defaultLocale:n(i=>i.defaultLocale)}}}function YT(r,e){return t=>fe.with(()=>{const i=t(e)?.current;if(i!==void 0)return i;if(r!==null)return t(r.opts)?.current})}function JT(r,e){return t=>{const n=$T();return fe.with(()=>{const i=t();if(i!==void 0)return i;const a=r(n).current;return a!==void 0?a:e})}}const QT=JT(r=>r.defaultPortalTo,"body");function Ll(r,e){ge(e,!0);const t=QT(()=>e.to),n=Q5();let i=j(a);function a(){if(!Tp||e.disabled)return null;let h=null;return typeof t.current=="string"?h=document.querySelector(t.current):h=t.current,h}let s;function o(){s&&(Tg(s),s=null)}zr([()=>g(i),()=>e.disabled],([h,d])=>{if(!h||d){o();return}return s=i0(jT,{target:h,props:{children:e.children},context:n}),()=>{o()}});var l=J(),c=F(l);{var u=h=>{var d=J(),f=F(d);Te(f,()=>e.children??Re),_(h,d)};ce(c,h=>{e.disabled&&h(u)})}_(r,l),pe()}function gh(r,e,t,n){const i=Array.isArray(e)?e:[e];return i.forEach(a=>r.addEventListener(a,t,n)),()=>{i.forEach(a=>r.removeEventListener(a,t,n))}}class ZT{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){const n=this.createEvent(t);return e.dispatchEvent(n),n}listen(e,t,n){const i=a=>{t(a)};return $r(e,this.eventName,i,n)}}function Mp(r,e=500){let t=null;const n=(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{r(...i)},e)};return n.destroy=()=>{t!==null&&(clearTimeout(t),t=null)},n}function o4(r,e){return r===e||r.contains(e)}function l4(r){return r?.ownerDocument??document}function eI(r,e){const{clientX:t,clientY:n}=r,i=e.getBoundingClientRect();return t<i.left||t>i.right||n<i.top||n>i.bottom}globalThis.bitsDismissableLayers??=new Map;class Op{static create(e){return new Op(e)}opts;#e;#t;#r={pointerdown:!1};#n=!1;#a=!1;#i=void 0;#s;#o=br;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#s=e.onFocusOutside,Ft(()=>{this.#i=l4(this.opts.ref.current)});let t=br;const n=()=>{this.#m(),globalThis.bitsDismissableLayers.delete(this),this.#u.destroy(),t()};zr([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return qc(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#c())}),n}),Lo(()=>{this.#m.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#u.destroy(),this.#o(),t()})}#l=e=>{e.defaultPrevented||this.opts.ref.current&&Ra(()=>{!this.opts.ref.current||this.#d(e.target)||e.target&&!this.#a&&this.#s.current?.(e)})};#c(){return $s($r(this.#i,"pointerdown",$s(this.#g,this.#f),{capture:!0}),$r(this.#i,"pointerdown",$s(this.#p,this.#u)),$r(this.#i,"focusin",this.#l))}#h=e=>{let t=e;t.defaultPrevented&&(t=c4(e)),this.#e.current(e)};#u=Mp(e=>{if(!this.opts.ref.current){this.#o();return}const t=this.opts.isValidEvent.current(e,this.opts.ref.current)||nI(e,this.opts.ref.current);if(!this.#n||this.#y()||!t){this.#o();return}let n=e;if(n.defaultPrevented&&(n=c4(n)),this.#t.current!=="close"&&this.#t.current!=="defer-otherwise-close"){this.#o();return}e.pointerType==="touch"?(this.#o(),this.#o=gh(this.#i,"click",this.#h,{once:!0})):this.#e.current(n)},10);#g=e=>{this.#r[e.type]=!0};#p=e=>{this.#r[e.type]=!1};#f=()=>{this.opts.ref.current&&(this.#n=rI(this.opts.ref.current))};#d=e=>this.opts.ref.current?o4(this.opts.ref.current,e):!1;#m=Mp(()=>{for(const e in this.#r)this.#r[e]=!1;this.#n=!1},20);#y(){return Object.values(this.#r).some(Boolean)}#b=()=>{this.#a=!0};#w=()=>{this.#a=!1};props={onfocuscapture:this.#b,onblurcapture:this.#w}}function tI(r){return r.findLast(([e,{current:t}])=>t==="close"||t==="ignore")}function rI(r){const e=[...globalThis.bitsDismissableLayers],t=tI(e);if(t)return t[0].opts.ref.current===r;const[n]=e[0];return n.opts.ref.current===r}function nI(r,e){if("button"in r&&r.button>0)return!1;const t=r.target;return fh(t)?l4(t).documentElement.contains(t)&&!o4(e,t)&&eI(r,e):!1}function c4(r){const e=r.currentTarget,t=r.target;let n;r instanceof PointerEvent?n=new PointerEvent(r.type,r):n=new PointerEvent("pointerdown",r);let i=!1;return new Proxy(n,{get:(s,o)=>o==="currentTarget"?e:o==="target"?t:o==="preventDefault"?()=>{i=!0,typeof s.preventDefault=="function"&&s.preventDefault()}:o==="defaultPrevented"?i:o in s?s[o]:r[o]})}function Np(r,e){ge(e,!0);let t=L(e,"interactOutsideBehavior",3,"close"),n=L(e,"onInteractOutside",3,br),i=L(e,"onFocusOutside",3,br),a=L(e,"isValidEvent",3,()=>!1);const s=Op.create({id:fe.with(()=>e.id),interactOutsideBehavior:fe.with(()=>t()),onInteractOutside:fe.with(()=>n()),enabled:fe.with(()=>e.enabled),onFocusOutside:fe.with(()=>i()),isValidEvent:fe.with(()=>a()),ref:e.ref});var o=J(),l=F(o);Te(l,()=>e.children??Re,()=>({props:s.props})),_(r,o),pe()}globalThis.bitsEscapeLayers??=new Map;class Rp{static create(e){return new Rp(e)}opts;domContext;constructor(e){this.opts=e,this.domContext=new Bo(this.opts.ref);let t=br;zr(()=>e.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>$r(this.domContext.getDocument(),"keydown",this.#t,{passive:!1});#t=e=>{if(e.key!==ST||!iI(this))return;const t=new KeyboardEvent(e.type,e);e.preventDefault();const n=this.opts.escapeKeydownBehavior.current;n!=="close"&&n!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(t)}}function iI(r){const e=[...globalThis.bitsEscapeLayers],t=e.findLast(([i,{current:a}])=>a==="close"||a==="ignore");if(t)return t[0]===r;const[n]=e[0];return n===r}function Pp(r,e){ge(e,!0);let t=L(e,"escapeKeydownBehavior",3,"close"),n=L(e,"onEscapeKeydown",3,br);Rp.create({escapeKeydownBehavior:fe.with(()=>t()),onEscapeKeydown:fe.with(()=>n()),enabled:fe.with(()=>e.enabled),ref:e.ref});var i=J(),a=F(i);Te(a,()=>e.children??Re),_(r,i),pe()}class Fp{static instance;#e=fe([]);#t=new WeakMap;static getInstance(){return this.instance||(this.instance=new Fp),this.instance}register(e){const t=this.getActive();t&&t!==e&&t.pause(),this.#e.current=this.#e.current.filter(n=>n!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(n=>n!==e);const t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}}/*!
* tabbable 6.2.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/var u4=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],I0=u4.join(","),h4=typeof Element>"u",Bl=h4?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,M0=!h4&&Element.prototype.getRootNode?function(r){var e;return r==null||(e=r.getRootNode)===null||e===void 0?void 0:e.call(r)}:function(r){return r?.ownerDocument},O0=function r(e,t){var n;t===void 0&&(t=!0);var i=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"inert"),a=i===""||i==="true",s=a||t&&e&&r(e.parentNode);return s},aI=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},d4=function(e,t,n){if(O0(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(I0));return t&&Bl.call(e,I0)&&i.unshift(e),i=i.filter(n),i},f4=function r(e,t,n){for(var i=[],a=Array.from(e);a.length;){var s=a.shift();if(!O0(s,!1))if(s.tagName==="SLOT"){var o=s.assignedElements(),l=o.length?o:s.children,c=r(l,!0,n);n.flatten?i.push.apply(i,c):i.push({scopeParent:s,candidates:c})}else{var u=Bl.call(s,I0);u&&n.filter(s)&&(t||!e.includes(s))&&i.push(s);var h=s.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(s),d=!O0(h,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(h&&d){var f=r(h===!0?s.children:h.children,!0,n);n.flatten?i.push.apply(i,f):i.push({scopeParent:s,candidates:f})}else a.unshift.apply(a,s.children)}}return i},g4=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},p4=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||aI(e))&&!g4(e)?0:e.tabIndex},sI=function(e,t){var n=p4(e);return n<0&&t&&!g4(e)?0:n},oI=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},m4=function(e){return e.tagName==="INPUT"},lI=function(e){return m4(e)&&e.type==="hidden"},cI=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},uI=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},hI=function(e){if(!e.name)return!0;var t=e.form||M0(e),n=function(o){return t.querySelectorAll('input[type="radio"][name="'+o+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=n(window.CSS.escape(e.name));else try{i=n(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var a=uI(i,e.form);return!a||a===e},dI=function(e){return m4(e)&&e.type==="radio"},fI=function(e){return dI(e)&&!hI(e)},gI=function(e){var t,n=e&&M0(e),i=(t=n)===null||t===void 0?void 0:t.host,a=!1;if(n&&n!==e){var s,o,l;for(a=!!((s=i)!==null&&s!==void 0&&(o=s.ownerDocument)!==null&&o!==void 0&&o.contains(i)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!a&&i;){var c,u,h;n=M0(i),i=(c=n)===null||c===void 0?void 0:c.host,a=!!((u=i)!==null&&u!==void 0&&(h=u.ownerDocument)!==null&&h!==void 0&&h.contains(i))}}return a},b4=function(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return n===0&&i===0},pI=function(e,t){var n=t.displayCheck,i=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var a=Bl.call(e,"details>summary:first-of-type"),s=a?e.parentElement:e;if(Bl.call(s,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof i=="function"){for(var o=e;e;){var l=e.parentElement,c=M0(e);if(l&&!l.shadowRoot&&i(l)===!0)return b4(e);e.assignedSlot?e=e.assignedSlot:!l&&c!==e.ownerDocument?e=c.host:e=l}e=o}if(gI(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return b4(e);return!1},mI=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var n=0;n<t.children.length;n++){var i=t.children.item(n);if(i.tagName==="LEGEND")return Bl.call(t,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}t=t.parentElement}return!1},N0=function(e,t){return!(t.disabled||O0(t)||lI(t)||pI(t,e)||cI(t)||mI(t))},Dp=function(e,t){return!(fI(t)||p4(t)<0||!N0(e,t))},bI=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},vI=function r(e){var t=[],n=[];return e.forEach(function(i,a){var s=!!i.scopeParent,o=s?i.scopeParent:i,l=sI(o,s),c=s?r(i.candidates):o;l===0?s?t.push.apply(t,c):t.push(o):n.push({documentOrder:a,tabIndex:l,item:i,isScope:s,content:c})}),n.sort(oI).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(t)},v4=function(e,t){t=t||{};var n;return t.getShadowRoot?n=f4([e],t.includeContainer,{filter:Dp.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:bI}):n=d4(e,t.includeContainer,Dp.bind(null,t)),vI(n)},y4=function(e,t){t=t||{};var n;return t.getShadowRoot?n=f4([e],t.includeContainer,{filter:N0.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):n=d4(e,t.includeContainer,N0.bind(null,t)),n},Lp=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Bl.call(e,I0)===!1?!1:Dp(t,e)},yI=u4.concat("iframe").join(","),w4=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Bl.call(e,yI)===!1?!1:N0(t,e)};class Bp{#e=!1;#t=null;#r=Fp.getInstance();#n=[];#a;constructor(e){this.#a=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#i(){for(const e of this.#n)e();this.#n=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#r.register(this),this.#l(),this.#s()}unmount(){this.#t&&(this.#i(),this.#o(),this.#r.unregister(this),this.#t=null)}#s(){if(!this.#t)return;const e=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#a.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;const t=this.#h();t?(t.focus(),this.#r.setFocusMemory(this,t)):this.#t.focus()})}#o(){const e=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#a.onCloseAutoFocus.current(e),!e.defaultPrevented){const t=document.activeElement;t&&t!==document.body&&t.focus()}}#l(){if(!this.#t||!this.#a.trap.current)return;const e=this.#t,t=e.ownerDocument,n=s=>{if(this.#e||!this.#r.isActiveScope(this))return;const o=s.target;if(!o)return;if(e.contains(o))this.#r.setFocusMemory(this,o);else{const c=this.#r.getFocusMemory(this);if(c&&e.contains(c)&&w4(c))s.preventDefault(),c.focus();else{const u=this.#h(),h=this.#u()[0];(u||h||e).focus()}}},i=s=>{if(!this.#a.loop||this.#e||s.key!=="Tab"||!this.#r.isActiveScope(this))return;const o=this.#c();if(o.length<2)return;const l=o[0],c=o[o.length-1];!s.shiftKey&&t.activeElement===c?(s.preventDefault(),l.focus()):s.shiftKey&&t.activeElement===l&&(s.preventDefault(),c.focus())};this.#n.push($r(t,"focusin",n,{capture:!0}),$r(e,"keydown",i));const a=new MutationObserver(()=>{const s=this.#r.getFocusMemory(this);if(s&&!e.contains(s)){const o=this.#h(),l=this.#u()[0],c=o||l;c?(c.focus(),this.#r.setFocusMemory(this,c)):e.focus()}});a.observe(e,{childList:!0,subtree:!0}),this.#n.push(()=>a.disconnect())}#c(){return this.#t?v4(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#h(){return this.#c()[0]||null}#u(){return this.#t?y4(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(e){let t=null;return zr([()=>e.ref.current,()=>e.enabled.current],([n,i])=>{n&&i?(t||(t=new Bp(e)),t.mount(n)):t&&(t.unmount(),t=null)}),Lo(()=>{t?.unmount()}),{get props(){return{tabindex:-1}}}}}function Up(r,e){ge(e,!0);let t=L(e,"enabled",3,!1),n=L(e,"trapFocus",3,!1),i=L(e,"loop",3,!1),a=L(e,"onCloseAutoFocus",3,br),s=L(e,"onOpenAutoFocus",3,br);const o=Bp.use({enabled:fe.with(()=>t()),trap:fe.with(()=>n()),loop:i(),onCloseAutoFocus:fe.with(()=>a()),onOpenAutoFocus:fe.with(()=>s()),ref:e.ref});var l=J(),c=F(l);Te(c,()=>e.focusScope??Re,()=>({props:o.props})),_(r,l),pe()}globalThis.bitsTextSelectionLayers??=new Map;class zp{static create(e){return new zp(e)}opts;domContext;#e=br;constructor(e){this.opts=e,this.domContext=new Bo(e.ref);let t=br;zr(()=>this.opts.enabled.current,n=>(n&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#t()),()=>{t(),this.#n(),globalThis.bitsTextSelectionLayers.delete(this)}))}#t(){return $s($r(this.domContext.getDocument(),"pointerdown",this.#r),$r(this.domContext.getDocument(),"pointerup",Vv(this.#n,this.opts.onPointerUp.current)))}#r=e=>{const t=this.opts.ref.current,n=e.target;!qo(t)||!qo(n)||!this.opts.enabled.current||!xI(this)||!fT(t,n)||(this.opts.onPointerDown.current(e),!e.defaultPrevented&&(this.#e=wI(t,this.domContext.getDocument().body)))};#n=()=>{this.#e(),this.#e=br}}const x4=r=>r.style.userSelect||r.style.webkitUserSelect;function wI(r,e){const t=x4(e),n=x4(r);return R0(e,"none"),R0(r,"text"),()=>{R0(e,t),R0(r,n)}}function R0(r,e){r.style.userSelect=e,r.style.webkitUserSelect=e}function xI(r){const e=[...globalThis.bitsTextSelectionLayers];if(!e.length)return!1;const t=e.at(-1);return t?t[0]===r:!1}function jp(r,e){ge(e,!0);let t=L(e,"preventOverflowTextSelection",3,!0),n=L(e,"onPointerDown",3,br),i=L(e,"onPointerUp",3,br);zp.create({id:fe.with(()=>e.id),onPointerDown:fe.with(()=>n()),onPointerUp:fe.with(()=>i()),enabled:fe.with(()=>e.enabled&&t()),ref:e.ref});var a=J(),s=F(a);Te(s,()=>e.children??Re),_(r,a),pe()}globalThis.bitsIdCounter??={current:0};function Gc(r="bits"){return globalThis.bitsIdCounter.current++,`${r}-${globalThis.bitsIdCounter.current}`}class SI{#e;#t=0;#r=oe();#n;constructor(e){this.#e=e}#a(){this.#t-=1,this.#n&&this.#t<=0&&(this.#n(),O(this.#r,void 0),this.#n=void 0)}get(...e){return this.#t+=1,g(this.#r)===void 0&&(this.#n=qu(()=>{O(this.#r,this.#e(...e),!0)})),Ft(()=>()=>{this.#a()}),g(this.#r)}}const kI=new SI(()=>{const r=new hp,e=j(()=>{for(const a of r.values())if(a)return!0;return!1});let t=oe(null),n=null;function i(){Tp&&(document.body.setAttribute("style",g(t)??""),document.body.style.removeProperty("--scrollbar-width"),Ip&&n?.())}return zr(()=>g(e),()=>{if(!g(e))return;O(t,document.body.getAttribute("style"),!0);const a=getComputedStyle(document.body),s=window.innerWidth-document.documentElement.clientWidth,l={padding:Number.parseInt(a.paddingRight??"0",10)+s,margin:Number.parseInt(a.marginRight??"0",10)};s>0&&(document.body.style.paddingRight=`${l.padding}px`,document.body.style.marginRight=`${l.margin}px`,document.body.style.setProperty("--scrollbar-width",`${s}px`),document.body.style.overflow="hidden"),Ip&&(n=gh(document,"touchmove",c=>{c.target===document.documentElement&&(c.touches.length>1||c.preventDefault())},{passive:!1})),Ra(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),Lo(()=>()=>{n?.()}),{get map(){return r},resetBodyStyle:i}});class AI{#e=Gc();#t;#r=()=>null;#n;locked;constructor(e,t=()=>null){this.#t=e,this.#r=t,this.#n=kI.get(),this.#n&&(this.#n.map.set(this.#e,this.#t??!1),this.locked=fe.with(()=>this.#n.map.get(this.#e)??!1,n=>this.#n.map.set(this.#e,n)),Lo(()=>{if(this.#n.map.delete(this.#e),_I(this.#n.map))return;const n=this.#r();n===null?requestAnimationFrame(()=>this.#n.resetBodyStyle()):qc(n,()=>this.#n.resetBodyStyle())}))}}function _I(r){for(const[e,t]of r)if(t)return!0;return!1}function Wc(r,e){ge(e,!0);let t=L(e,"preventScroll",3,!0),n=L(e,"restoreScrollDelay",3,null);t()&&new AI(t(),()=>n()),pe()}function S4({forceMount:r,present:e,open:t}){return(r||e)&&t}var CI=ee("<!> <!>",1),EI=ee("<!> <div><!></div>",1);function TI(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"forceMount",3,!1),s=L(e,"interactOutsideBehavior",3,"ignore"),o=L(e,"onCloseAutoFocus",3,br),l=L(e,"onEscapeKeydown",3,br),c=L(e,"onOpenAutoFocus",3,br),u=L(e,"onInteractOutside",3,br),h=L(e,"preventScroll",3,!0),d=L(e,"trapFocus",3,!0),f=L(e,"restoreScrollDelay",3,null),p=De(e,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","interactOutsideBehavior","onCloseAutoFocus","onEscapeKeydown","onOpenAutoFocus","onInteractOutside","preventScroll","trapFocus","restoreScrollDelay"]);const m=T0.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),v=>i(v))}),y=j(()=>rr(p,m.props));{const v=S=>{{const A=(k,I)=>{let R=()=>I?.().props;Pp(k,$e(()=>g(y),{get enabled(){return m.root.opts.open.current},get ref(){return m.opts.ref},onEscapeKeydown:U=>{l()(U),!U.defaultPrevented&&m.root.handleClose()},children:(U,D)=>{Np(U,$e(()=>g(y),{get ref(){return m.opts.ref},get enabled(){return m.root.opts.open.current},get interactOutsideBehavior(){return s()},onInteractOutside:$=>{u()($),!$.defaultPrevented&&m.root.handleClose()},children:($,H)=>{jp($,$e(()=>g(y),{get ref(){return m.opts.ref},get enabled(){return m.root.opts.open.current},children:(V,z)=>{var Z=J(),q=F(Z);{var re=ie=>{var P=CI(),be=F(P);{var _e=me=>{Wc(me,{get preventScroll(){return h()},get restoreScrollDelay(){return f()}})};ce(be,me=>{m.root.opts.open.current&&me(_e)})}var W=ae(be,2);{let me=j(()=>({props:rr(g(y),R()),...m.snippetProps}));Te(W,()=>e.child,()=>g(me))}_(ie,P)},X=ie=>{var P=EI(),be=F(P);Wc(be,{get preventScroll(){return h()}});var _e=ae(be,2);Lt(_e,me=>({...me}),[()=>rr(g(y),R())]);var W=te(_e);Te(W,()=>e.children??Re),Q(_e),_(ie,P)};ce(q,ie=>{e.child?ie(re):ie(X,!1)})}_(V,Z)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))};let C=j(()=>S4({forceMount:a(),present:m.root.opts.open.current,open:m.root.opts.open.current}));Up(S,{get ref(){return m.opts.ref},loop:!0,get trapFocus(){return d()},get enabled(){return g(C)},onCloseAutoFocus:k=>{o()(k),!k.defaultPrevented&&qc(0,()=>m.root.triggerNode?.focus())},onOpenAutoFocus:k=>{c()(k),!k.defaultPrevented&&(k.preventDefault(),qc(0,()=>m.opts.ref.current?.focus()))},focusScope:A,$$slots:{focusScope:!0}})}};let x=j(()=>m.root.opts.open.current||a());Ys(r,{get forceMount(){return a()},get open(){return g(x)},get ref(){return m.opts.ref},presence:v,$$slots:{presence:!0}})}pe()}var II=ee("<div><!></div>");function Hp(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"forceMount",3,!1),a=L(e,"ref",15,null),s=De(e,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const o=_p.create({id:fe.with(()=>n()),ref:fe.with(()=>a(),c=>a(c))}),l=j(()=>rr(s,o.props));{const c=h=>{var d=J(),f=F(d);{var p=y=>{var v=J(),x=F(v);{let S=j(()=>({props:rr(g(l)),...o.snippetProps}));Te(x,()=>e.child,()=>g(S))}_(y,v)},m=y=>{var v=II();Lt(v,S=>({...S}),[()=>rr(g(l))]);var x=te(v);Te(x,()=>e.children??Re,()=>o.snippetProps),Q(v),_(y,v)};ce(f,y=>{e.child?y(p):y(m,!1)})}_(h,d)};let u=j(()=>o.root.opts.open.current||i());Ys(r,{get open(){return g(u)},get ref(){return o.opts.ref},presence:c,$$slots:{presence:!0}})}pe()}var MI=ee("<div><!></div>");function qp(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=De(e,["$$slots","$$events","$$legacy","id","children","child","ref"]);const s=Ap.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),d=>i(d))}),o=j(()=>rr(a,s.props));var l=J(),c=F(l);{var u=d=>{var f=J(),p=F(f);Te(p,()=>e.child,()=>({props:g(o)})),_(d,f)},h=d=>{var f=MI();Lt(f,()=>({...g(o)}));var p=te(f);Te(p,()=>e.children??Re),Q(f),_(d,f)};ce(c,d=>{e.child?d(u):d(h,!1)})}_(r,l),pe()}function OI(r,e,t=!0){if(!(r.length===0||e<0||e>=r.length))return r.length===1&&e===0?r[0]:e===r.length-1?t?r[0]:void 0:r[e+1]}function NI(r,e,t=!0){if(!(r.length===0||e<0||e>=r.length))return r.length===1&&e===0?r[0]:e===0?t?r[r.length-1]:void 0:r[e-1]}function RI(r,e,t,n=!0){if(r.length===0||e<0||e>=r.length)return;let i=e+t;return n?i=(i%r.length+r.length)%r.length:i=Math.max(0,Math.min(i,r.length-1)),r[i]}function PI(r,e,t,n=!0){if(r.length===0||e<0||e>=r.length)return;let i=e-t;return n?i=(i%r.length+r.length)%r.length:i=Math.max(0,Math.min(i,r.length-1)),r[i]}function Gp(r,e,t){const n=e.toLowerCase();if(n.endsWith(" ")){const h=n.slice(0,-1);if(r.filter(m=>m.toLowerCase().startsWith(h)).length<=1)return Gp(r,h,t);const f=t?.toLowerCase();if(f&&f.startsWith(h)&&f.charAt(h.length)===" "&&e.trim()===h)return t;const p=r.filter(m=>m.toLowerCase().startsWith(n));if(p.length>0){const m=t?r.indexOf(t):-1;return k4(p,Math.max(m,0)).find(x=>x!==t)||t}}const a=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,s=a.toLowerCase(),o=t?r.indexOf(t):-1;let l=k4(r,Math.max(o,0));a.length===1&&(l=l.filter(h=>h!==t));const u=l.find(h=>h?.toLowerCase().startsWith(s));return u!==t?u:void 0}function k4(r,e){return r.map((t,n)=>r[(e+n)%r.length])}const FI=zo({component:"checkbox",parts:["root","group","group-label","input"]}),DI=new Gn("Checkbox.Group"),A4=new Gn("Checkbox.Root");class Wp{static create(e,t=null){return A4.set(new Wp(e,t))}opts;group;#e=j(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return g(this.#e)}set trueName(e){O(this.#e,e)}#t=j(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return g(this.#t)}set trueRequired(e){O(this.#t,e)}#r=j(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return g(this.#r)}set trueDisabled(e){O(this.#r,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=rn(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),zr.pre([()=>zd(this.group?.opts.value.current),()=>this.opts.value.current],([n,i])=>{!n||!i||(this.opts.checked.current=n.includes(i))}),zr.pre(()=>this.opts.checked.current,n=>{this.group&&(n?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){this.opts.disabled.current||(e.key===jo&&e.preventDefault(),e.key===gs&&(e.preventDefault(),this.#n()))}#n(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){this.opts.disabled.current||this.#n()}#a=j(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return g(this.#a)}set snippetProps(e){O(this.#a,e)}#i=j(()=>({id:this.opts.id.current,role:"checkbox",type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":bT(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":mT(this.trueRequired),"data-disabled":hs(this.trueDisabled),"data-state":LI(this.opts.checked.current,this.opts.indeterminate.current),[FI.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return g(this.#i)}set props(e){O(this.#i,e)}}class Vp{static create(){return new Vp(A4.get())}root;#e=j(()=>this.root.group?!!(this.root.opts.value.current!==void 0&&this.root.group.opts.value.current.includes(this.root.opts.value.current)):this.root.opts.checked.current);get trueChecked(){return g(this.#e)}set trueChecked(e){O(this.#e,e)}#t=j(()=>!!this.root.trueName);get shouldRender(){return g(this.#t)}set shouldRender(e){O(this.#t,e)}constructor(e){this.root=e}#r=j(()=>({type:"checkbox",checked:this.root.opts.checked.current===!0,disabled:this.root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current}));get props(){return g(this.#r)}set props(e){O(this.#r,e)}}function LI(r,e){return e?"indeterminate":r?"checked":"unchecked"}WA();var BI=ee("<input/>"),UI=ee("<input/>");function _4(r,e){ge(e,!0);let t=L(e,"value",15),n=De(e,["$$slots","$$events","$$legacy","value"]);const i=j(()=>rr(n,{"aria-hidden":"true",tabindex:-1,style:XE}));var a=J(),s=F(a);{var o=c=>{var u=BI();a0(u),Lt(u,()=>({...g(i),value:t()})),_(c,u)},l=c=>{var u=UI();a0(u),Lt(u,()=>({...g(i)})),Nl(u,t),_(c,u)};ce(s,c=>{g(i).type==="checkbox"?c(o):c(l,!1)})}_(r,a),pe()}function zI(r,e){ge(e,!1);const t=Vp.create();V_();var n=J(),i=F(n);{var a=s=>{_4(s,$e(()=>t.props))};ce(i,s=>{t.shouldRender&&s(a)})}_(r,n),pe()}var jI=ee("<button><!></button>"),HI=ee("<!> <!>",1);function qI(r,e){const t=un();ge(e,!0);let n=L(e,"checked",15,!1),i=L(e,"ref",15,null),a=L(e,"disabled",3,!1),s=L(e,"required",3,!1),o=L(e,"name",3,void 0),l=L(e,"value",3,"on"),c=L(e,"id",19,()=>hn(t)),u=L(e,"indeterminate",15,!1),h=L(e,"type",3,"button"),d=De(e,["$$slots","$$events","$$legacy","checked","ref","onCheckedChange","children","disabled","required","name","value","id","indeterminate","onIndeterminateChange","child","type"]);const f=DI.getOr(null);f&&l()&&(f.opts.value.current.includes(l())?n(!0):n(!1)),zr.pre(()=>l(),()=>{f&&l()&&(f.opts.value.current.includes(l())?n(!0):n(!1))});const p=Wp.create({checked:fe.with(()=>n(),C=>{n(C),e.onCheckedChange?.(C)}),disabled:fe.with(()=>a()??!1),required:fe.with(()=>s()),name:fe.with(()=>o()),value:fe.with(()=>l()),id:fe.with(()=>c()),ref:fe.with(()=>i(),C=>i(C)),indeterminate:fe.with(()=>u(),C=>{u(C),e.onIndeterminateChange?.(C)}),type:fe.with(()=>h())},f),m=j(()=>rr({...d},p.props));var y=HI(),v=F(y);{var x=C=>{var k=J(),I=F(k);{let R=j(()=>({props:g(m),...p.snippetProps}));Te(I,()=>e.child,()=>g(R))}_(C,k)},S=C=>{var k=jI();Lt(k,()=>({...g(m)}));var I=te(k);Te(I,()=>e.children??Re,()=>p.snippetProps),Q(k),_(C,k)};ce(v,C=>{e.child?C(x):C(S,!1)})}var A=ae(v,2);zI(A,{}),_(r,y),pe()}const Xp=zo({component:"collapsible",parts:["root","content","trigger"]}),$p=new Gn("Collapsible.Root");class Kp{static create(e){return $p.set(new Kp(e))}opts;attachment;#e=oe(null);get contentNode(){return g(this.#e)}set contentNode(e){O(this.#e,e,!0)}#t=oe(void 0);get contentId(){return g(this.#t)}set contentId(e){O(this.#t,e,!0)}constructor(e){this.opts=e,this.toggleOpen=this.toggleOpen.bind(this),this.attachment=rn(this.opts.ref),new dh({ref:fe.with(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}})}toggleOpen(){this.opts.open.current=!this.opts.open.current}#r=j(()=>({id:this.opts.id.current,"data-state":Uo(this.opts.open.current),"data-disabled":hs(this.opts.disabled.current),[Xp.root]:"",...this.attachment}));get props(){return g(this.#r)}set props(e){O(this.#r,e)}}class Yp{static create(e){return new Yp(e,$p.get())}opts;root;attachment;#e=j(()=>this.opts.forceMount.current||this.root.opts.open.current);get present(){return g(this.#e)}set present(e){O(this.#e,e)}#t;#r=oe(!1);#n=oe(0);#a=oe(0);constructor(e,t){this.opts=e,this.root=t,O(this.#r,t.opts.open.current,!0),this.root.contentId=this.opts.id.current,this.attachment=rn(this.opts.ref,n=>this.root.contentNode=n),zr.pre(()=>this.opts.id.current,n=>{this.root.contentId=n}),yi(()=>{const n=requestAnimationFrame(()=>{O(this.#r,!1)});return()=>{cancelAnimationFrame(n)}}),zr([()=>this.opts.ref.current,()=>this.present],([n])=>{n&&Ra(()=>{if(!this.opts.ref.current)return;this.#t=this.#t||{transitionDuration:n.style.transitionDuration,animationName:n.style.animationName},n.style.transitionDuration="0s",n.style.animationName="none";const i=n.getBoundingClientRect();if(O(this.#a,i.height,!0),O(this.#n,i.width,!0),!g(this.#r)){const{animationName:a,transitionDuration:s}=this.#t;n.style.transitionDuration=s,n.style.animationName=a}})})}#i=j(()=>({open:this.root.opts.open.current}));get snippetProps(){return g(this.#i)}set snippetProps(e){O(this.#i,e)}#s=j(()=>({id:this.opts.id.current,style:{"--bits-collapsible-content-height":g(this.#a)?`${g(this.#a)}px`:void 0,"--bits-collapsible-content-width":g(this.#n)?`${g(this.#n)}px`:void 0},"data-state":Uo(this.root.opts.open.current),"data-disabled":hs(this.root.opts.disabled.current),[Xp.content]:"",...this.attachment}));get props(){return g(this.#s)}set props(e){O(this.#s,e)}}class Jp{static create(e){return new Jp(e,$p.get())}opts;root;attachment;#e=j(()=>this.opts.disabled.current||this.root.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){if(!g(this.#e)){if(e.button!==0)return e.preventDefault();this.root.toggleOpen()}}onkeydown(e){g(this.#e)||(e.key===gs||e.key===jo)&&(e.preventDefault(),this.root.toggleOpen())}#t=j(()=>({id:this.opts.id.current,type:"button",disabled:g(this.#e),"aria-controls":this.root.contentId,"aria-expanded":pp(this.root.opts.open.current),"data-state":Uo(this.root.opts.open.current),"data-disabled":hs(g(this.#e)),[Xp.trigger]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}var GI=ee("<div><!></div>");function WI(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"open",15,!1),s=L(e,"disabled",3,!1),o=L(e,"onOpenChange",3,br),l=L(e,"onOpenChangeComplete",3,br),c=De(e,["$$slots","$$events","$$legacy","children","child","id","ref","open","disabled","onOpenChange","onOpenChangeComplete"]);const u=Kp.create({open:fe.with(()=>a(),y=>{a(y),o()(y)}),disabled:fe.with(()=>s()),id:fe.with(()=>n()),ref:fe.with(()=>i(),y=>i(y)),onOpenChangeComplete:fe.with(()=>l())}),h=j(()=>rr(c,u.props));var d=J(),f=F(d);{var p=y=>{var v=J(),x=F(v);Te(x,()=>e.child,()=>({props:g(h)})),_(y,v)},m=y=>{var v=GI();Lt(v,()=>({...g(h)}));var x=te(v);Te(x,()=>e.children??Re),Q(v),_(y,v)};ce(f,y=>{e.child?y(p):y(m,!1)})}_(r,d),pe()}var VI=ee("<div><!></div>");function XI(r,e){const t=un();ge(e,!0);let n=L(e,"ref",15,null),i=L(e,"forceMount",3,!1),a=L(e,"id",19,()=>hn(t)),s=De(e,["$$slots","$$events","$$legacy","child","ref","forceMount","children","id"]);const o=Yp.create({id:fe.with(()=>a()),forceMount:fe.with(()=>i()),ref:fe.with(()=>n(),l=>n(l))});Ys(r,{forceMount:!0,get open(){return o.present},get ref(){return o.opts.ref},presence:(c,u)=>{let h=()=>u?.().present;var d=J();const f=j(()=>rr(s,o.props,{hidden:i()?void 0:!h()}));var p=F(d);{var m=v=>{var x=J(),S=F(x);{let A=j(()=>({...o.snippetProps,props:g(f)}));Te(S,()=>e.child,()=>g(A))}_(v,x)},y=v=>{var x=VI();Lt(x,()=>({...g(f)}));var S=te(x);Te(S,()=>e.children??Re),Q(x),_(v,x)};ce(p,v=>{e.child?v(m):v(y,!1)})}_(c,d)},$$slots:{presence:!0}}),pe()}var $I=ee("<button><!></button>");function KI(r,e){const t=un();ge(e,!0);let n=L(e,"ref",15,null),i=L(e,"id",19,()=>hn(t)),a=L(e,"disabled",3,!1),s=De(e,["$$slots","$$events","$$legacy","children","child","ref","id","disabled"]);const o=Jp.create({id:fe.with(()=>i()),ref:fe.with(()=>n(),f=>n(f)),disabled:fe.with(()=>a())}),l=j(()=>rr(s,o.props));var c=J(),u=F(c);{var h=f=>{var p=J(),m=F(p);Te(m,()=>e.child,()=>({props:g(l)})),_(f,p)},d=f=>{var p=$I();Lt(p,()=>({...g(l)}));var m=te(p);Te(m,()=>e.children??Re),Q(p),_(f,p)};ce(u,f=>{e.child?f(h):f(d,!1)})}_(r,c),pe()}const YI=["top","right","bottom","left"],Go=Math.min,fa=Math.max,P0=Math.round,F0=Math.floor,ps=r=>({x:r,y:r}),JI={left:"right",right:"left",bottom:"top",top:"bottom"},QI={start:"end",end:"start"};function Qp(r,e,t){return fa(r,Go(e,t))}function Js(r,e){return typeof r=="function"?r(e):r}function Qs(r){return r.split("-")[0]}function Vc(r){return r.split("-")[1]}function Zp(r){return r==="x"?"y":"x"}function em(r){return r==="y"?"height":"width"}const ZI=new Set(["top","bottom"]);function ms(r){return ZI.has(Qs(r))?"y":"x"}function tm(r){return Zp(ms(r))}function eM(r,e,t){t===void 0&&(t=!1);const n=Vc(r),i=tm(r),a=em(i);let s=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=D0(s)),[s,D0(s)]}function tM(r){const e=D0(r);return[rm(r),e,rm(e)]}function rm(r){return r.replace(/start|end/g,e=>QI[e])}const C4=["left","right"],E4=["right","left"],rM=["top","bottom"],nM=["bottom","top"];function iM(r,e,t){switch(r){case"top":case"bottom":return t?e?E4:C4:e?C4:E4;case"left":case"right":return e?rM:nM;default:return[]}}function aM(r,e,t,n){const i=Vc(r);let a=iM(Qs(r),t==="start",n);return i&&(a=a.map(s=>s+"-"+i),e&&(a=a.concat(a.map(rm)))),a}function D0(r){return r.replace(/left|right|bottom|top/g,e=>JI[e])}function sM(r){return{top:0,right:0,bottom:0,left:0,...r}}function T4(r){return typeof r!="number"?sM(r):{top:r,right:r,bottom:r,left:r}}function L0(r){const{x:e,y:t,width:n,height:i}=r;return{width:n,height:i,top:t,left:e,right:e+n,bottom:t+i,x:e,y:t}}function I4(r,e,t){let{reference:n,floating:i}=r;const a=ms(e),s=tm(e),o=em(s),l=Qs(e),c=a==="y",u=n.x+n.width/2-i.width/2,h=n.y+n.height/2-i.height/2,d=n[o]/2-i[o]/2;let f;switch(l){case"top":f={x:u,y:n.y-i.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:h};break;case"left":f={x:n.x-i.width,y:h};break;default:f={x:n.x,y:n.y}}switch(Vc(e)){case"start":f[s]-=d*(t&&c?-1:1);break;case"end":f[s]+=d*(t&&c?-1:1);break}return f}const oM=async(r,e,t)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:s}=t,o=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:r,floating:e,strategy:i}),{x:u,y:h}=I4(c,n,l),d=n,f={},p=0;for(let m=0;m<o.length;m++){const{name:y,fn:v}=o[m],{x,y:S,data:A,reset:C}=await v({x:u,y:h,initialPlacement:n,placement:d,strategy:i,middlewareData:f,rects:c,platform:s,elements:{reference:r,floating:e}});u=x??u,h=S??h,f={...f,[y]:{...f[y],...A}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:r,floating:e,strategy:i}):C.rects),{x:u,y:h}=I4(c,d,l)),m=-1)}return{x:u,y:h,placement:d,strategy:i,middlewareData:f}};async function ph(r,e){var t;e===void 0&&(e={});const{x:n,y:i,platform:a,rects:s,elements:o,strategy:l}=r,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:f=0}=Js(e,r),p=T4(f),y=o[d?h==="floating"?"reference":"floating":h],v=L0(await a.getClippingRect({element:(t=await(a.isElement==null?void 0:a.isElement(y)))==null||t?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:c,rootBoundary:u,strategy:l})),x=h==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),A=await(a.isElement==null?void 0:a.isElement(S))?await(a.getScale==null?void 0:a.getScale(S))||{x:1,y:1}:{x:1,y:1},C=L0(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:x,offsetParent:S,strategy:l}):x);return{top:(v.top-C.top+p.top)/A.y,bottom:(C.bottom-v.bottom+p.bottom)/A.y,left:(v.left-C.left+p.left)/A.x,right:(C.right-v.right+p.right)/A.x}}const lM=r=>({name:"arrow",options:r,async fn(e){const{x:t,y:n,placement:i,rects:a,platform:s,elements:o,middlewareData:l}=e,{element:c,padding:u=0}=Js(r,e)||{};if(c==null)return{};const h=T4(u),d={x:t,y:n},f=tm(i),p=em(f),m=await s.getDimensions(c),y=f==="y",v=y?"top":"left",x=y?"bottom":"right",S=y?"clientHeight":"clientWidth",A=a.reference[p]+a.reference[f]-d[f]-a.floating[p],C=d[f]-a.reference[f],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let I=k?k[S]:0;(!I||!await(s.isElement==null?void 0:s.isElement(k)))&&(I=o.floating[S]||a.floating[p]);const R=A/2-C/2,U=I/2-m[p]/2-1,D=Go(h[v],U),$=Go(h[x],U),H=D,V=I-m[p]-$,z=I/2-m[p]/2+R,Z=Qp(H,z,V),q=!l.arrow&&Vc(i)!=null&&z!==Z&&a.reference[p]/2-(z<H?D:$)-m[p]/2<0,re=q?z<H?z-H:z-V:0;return{[f]:d[f]+re,data:{[f]:Z,centerOffset:z-Z-re,...q&&{alignmentOffset:re}},reset:q}}}),cM=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(e){var t,n;const{placement:i,middlewareData:a,rects:s,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=Js(r,e);if((t=a.arrow)!=null&&t.alignmentOffset)return{};const v=Qs(i),x=ms(o),S=Qs(o)===o,A=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=d||(S||!m?[D0(o)]:tM(o)),k=p!=="none";!d&&k&&C.push(...aM(o,m,p,A));const I=[o,...C],R=await ph(e,y),U=[];let D=((n=a.flip)==null?void 0:n.overflows)||[];if(u&&U.push(R[v]),h){const z=eM(i,s,A);U.push(R[z[0]],R[z[1]])}if(D=[...D,{placement:i,overflows:U}],!U.every(z=>z<=0)){var $,H;const z=((($=a.flip)==null?void 0:$.index)||0)+1,Z=I[z];if(Z&&(!(h==="alignment"?x!==ms(Z):!1)||D.every(X=>X.overflows[0]>0&&ms(X.placement)===x)))return{data:{index:z,overflows:D},reset:{placement:Z}};let q=(H=D.filter(re=>re.overflows[0]<=0).sort((re,X)=>re.overflows[1]-X.overflows[1])[0])==null?void 0:H.placement;if(!q)switch(f){case"bestFit":{var V;const re=(V=D.filter(X=>{if(k){const ie=ms(X.placement);return ie===x||ie==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(ie=>ie>0).reduce((ie,P)=>ie+P,0)]).sort((X,ie)=>X[1]-ie[1])[0])==null?void 0:V[0];re&&(q=re);break}case"initialPlacement":q=o;break}if(i!==q)return{reset:{placement:q}}}return{}}}};function M4(r,e){return{top:r.top-e.height,right:r.right-e.width,bottom:r.bottom-e.height,left:r.left-e.width}}function O4(r){return YI.some(e=>r[e]>=0)}const uM=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(e){const{rects:t}=e,{strategy:n="referenceHidden",...i}=Js(r,e);switch(n){case"referenceHidden":{const a=await ph(e,{...i,elementContext:"reference"}),s=M4(a,t.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:O4(s)}}}case"escaped":{const a=await ph(e,{...i,altBoundary:!0}),s=M4(a,t.floating);return{data:{escapedOffsets:s,escaped:O4(s)}}}default:return{}}}}},N4=new Set(["left","top"]);async function hM(r,e){const{placement:t,platform:n,elements:i}=r,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=Qs(t),o=Vc(t),l=ms(t)==="y",c=N4.has(s)?-1:1,u=a&&l?-1:1,h=Js(e,r);let{mainAxis:d,crossAxis:f,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&typeof p=="number"&&(f=o==="end"?p*-1:p),l?{x:f*u,y:d*c}:{x:d*c,y:f*u}}const dM=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(e){var t,n;const{x:i,y:a,placement:s,middlewareData:o}=e,l=await hM(e,r);return s===((t=o.offset)==null?void 0:t.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:s}}}}},fM=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(e){const{x:t,y:n,placement:i}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:o={fn:y=>{let{x:v,y:x}=y;return{x:v,y:x}}},...l}=Js(r,e),c={x:t,y:n},u=await ph(e,l),h=ms(Qs(i)),d=Zp(h);let f=c[d],p=c[h];if(a){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",x=f+u[y],S=f-u[v];f=Qp(x,f,S)}if(s){const y=h==="y"?"top":"left",v=h==="y"?"bottom":"right",x=p+u[y],S=p-u[v];p=Qp(x,p,S)}const m=o.fn({...e,[d]:f,[h]:p});return{...m,data:{x:m.x-t,y:m.y-n,enabled:{[d]:a,[h]:s}}}}}},gM=function(r){return r===void 0&&(r={}),{options:r,fn(e){const{x:t,y:n,placement:i,rects:a,middlewareData:s}=e,{offset:o=0,mainAxis:l=!0,crossAxis:c=!0}=Js(r,e),u={x:t,y:n},h=ms(i),d=Zp(h);let f=u[d],p=u[h];const m=Js(o,e),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const S=d==="y"?"height":"width",A=a.reference[d]-a.floating[S]+y.mainAxis,C=a.reference[d]+a.reference[S]-y.mainAxis;f<A?f=A:f>C&&(f=C)}if(c){var v,x;const S=d==="y"?"width":"height",A=N4.has(Qs(i)),C=a.reference[h]-a.floating[S]+(A&&((v=s.offset)==null?void 0:v[h])||0)+(A?0:y.crossAxis),k=a.reference[h]+a.reference[S]+(A?0:((x=s.offset)==null?void 0:x[h])||0)-(A?y.crossAxis:0);p<C?p=C:p>k&&(p=k)}return{[d]:f,[h]:p}}}},pM=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(e){var t,n;const{placement:i,rects:a,platform:s,elements:o}=e,{apply:l=()=>{},...c}=Js(r,e),u=await ph(e,c),h=Qs(i),d=Vc(i),f=ms(i)==="y",{width:p,height:m}=a.floating;let y,v;h==="top"||h==="bottom"?(y=h,v=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(v=h,y=d==="end"?"top":"bottom");const x=m-u.top-u.bottom,S=p-u.left-u.right,A=Go(m-u[y],x),C=Go(p-u[v],S),k=!e.middlewareData.shift;let I=A,R=C;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(R=S),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(I=x),k&&!d){const D=fa(u.left,0),$=fa(u.right,0),H=fa(u.top,0),V=fa(u.bottom,0);f?R=p-2*(D!==0||$!==0?D+$:fa(u.left,u.right)):I=m-2*(H!==0||V!==0?H+V:fa(u.top,u.bottom))}await l({...e,availableWidth:R,availableHeight:I});const U=await s.getDimensions(o.floating);return p!==U.width||m!==U.height?{reset:{rects:!0}}:{}}}};function B0(){return typeof window<"u"}function Xc(r){return R4(r)?(r.nodeName||"").toLowerCase():"#document"}function ga(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function bs(r){var e;return(e=(R4(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function R4(r){return B0()?r instanceof Node||r instanceof ga(r).Node:!1}function Ja(r){return B0()?r instanceof Element||r instanceof ga(r).Element:!1}function vs(r){return B0()?r instanceof HTMLElement||r instanceof ga(r).HTMLElement:!1}function P4(r){return!B0()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof ga(r).ShadowRoot}const mM=new Set(["inline","contents"]);function mh(r){const{overflow:e,overflowX:t,overflowY:n,display:i}=Qa(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!mM.has(i)}const bM=new Set(["table","td","th"]);function vM(r){return bM.has(Xc(r))}const yM=[":popover-open",":modal"];function U0(r){return yM.some(e=>{try{return r.matches(e)}catch{return!1}})}const wM=["transform","translate","scale","rotate","perspective"],xM=["transform","translate","scale","rotate","perspective","filter"],SM=["paint","layout","strict","content"];function nm(r){const e=im(),t=Ja(r)?Qa(r):r;return wM.some(n=>t[n]?t[n]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||xM.some(n=>(t.willChange||"").includes(n))||SM.some(n=>(t.contain||"").includes(n))}function kM(r){let e=Wo(r);for(;vs(e)&&!$c(e);){if(nm(e))return e;if(U0(e))return null;e=Wo(e)}return null}function im(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const AM=new Set(["html","body","#document"]);function $c(r){return AM.has(Xc(r))}function Qa(r){return ga(r).getComputedStyle(r)}function z0(r){return Ja(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function Wo(r){if(Xc(r)==="html")return r;const e=r.assignedSlot||r.parentNode||P4(r)&&r.host||bs(r);return P4(e)?e.host:e}function F4(r){const e=Wo(r);return $c(e)?r.ownerDocument?r.ownerDocument.body:r.body:vs(e)&&mh(e)?e:F4(e)}function bh(r,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=F4(r),a=i===((n=r.ownerDocument)==null?void 0:n.body),s=ga(i);if(a){const o=am(s);return e.concat(s,s.visualViewport||[],mh(i)?i:[],o&&t?bh(o):[])}return e.concat(i,bh(i,[],t))}function am(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function D4(r){const e=Qa(r);let t=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=vs(r),a=i?r.offsetWidth:t,s=i?r.offsetHeight:n,o=P0(t)!==a||P0(n)!==s;return o&&(t=a,n=s),{width:t,height:n,$:o}}function sm(r){return Ja(r)?r:r.contextElement}function Kc(r){const e=sm(r);if(!vs(e))return ps(1);const t=e.getBoundingClientRect(),{width:n,height:i,$:a}=D4(e);let s=(a?P0(t.width):t.width)/n,o=(a?P0(t.height):t.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const _M=ps(0);function L4(r){const e=ga(r);return!im()||!e.visualViewport?_M:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function CM(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==ga(r)?!1:e}function Ul(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=r.getBoundingClientRect(),a=sm(r);let s=ps(1);e&&(n?Ja(n)&&(s=Kc(n)):s=Kc(r));const o=CM(a,t,n)?L4(a):ps(0);let l=(i.left+o.x)/s.x,c=(i.top+o.y)/s.y,u=i.width/s.x,h=i.height/s.y;if(a){const d=ga(a),f=n&&Ja(n)?ga(n):n;let p=d,m=am(p);for(;m&&n&&f!==p;){const y=Kc(m),v=m.getBoundingClientRect(),x=Qa(m),S=v.left+(m.clientLeft+parseFloat(x.paddingLeft))*y.x,A=v.top+(m.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,h*=y.y,l+=S,c+=A,p=ga(m),m=am(p)}}return L0({width:u,height:h,x:l,y:c})}function om(r,e){const t=z0(r).scrollLeft;return e?e.left+t:Ul(bs(r)).left+t}function B4(r,e,t){t===void 0&&(t=!1);const n=r.getBoundingClientRect(),i=n.left+e.scrollLeft-(t?0:om(r,n)),a=n.top+e.scrollTop;return{x:i,y:a}}function EM(r){let{elements:e,rect:t,offsetParent:n,strategy:i}=r;const a=i==="fixed",s=bs(n),o=e?U0(e.floating):!1;if(n===s||o&&a)return t;let l={scrollLeft:0,scrollTop:0},c=ps(1);const u=ps(0),h=vs(n);if((h||!h&&!a)&&((Xc(n)!=="body"||mh(s))&&(l=z0(n)),vs(n))){const f=Ul(n);c=Kc(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}const d=s&&!h&&!a?B4(s,l,!0):ps(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:t.y*c.y-l.scrollTop*c.y+u.y+d.y}}function TM(r){return Array.from(r.getClientRects())}function IM(r){const e=bs(r),t=z0(r),n=r.ownerDocument.body,i=fa(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=fa(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+om(r);const o=-t.scrollTop;return Qa(n).direction==="rtl"&&(s+=fa(e.clientWidth,n.clientWidth)-i),{width:i,height:a,x:s,y:o}}function MM(r,e){const t=ga(r),n=bs(r),i=t.visualViewport;let a=n.clientWidth,s=n.clientHeight,o=0,l=0;if(i){a=i.width,s=i.height;const c=im();(!c||c&&e==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:a,height:s,x:o,y:l}}const OM=new Set(["absolute","fixed"]);function NM(r,e){const t=Ul(r,!0,e==="fixed"),n=t.top+r.clientTop,i=t.left+r.clientLeft,a=vs(r)?Kc(r):ps(1),s=r.clientWidth*a.x,o=r.clientHeight*a.y,l=i*a.x,c=n*a.y;return{width:s,height:o,x:l,y:c}}function U4(r,e,t){let n;if(e==="viewport")n=MM(r,t);else if(e==="document")n=IM(bs(r));else if(Ja(e))n=NM(e,t);else{const i=L4(r);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return L0(n)}function z4(r,e){const t=Wo(r);return t===e||!Ja(t)||$c(t)?!1:Qa(t).position==="fixed"||z4(t,e)}function RM(r,e){const t=e.get(r);if(t)return t;let n=bh(r,[],!1).filter(o=>Ja(o)&&Xc(o)!=="body"),i=null;const a=Qa(r).position==="fixed";let s=a?Wo(r):r;for(;Ja(s)&&!$c(s);){const o=Qa(s),l=nm(s);!l&&o.position==="fixed"&&(i=null),(a?!l&&!i:!l&&o.position==="static"&&!!i&&OM.has(i.position)||mh(s)&&!l&&z4(r,s))?n=n.filter(u=>u!==s):i=o,s=Wo(s)}return e.set(r,n),n}function PM(r){let{element:e,boundary:t,rootBoundary:n,strategy:i}=r;const s=[...t==="clippingAncestors"?U0(e)?[]:RM(e,this._c):[].concat(t),n],o=s[0],l=s.reduce((c,u)=>{const h=U4(e,u,i);return c.top=fa(h.top,c.top),c.right=Go(h.right,c.right),c.bottom=Go(h.bottom,c.bottom),c.left=fa(h.left,c.left),c},U4(e,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function FM(r){const{width:e,height:t}=D4(r);return{width:e,height:t}}function DM(r,e,t){const n=vs(e),i=bs(e),a=t==="fixed",s=Ul(r,!0,a,e);let o={scrollLeft:0,scrollTop:0};const l=ps(0);function c(){l.x=om(i)}if(n||!n&&!a)if((Xc(e)!=="body"||mh(i))&&(o=z0(e)),n){const f=Ul(e,!0,a,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&c();a&&!n&&i&&c();const u=i&&!n&&!a?B4(i,o):ps(0),h=s.left+o.scrollLeft-l.x-u.x,d=s.top+o.scrollTop-l.y-u.y;return{x:h,y:d,width:s.width,height:s.height}}function lm(r){return Qa(r).position==="static"}function j4(r,e){if(!vs(r)||Qa(r).position==="fixed")return null;if(e)return e(r);let t=r.offsetParent;return bs(r)===t&&(t=t.ownerDocument.body),t}function H4(r,e){const t=ga(r);if(U0(r))return t;if(!vs(r)){let i=Wo(r);for(;i&&!$c(i);){if(Ja(i)&&!lm(i))return i;i=Wo(i)}return t}let n=j4(r,e);for(;n&&vM(n)&&lm(n);)n=j4(n,e);return n&&$c(n)&&lm(n)&&!nm(n)?t:n||kM(r)||t}const LM=async function(r){const e=this.getOffsetParent||H4,t=this.getDimensions,n=await t(r.floating);return{reference:DM(r.reference,await e(r.floating),r.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function BM(r){return Qa(r).direction==="rtl"}const UM={convertOffsetParentRelativeRectToViewportRelativeRect:EM,getDocumentElement:bs,getClippingRect:PM,getOffsetParent:H4,getElementRects:LM,getClientRects:TM,getDimensions:FM,getScale:Kc,isElement:Ja,isRTL:BM};function q4(r,e){return r.x===e.x&&r.y===e.y&&r.width===e.width&&r.height===e.height}function zM(r,e){let t=null,n;const i=bs(r);function a(){var o;clearTimeout(n),(o=t)==null||o.disconnect(),t=null}function s(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),a();const c=r.getBoundingClientRect(),{left:u,top:h,width:d,height:f}=c;if(o||e(),!d||!f)return;const p=F0(h),m=F0(i.clientWidth-(u+d)),y=F0(i.clientHeight-(h+f)),v=F0(u),S={rootMargin:-p+"px "+-m+"px "+-y+"px "+-v+"px",threshold:fa(0,Go(1,l))||1};let A=!0;function C(k){const I=k[0].intersectionRatio;if(I!==l){if(!A)return s();I?s(!1,I):n=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!q4(c,r.getBoundingClientRect())&&s(),A=!1}try{t=new IntersectionObserver(C,{...S,root:i.ownerDocument})}catch{t=new IntersectionObserver(C,S)}t.observe(r)}return s(!0),a}function jM(r,e,t,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=sm(r),u=i||a?[...c?bh(c):[],...bh(e)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",t,{passive:!0}),a&&v.addEventListener("resize",t)});const h=c&&o?zM(c,t):null;let d=-1,f=null;s&&(f=new ResizeObserver(v=>{let[x]=v;x&&x.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var S;(S=f)==null||S.observe(e)})),t()}),c&&!l&&f.observe(c),f.observe(e));let p,m=l?Ul(r):null;l&&y();function y(){const v=Ul(r);m&&!q4(m,v)&&t(),m=v,p=requestAnimationFrame(y)}return t(),()=>{var v;u.forEach(x=>{i&&x.removeEventListener("scroll",t),a&&x.removeEventListener("resize",t)}),h?.(),(v=f)==null||v.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const HM=dM,qM=fM,GM=cM,WM=pM,VM=uM,XM=lM,$M=gM,KM=(r,e,t)=>{const n=new Map,i={platform:UM,...t},a={...i.platform,_c:n};return oM(r,e,{...i,platform:a})};function zl(r){return typeof r=="function"?r():r}function G4(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function W4(r,e){const t=G4(r);return Math.round(e*t)/t}function vh(r){return{[`--bits-${r}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${r}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${r}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${r}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${r}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function YM(r){const e=r.whileElementsMounted,t=j(()=>zl(r.open)??!0),n=j(()=>zl(r.middleware)),i=j(()=>zl(r.transform)??!0),a=j(()=>zl(r.placement)??"bottom"),s=j(()=>zl(r.strategy)??"absolute"),o=j(()=>zl(r.sideOffset)??0),l=j(()=>zl(r.alignOffset)??0),c=r.reference;let u=oe(0),h=oe(0);const d=fe(null);let f=oe(Mr(g(s))),p=oe(Mr(g(a))),m=oe(Mr({})),y=oe(!1);const v=j(()=>{const I=d.current?W4(d.current,g(u)):g(u),R=d.current?W4(d.current,g(h)):g(h);return g(i)?{position:g(f),left:"0",top:"0",transform:`translate(${I}px, ${R}px)`,...d.current&&G4(d.current)>=1.5&&{willChange:"transform"}}:{position:g(f),left:`${I}px`,top:`${R}px`}});let x;function S(){c.current===null||d.current===null||KM(c.current,d.current,{middleware:g(n),placement:g(a),strategy:g(s)}).then(I=>{if(!g(t)&&g(u)!==0&&g(h)!==0){const R=Math.max(Math.abs(g(o)),Math.abs(g(l)),15);if(I.x<=R&&I.y<=R)return}O(u,I.x,!0),O(h,I.y,!0),O(f,I.strategy,!0),O(p,I.placement,!0),O(m,I.middlewareData,!0),O(y,!0)})}function A(){typeof x=="function"&&(x(),x=void 0)}function C(){if(A(),e===void 0){S();return}c.current===null||d.current===null||(x=e(c.current,d.current,S))}function k(){g(t)||O(y,!1)}return Ft(S),Ft(C),Ft(k),Ft(()=>A),{floating:d,reference:c,get strategy(){return g(f)},get placement(){return g(p)},get middlewareData(){return g(m)},get isPositioned(){return g(y)},get floatingStyles(){return g(v)},get update(){return S}}}const JM={top:"bottom",right:"left",bottom:"top",left:"right"},cm=new Gn("Floating.Root"),um=new Gn("Floating.Content"),hm=new Gn("Floating.Root");class j0{static create(e=!1){return e?hm.set(new j0):cm.set(new j0)}anchorNode=fe(null);customAnchorNode=fe(null);triggerNode=fe(null);constructor(){Ft(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class H0{static create(e,t=!1){return t?um.set(new H0(e,hm.get())):um.set(new H0(e,cm.get()))}opts;root;contentRef=fe(null);wrapperRef=fe(null);arrowRef=fe(null);contentAttachment=rn(this.contentRef);wrapperAttachment=rn(this.wrapperRef);arrowAttachment=rn(this.arrowRef);arrowId=fe(Gc());#e=j(()=>{if(typeof this.opts.style=="string")return uh(this.opts.style);if(!this.opts.style)return{}});#t=void 0;#r=new oT(()=>this.arrowRef.current??void 0);#n=j(()=>this.#r?.width??0);#a=j(()=>this.#r?.height??0);#i=j(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#s=j(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#o=j(()=>g(this.#s).length>0);get hasExplicitBoundaries(){return g(this.#o)}set hasExplicitBoundaries(e){O(this.#o,e)}#l=j(()=>({padding:this.opts.collisionPadding.current,boundary:g(this.#s).filter(WT),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return g(this.#l)}set detectOverflowOptions(e){O(this.#l,e)}#c=oe(void 0);#h=oe(void 0);#u=oe(void 0);#g=oe(void 0);#p=j(()=>[HM({mainAxis:this.opts.sideOffset.current+g(this.#a),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&qM({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?$M():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&GM({...this.detectOverflowOptions}),WM({...this.detectOverflowOptions,apply:({rects:e,availableWidth:t,availableHeight:n})=>{const{width:i,height:a}=e.reference;O(this.#c,t,!0),O(this.#h,n,!0),O(this.#u,i,!0),O(this.#g,a,!0)}}),this.arrowRef.current&&XM({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),QM({arrowWidth:g(this.#n),arrowHeight:g(this.#a)}),this.opts.hideWhenDetached.current&&VM({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return g(this.#p)}set middleware(e){O(this.#p,e)}floating;#f=j(()=>ZM(this.floating.placement));get placedSide(){return g(this.#f)}set placedSide(e){O(this.#f,e)}#d=j(()=>eO(this.floating.placement));get placedAlign(){return g(this.#d)}set placedAlign(e){O(this.#d,e)}#m=j(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return g(this.#m)}set arrowX(e){O(this.#m,e)}#y=j(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return g(this.#y)}set arrowY(e){O(this.#y,e)}#b=j(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return g(this.#b)}set cannotCenterArrow(e){O(this.#b,e)}#w=oe();get contentZIndex(){return g(this.#w)}set contentZIndex(e){O(this.#w,e,!0)}#x=j(()=>JM[this.placedSide]);get arrowBaseSide(){return g(this.#x)}set arrowBaseSide(e){O(this.#x,e)}#v=j(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${g(this.#c)}px`,"--bits-floating-available-height":`${g(this.#h)}px`,"--bits-floating-anchor-width":`${g(this.#u)}px`,"--bits-floating-anchor-height":`${g(this.#g)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...g(this.#e)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return g(this.#v)}set wrapperProps(e){O(this.#v,e)}#k=j(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:up({...g(this.#e)}),...this.contentAttachment}));get props(){return g(this.#k)}set props(e){O(this.#k,e)}#C=j(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return g(this.#C)}set arrowStyle(e){O(this.#C,e)}constructor(e,t){this.opts=e,this.root=t,e.customAnchor&&(this.root.customAnchorNode.current=e.customAnchor.current),zr(()=>e.customAnchor.current,n=>{this.root.customAnchorNode.current=n}),this.floating=YM({strategy:()=>this.opts.strategy.current,placement:()=>g(this.#i),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...n)=>jM(...n,{animationFrame:this.#t?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),Ft(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),zr(()=>this.contentRef.current,n=>{if(!n)return;const i=k0(n);this.contentZIndex=i.getComputedStyle(n).zIndex}),Ft(()=>{this.floating.floating.current=this.wrapperRef.current})}}class dm{static create(e){return new dm(e,um.get())}opts;content;constructor(e,t){this.opts=e,this.content=t}#e=j(()=>({id:this.opts.id.current,style:this.content.arrowStyle,"data-side":this.content.placedSide,...this.content.arrowAttachment}));get props(){return g(this.#e)}set props(e){O(this.#e,e)}}class q0{static create(e,t=!1){return t?new q0(e,hm.get()):new q0(e,cm.get())}opts;root;constructor(e,t){this.opts=e,this.root=t,e.virtualEl&&e.virtualEl.current?t.triggerNode=fe.from(e.virtualEl.current):t.triggerNode=e.ref}}function QM(r){return{name:"transformOrigin",options:r,fn(e){const{placement:t,rects:n,middlewareData:i}=e,s=i.arrow?.centerOffset!==0,o=s?0:r.arrowWidth,l=s?0:r.arrowHeight,[c,u]=fm(t),h={start:"0%",center:"50%",end:"100%"}[u],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+l/2;let p="",m="";return c==="bottom"?(p=s?h:`${d}px`,m=`${-l}px`):c==="top"?(p=s?h:`${d}px`,m=`${n.floating.height+l}px`):c==="right"?(p=`${-l}px`,m=s?h:`${f}px`):c==="left"&&(p=`${n.floating.width+l}px`,m=s?h:`${f}px`),{data:{x:p,y:m}}}}}function fm(r){const[e,t="center"]=r.split("-");return[e,t]}function ZM(r){return fm(r)[0]}function eO(r){return fm(r)[1]}function gm(r,e){ge(e,!0);let t=L(e,"tooltip",3,!1);j0.create(t());var n=J(),i=F(n);Te(i,()=>e.children??Re),_(r,n),pe()}const tO={afterMs:1e4,onChange:br};function pm(r,e){const{afterMs:t,onChange:n,getWindow:i}={...tO,...e};let a=null,s=oe(Mr(r));function o(){return i().setTimeout(()=>{O(s,r,!0),n?.(r)},t)}return Ft(()=>()=>{a&&i().clearTimeout(a)}),fe.with(()=>g(s),l=>{O(s,l,!0),n?.(l),a&&i().clearTimeout(a),a=o()})}class rO{#e;#t=j(()=>this.#e.candidateValues());#r;constructor(e){this.#e=e,this.#r=pm("",{afterMs:1e3,getWindow:this.#e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e){if(!this.#e.enabled()||!g(this.#t).length)return;this.#r.current=this.#r.current+e;const t=this.#e.getCurrentItem(),n=g(this.#t).find(o=>o===t)??"",i=g(this.#t).map(o=>o??""),a=Gp(i,this.#r.current,n),s=g(this.#t).find(o=>o===a);return s&&this.#e.onMatch(s),s}resetTypeahead(){this.#r.current=""}}class V4{#e;#t;#r=j(()=>this.#e.onMatch?this.#e.onMatch:e=>e.focus());#n=j(()=>this.#e.getCurrentItem?this.#e.getCurrentItem:this.#e.getActiveElement);constructor(e){this.#e=e,this.#t=pm("",{afterMs:1e3,getWindow:e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e,t){if(!t.length)return;this.#t.current=this.#t.current+e;const n=g(this.#n)(),i=t.find(l=>l===n)?.textContent?.trim()??"",a=t.map(l=>l.textContent?.trim()??""),s=Gp(a,this.#t.current,i),o=t.find(l=>l.textContent?.trim()===s);return o&&g(this.#r)(o),o}resetTypeahead(){this.#t.current=""}get search(){return this.#t.current}}const nO=[ds,yp,_0],iO=[fs,vp,A0],aO=[...nO,...iO],sO=zo({component:"select",parts:["trigger","content","item","viewport","scroll-up-button","scroll-down-button","group","group-label","separator","arrow","input","content-wrapper","item-text","value"]}),yh=new Gn("Select.Root | Combobox.Root"),G0=new Gn("Select.Content | Combobox.Content");class X4{opts;#e=oe(!1);get touchedInput(){return g(this.#e)}set touchedInput(e){O(this.#e,e,!0)}#t=oe(null);get inputNode(){return g(this.#t)}set inputNode(e){O(this.#t,e,!0)}#r=oe(null);get contentNode(){return g(this.#r)}set contentNode(e){O(this.#r,e,!0)}#n=oe(null);get triggerNode(){return g(this.#n)}set triggerNode(e){O(this.#n,e,!0)}#a=oe("");get valueId(){return g(this.#a)}set valueId(e){O(this.#a,e,!0)}#i=oe(null);get highlightedNode(){return g(this.#i)}set highlightedNode(e){O(this.#i,e,!0)}#s=j(()=>this.highlightedNode?this.highlightedNode.getAttribute("data-value"):null);get highlightedValue(){return g(this.#s)}set highlightedValue(e){O(this.#s,e)}#o=j(()=>{if(this.highlightedNode)return this.highlightedNode.id});get highlightedId(){return g(this.#o)}set highlightedId(e){O(this.#o,e)}#l=j(()=>this.highlightedNode?this.highlightedNode.getAttribute("data-label"):null);get highlightedLabel(){return g(this.#l)}set highlightedLabel(e){O(this.#l,e)}isUsingKeyboard=!1;isCombobox=!1;domContext=new Bo(()=>null);constructor(e){this.opts=e,this.isCombobox=e.isCombobox,new dh({ref:fe.with(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),yi(()=>{this.opts.open.current||this.setHighlightedNode(null)})}#c=Mp(this.setHighlightedToFirstCandidate.bind(this),20);setHighlightedNode(e,t=!1){this.highlightedNode=e,e&&(this.isUsingKeyboard||t)&&e.scrollIntoView({block:this.opts.scrollAlignment.current})}getCandidateNodes(){const e=this.contentNode;return e?Array.from(e.querySelectorAll(`[${this.getBitsAttr("item")}]:not([data-disabled])`)):[]}setHighlightedToFirstCandidate(e={debounced:!1}){if(e.debounced){this.#c();return}this.setHighlightedNode(null);const t=this.getCandidateNodes();t.length&&this.setHighlightedNode(t[0])}getNodeByValue(e){return this.getCandidateNodes().find(n=>n.dataset.value===e)??null}setOpen(e){this.opts.open.current=e}toggleOpen(){this.opts.open.current=!this.opts.open.current}handleOpen(){this.setOpen(!0)}handleClose(){this.setHighlightedNode(null),this.setOpen(!1)}toggleMenu(){this.toggleOpen()}getBitsAttr=e=>sO.getAttr(e,this.isCombobox?"combobox":void 0)}class oO extends X4{opts;isMulti=!1;#e=j(()=>this.opts.value.current!=="");get hasValue(){return g(this.#e)}set hasValue(e){O(this.#e,e)}#t=j(()=>this.opts.items.current.length?this.opts.items.current.find(t=>t.value===this.opts.value.current)?.label??"":"");get currentLabel(){return g(this.#t)}set currentLabel(e){O(this.#t,e)}#r=j(()=>this.opts.items.current.length?this.opts.items.current.filter(t=>!t.disabled).map(t=>t.label):[]);get candidateLabels(){return g(this.#r)}set candidateLabels(e){O(this.#r,e)}#n=j(()=>!(this.isMulti||this.opts.items.current.length===0));get dataTypeaheadEnabled(){return g(this.#n)}set dataTypeaheadEnabled(e){O(this.#n,e)}constructor(e){super(e),this.opts=e,Ft(()=>{!this.opts.open.current&&this.highlightedNode&&this.setHighlightedNode(null)}),zr(()=>this.opts.open.current,()=>{this.opts.open.current&&this.setInitialHighlightedNode()})}includesItem(e){return this.opts.value.current===e}toggleItem(e,t=e){this.opts.value.current=this.includesItem(e)?"":e,this.opts.inputValue.current=t}setInitialHighlightedNode(){Ra(()=>{if(this.highlightedNode&&this.domContext.getDocument().contains(this.highlightedNode))return;if(this.opts.value.current!==""){const t=this.getNodeByValue(this.opts.value.current);if(t){this.setHighlightedNode(t,!0);return}}const e=this.getCandidateNodes()[0];e&&this.setHighlightedNode(e,!0)})}}class lO extends X4{opts;isMulti=!0;#e=j(()=>this.opts.value.current.length>0);get hasValue(){return g(this.#e)}set hasValue(e){O(this.#e,e)}constructor(e){super(e),this.opts=e,Ft(()=>{!this.opts.open.current&&this.highlightedNode&&this.setHighlightedNode(null)}),zr(()=>this.opts.open.current,()=>{this.opts.open.current&&this.setInitialHighlightedNode()})}includesItem(e){return this.opts.value.current.includes(e)}toggleItem(e,t=e){this.includesItem(e)?this.opts.value.current=this.opts.value.current.filter(n=>n!==e):this.opts.value.current=[...this.opts.value.current,e],this.opts.inputValue.current=t}setInitialHighlightedNode(){Ra(()=>{if(!this.domContext||this.highlightedNode&&this.domContext.getDocument().contains(this.highlightedNode))return;if(this.opts.value.current.length&&this.opts.value.current[0]!==""){const t=this.getNodeByValue(this.opts.value.current[0]);if(t){this.setHighlightedNode(t,!0);return}}const e=this.getCandidateNodes()[0];e&&this.setHighlightedNode(e,!0)})}}class cO{static create(e){const{type:t,...n}=e,i=t==="single"?new oO(n):new lO(n);return yh.set(i)}}class mm{static create(e){return new mm(e,yh.get())}opts;root;attachment;#e;#t;constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(e.ref,n=>this.root.triggerNode=n),this.root.domContext=new Bo(e.ref),this.#e=new V4({getCurrentItem:()=>this.root.highlightedNode,onMatch:n=>{this.root.setHighlightedNode(n)},getActiveElement:()=>this.root.domContext.getActiveElement(),getWindow:()=>this.root.domContext.getWindow()}),this.#t=new rO({getCurrentItem:()=>this.root.isMulti?"":this.root.currentLabel,onMatch:n=>{if(this.root.isMulti||!this.root.opts.items.current)return;const i=this.root.opts.items.current.find(a=>a.label===n);i&&(this.root.opts.value.current=i.value)},enabled:()=>!this.root.isMulti&&this.root.dataTypeaheadEnabled,candidateValues:()=>this.root.isMulti?[]:this.root.candidateLabels,getWindow:()=>this.root.domContext.getWindow()}),this.onkeydown=this.onkeydown.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onclick=this.onclick.bind(this)}#r(){this.root.opts.open.current=!0,this.#t.resetTypeahead(),this.#e.resetTypeahead()}#n(e){this.#r()}#a(){const e=this.root.highlightedValue===this.root.opts.value.current;return!this.root.opts.allowDeselect.current&&e&&!this.root.isMulti?(this.root.handleClose(),!0):(this.root.highlightedValue!==null&&this.root.toggleItem(this.root.highlightedValue,this.root.highlightedLabel??void 0),!this.root.isMulti&&!e?(this.root.handleClose(),!0):!1)}onkeydown(e){if(this.root.isUsingKeyboard=!0,(e.key===fs||e.key===ds)&&e.preventDefault(),!this.root.opts.open.current){if(e.key===jo||e.key===gs||e.key===ds||e.key===fs)e.preventDefault(),this.root.handleOpen();else if(!this.root.isMulti&&this.root.dataTypeaheadEnabled){this.#t.handleTypeaheadSearch(e.key);return}if(this.root.hasValue)return;const s=this.root.getCandidateNodes();if(!s.length)return;if(e.key===ds){const o=s[0];this.root.setHighlightedNode(o)}else if(e.key===fs){const o=s[s.length-1];this.root.setHighlightedNode(o)}return}if(e.key===wp){this.root.handleClose();return}if((e.key===jo||e.key===gs&&this.#e.search==="")&&!e.isComposing&&(e.preventDefault(),this.#a()))return;if(e.key===fs&&e.altKey&&this.root.handleClose(),aO.includes(e.key)){e.preventDefault();const s=this.root.getCandidateNodes(),o=this.root.highlightedNode,l=o?s.indexOf(o):-1,c=this.root.opts.loop.current;let u;if(e.key===ds?u=OI(s,l,c):e.key===fs?u=NI(s,l,c):e.key===vp?u=RI(s,l,10,c):e.key===yp?u=PI(s,l,10,c):e.key===_0?u=s[0]:e.key===A0&&(u=s[s.length-1]),!u)return;this.root.setHighlightedNode(u);return}const t=e.ctrlKey||e.altKey||e.metaKey,n=e.key.length===1,i=e.key===gs,a=this.root.getCandidateNodes();if(e.key!==wp){if(!t&&(n||i)){!this.#e.handleTypeaheadSearch(e.key,a)&&i&&(e.preventDefault(),this.#a());return}this.root.highlightedNode||this.root.setHighlightedToFirstCandidate()}}onclick(e){e.currentTarget.focus()}onpointerdown(e){if(this.root.opts.disabled.current)return;if(e.pointerType==="touch")return e.preventDefault();const t=e.target;t?.hasPointerCapture(e.pointerId)&&t?.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&(this.root.opts.open.current===!1?this.#n(e):this.root.handleClose())}onpointerup(e){this.root.opts.disabled.current||(e.preventDefault(),e.pointerType==="touch"&&(this.root.opts.open.current===!1?this.#n(e):this.root.handleClose()))}#i=j(()=>({id:this.opts.id.current,disabled:this.root.opts.disabled.current?!0:void 0,"aria-haspopup":"listbox","aria-expanded":pp(this.root.opts.open.current),"aria-activedescendant":this.root.highlightedId,"data-state":Uo(this.root.opts.open.current),"data-disabled":hs(this.root.opts.disabled.current),"data-placeholder":this.root.hasValue?void 0:"",[this.root.getBitsAttr("trigger")]:"",onpointerdown:this.onpointerdown,onkeydown:this.onkeydown,onclick:this.onclick,onpointerup:this.onpointerup,...this.attachment}));get props(){return g(this.#i)}set props(e){O(this.#i,e)}}class bm{static create(e){return G0.set(new bm(e,yh.get()))}opts;root;attachment;#e=oe(null);get viewportNode(){return g(this.#e)}set viewportNode(e){O(this.#e,e,!0)}#t=oe(!1);get isPositioned(){return g(this.#t)}set isPositioned(e){O(this.#t,e,!0)}domContext;constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(e.ref,n=>this.root.contentNode=n),this.domContext=new Bo(this.opts.ref),this.root.domContext===null&&(this.root.domContext=this.domContext),Lo(()=>{this.root.contentNode=null,this.isPositioned=!1}),zr(()=>this.root.opts.open.current,()=>{this.root.opts.open.current||(this.isPositioned=!1)}),this.onpointermove=this.onpointermove.bind(this)}onpointermove(e){this.root.isUsingKeyboard=!1}#r=j(()=>vh(this.root.isCombobox?"combobox":"select"));onInteractOutside=e=>{if(e.target===this.root.triggerNode||e.target===this.root.inputNode){e.preventDefault();return}this.opts.onInteractOutside.current(e),!e.defaultPrevented&&this.root.handleClose()};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()};onOpenAutoFocus=e=>{e.preventDefault()};onCloseAutoFocus=e=>{e.preventDefault()};#n=j(()=>({open:this.root.opts.open.current}));get snippetProps(){return g(this.#n)}set snippetProps(e){O(this.#n,e)}#a=j(()=>({id:this.opts.id.current,role:"listbox","aria-multiselectable":this.root.isMulti?"true":void 0,"data-state":Uo(this.root.opts.open.current),[this.root.getBitsAttr("content")]:"",style:{display:"flex",flexDirection:"column",outline:"none",boxSizing:"border-box",pointerEvents:"auto",...g(this.#r)},onpointermove:this.onpointermove,...this.attachment}));get props(){return g(this.#a)}set props(e){O(this.#a,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus,trapFocus:!1,loop:!1,onPlaced:()=>{this.root.opts.open.current&&(this.isPositioned=!0)}}}class vm{static create(e){return new vm(e,yh.get())}opts;root;attachment;#e=j(()=>this.root.includesItem(this.opts.value.current));get isSelected(){return g(this.#e)}set isSelected(e){O(this.#e,e)}#t=j(()=>this.root.highlightedValue===this.opts.value.current);get isHighlighted(){return g(this.#t)}set isHighlighted(e){O(this.#t,e)}prevHighlighted=new n4(()=>this.isHighlighted);#r=oe(!1);get mounted(){return g(this.#r)}set mounted(e){O(this.#r,e,!0)}constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(e.ref),fp(()=>{this.root.setHighlightedToFirstCandidate({debounced:!0})}),Lo(()=>{this.root.setHighlightedToFirstCandidate({debounced:!0})}),zr([()=>this.isHighlighted,()=>this.prevHighlighted.current],()=>{this.isHighlighted?this.opts.onHighlight.current():this.prevHighlighted.current&&this.opts.onUnhighlight.current()}),zr(()=>this.mounted,()=>{this.mounted&&this.root.setInitialHighlightedNode()}),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onpointermove=this.onpointermove.bind(this)}handleSelect(){if(this.opts.disabled.current)return;const e=this.opts.value.current===this.root.opts.value.current;if(!this.root.opts.allowDeselect.current&&e&&!this.root.isMulti){this.root.handleClose();return}this.root.toggleItem(this.opts.value.current,this.opts.label.current),!this.root.isMulti&&!e&&this.root.handleClose()}#n=j(()=>({selected:this.isSelected,highlighted:this.isHighlighted}));get snippetProps(){return g(this.#n)}set snippetProps(e){O(this.#n,e)}onpointerdown(e){e.preventDefault()}onpointerup(e){if(!(e.defaultPrevented||!this.opts.ref.current)){if(e.pointerType==="touch"&&!Ip){$r(this.opts.ref.current,"click",()=>{this.handleSelect(),this.root.setHighlightedNode(this.opts.ref.current)},{once:!0});return}e.preventDefault(),this.handleSelect(),e.pointerType==="touch"&&this.root.setHighlightedNode(this.opts.ref.current)}}onpointermove(e){e.pointerType!=="touch"&&this.root.highlightedNode!==this.opts.ref.current&&this.root.setHighlightedNode(this.opts.ref.current)}#a=j(()=>({id:this.opts.id.current,role:"option","aria-selected":this.root.includesItem(this.opts.value.current)?"true":void 0,"data-value":this.opts.value.current,"data-disabled":hs(this.opts.disabled.current),"data-highlighted":this.root.highlightedValue===this.opts.value.current&&!this.opts.disabled.current?"":void 0,"data-selected":this.root.includesItem(this.opts.value.current)?"":void 0,"data-label":this.opts.label.current,[this.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,...this.attachment}));get props(){return g(this.#a)}set props(e){O(this.#a,e)}}class ym{static create(e){return new ym(e,yh.get())}opts;root;#e=j(()=>this.root.opts.name.current!=="");get shouldRender(){return g(this.#e)}set shouldRender(e){O(this.#e,e)}constructor(e,t){this.opts=e,this.root=t,this.onfocus=this.onfocus.bind(this)}onfocus(e){e.preventDefault(),this.root.isCombobox?this.root.inputNode?.focus():this.root.triggerNode?.focus()}#t=j(()=>({disabled:yT(this.root.opts.disabled.current),required:wT(this.root.opts.required.current),name:this.root.opts.name.current,value:this.opts.value.current,onfocus:this.onfocus}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}class wm{static create(e){return new wm(e,G0.get())}opts;content;root;attachment;#e=oe(0);get prevScrollTop(){return g(this.#e)}set prevScrollTop(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.content=t,this.root=t.root,this.attachment=rn(e.ref,n=>this.content.viewportNode=n)}#t=j(()=>({id:this.opts.id.current,role:"presentation",[this.root.getBitsAttr("viewport")]:"",style:{position:"relative",flex:1,overflow:"auto"},...this.attachment}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}class $4{opts;content;root;attachment;autoScrollTimer=null;userScrollTimer=-1;isUserScrolling=!1;onAutoScroll=br;#e=oe(!1);get mounted(){return g(this.#e)}set mounted(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.content=t,this.root=t.root,this.attachment=rn(e.ref),zr([()=>this.mounted],()=>{if(!this.mounted){this.isUserScrolling=!1;return}this.isUserScrolling}),Ft(()=>{this.mounted||this.clearAutoScrollInterval()}),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}handleUserScroll(){this.content.domContext.clearTimeout(this.userScrollTimer),this.isUserScrolling=!0,this.userScrollTimer=this.content.domContext.setTimeout(()=>{this.isUserScrolling=!1},200)}clearAutoScrollInterval(){this.autoScrollTimer!==null&&(this.content.domContext.clearTimeout(this.autoScrollTimer),this.autoScrollTimer=null)}onpointerdown(e){if(this.autoScrollTimer!==null)return;const t=n=>{this.onAutoScroll(),this.autoScrollTimer=this.content.domContext.setTimeout(()=>t(n+1),this.opts.delay.current(n))};this.autoScrollTimer=this.content.domContext.setTimeout(()=>t(1),this.opts.delay.current(0))}onpointermove(e){this.onpointerdown(e)}onpointerleave(e){this.clearAutoScrollInterval()}#t=j(()=>({id:this.opts.id.current,"aria-hidden":vT(!0),style:{flexShrink:0},onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}class xm{static create(e){return new xm(new $4(e,G0.get()))}scrollButtonState;content;root;#e=oe(!1);get canScrollDown(){return g(this.#e)}set canScrollDown(e){O(this.#e,e,!0)}scrollIntoViewTimer=null;constructor(e){this.scrollButtonState=e,this.content=e.content,this.root=e.root,this.scrollButtonState.onAutoScroll=this.handleAutoScroll,zr([()=>this.content.viewportNode,()=>this.content.isPositioned],()=>{if(!(!this.content.viewportNode||!this.content.isPositioned))return this.handleScroll(!0),$r(this.content.viewportNode,"scroll",()=>this.handleScroll())}),zr(()=>this.scrollButtonState.mounted,()=>{this.scrollButtonState.mounted&&(this.scrollIntoViewTimer&&clearTimeout(this.scrollIntoViewTimer),this.scrollIntoViewTimer=qc(5,()=>{this.root.highlightedNode?.scrollIntoView({block:this.root.opts.scrollAlignment.current})}))})}handleScroll=(e=!1)=>{if(e||this.scrollButtonState.handleUserScroll(),!this.content.viewportNode)return;const t=this.content.viewportNode.scrollHeight-this.content.viewportNode.clientHeight,n=Number.parseInt(getComputedStyle(this.content.viewportNode).paddingTop,10);this.canScrollDown=Math.ceil(this.content.viewportNode.scrollTop)<t-n};handleAutoScroll=()=>{const e=this.content.viewportNode,t=this.root.highlightedNode;!e||!t||(e.scrollTop=e.scrollTop+t.offsetHeight)};#t=j(()=>({...this.scrollButtonState.props,[this.root.getBitsAttr("scroll-down-button")]:""}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}class Sm{static create(e){return new Sm(new $4(e,G0.get()))}scrollButtonState;content;root;#e=oe(!1);get canScrollUp(){return g(this.#e)}set canScrollUp(e){O(this.#e,e,!0)}constructor(e){this.scrollButtonState=e,this.content=e.content,this.root=e.root,this.scrollButtonState.onAutoScroll=this.handleAutoScroll,zr([()=>this.content.viewportNode,()=>this.content.isPositioned],()=>{if(!(!this.content.viewportNode||!this.content.isPositioned))return this.handleScroll(!0),$r(this.content.viewportNode,"scroll",()=>this.handleScroll())})}handleScroll=(e=!1)=>{if(e||this.scrollButtonState.handleUserScroll(),!this.content.viewportNode)return;const t=Number.parseInt(getComputedStyle(this.content.viewportNode).paddingTop,10);this.canScrollUp=this.content.viewportNode.scrollTop-t>.1};handleAutoScroll=()=>{!this.content.viewportNode||!this.root.highlightedNode||(this.content.viewportNode.scrollTop=this.content.viewportNode.scrollTop-this.root.highlightedNode.offsetHeight)};#t=j(()=>({...this.scrollButtonState.props,[this.root.getBitsAttr("scroll-up-button")]:""}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}function K4(r,e){ge(e,!0);let t=L(e,"value",15,"");const n=ym.create({value:fe.with(()=>t())});var i=J(),a=F(i);{var s=o=>{_4(o,$e(()=>n.props,{get autocomplete(){return e.autocomplete},get value(){return t()},set value(l){t(l)}}))};ce(a,o=>{n.shouldRender&&o(s)})}_(r,i),pe()}function km(r,e){ge(e,!0);let t=L(e,"tooltip",3,!1);q0.create({id:fe.with(()=>e.id),virtualEl:fe.with(()=>e.virtualEl),ref:e.ref},t());var n=J(),i=F(n);Te(i,()=>e.children??Re),_(r,n),pe()}var uO=Ml('<svg viewBox="0 0 30 10" preserveAspectRatio="none" data-arrow=""><polygon points="0,0 30,0 15,10" fill="currentColor"></polygon></svg>'),hO=ee("<span><!></span>");function dO(r,e){ge(e,!0);let t=L(e,"id",19,Gc),n=L(e,"width",3,10),i=L(e,"height",3,5),a=De(e,["$$slots","$$events","$$legacy","id","children","child","width","height"]);const s=j(()=>rr(a,{id:t()}));var o=J(),l=F(o);{var c=h=>{var d=J(),f=F(d);Te(f,()=>e.child,()=>({props:g(s)})),_(h,d)},u=h=>{var d=hO();Lt(d,()=>({...g(s)}));var f=te(d);{var p=y=>{var v=J(),x=F(v);Te(x,()=>e.children??Re),_(y,v)},m=y=>{var v=uO();qe(()=>{Jt(v,"width",n()),Jt(v,"height",i())}),_(y,v)};ce(f,y=>{e.children?y(p):y(m,!1)})}Q(d),_(h,d)};ce(l,h=>{e.child?h(c):h(u,!1)})}_(r,o),pe()}function fO(r,e){ge(e,!0);let t=L(e,"id",19,Gc),n=L(e,"ref",15,null),i=De(e,["$$slots","$$events","$$legacy","id","ref"]);const a=dm.create({id:fe.with(()=>t()),ref:fe.with(()=>n(),o=>n(o))}),s=j(()=>rr(i,a.props));dO(r,$e(()=>g(s))),pe()}function gO(r,e){ge(e,!0);let t=L(e,"side",3,"bottom"),n=L(e,"sideOffset",3,0),i=L(e,"align",3,"center"),a=L(e,"alignOffset",3,0),s=L(e,"arrowPadding",3,0),o=L(e,"avoidCollisions",3,!0),l=L(e,"collisionBoundary",19,()=>[]),c=L(e,"collisionPadding",3,0),u=L(e,"hideWhenDetached",3,!1),h=L(e,"onPlaced",3,()=>{}),d=L(e,"sticky",3,"partial"),f=L(e,"updatePositionStrategy",3,"optimized"),p=L(e,"strategy",3,"fixed"),m=L(e,"dir",3,"ltr"),y=L(e,"style",19,()=>({})),v=L(e,"wrapperId",19,Gc),x=L(e,"customAnchor",3,null),S=L(e,"tooltip",3,!1);const A=H0.create({side:fe.with(()=>t()),sideOffset:fe.with(()=>n()),align:fe.with(()=>i()),alignOffset:fe.with(()=>a()),id:fe.with(()=>e.id),arrowPadding:fe.with(()=>s()),avoidCollisions:fe.with(()=>o()),collisionBoundary:fe.with(()=>l()),collisionPadding:fe.with(()=>c()),hideWhenDetached:fe.with(()=>u()),onPlaced:fe.with(()=>h()),sticky:fe.with(()=>d()),updatePositionStrategy:fe.with(()=>f()),strategy:fe.with(()=>p()),dir:fe.with(()=>m()),style:fe.with(()=>y()),enabled:fe.with(()=>e.enabled),wrapperId:fe.with(()=>v()),customAnchor:fe.with(()=>x())},S()),C=j(()=>rr(A.wrapperProps,{style:{pointerEvents:"auto"}}));var k=J(),I=F(k);Te(I,()=>e.content??Re,()=>({props:A.props,wrapperProps:g(C)})),_(r,k),pe()}function pO(r,e){ge(e,!0),Si(()=>{e.onPlaced?.()});var t=J(),n=F(t);Te(n,()=>e.content??Re,()=>({props:{},wrapperProps:{}})),_(r,t),pe()}function mO(r,e){let t=L(e,"isStatic",3,!1),n=De(e,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var i=J(),a=F(i);{var s=l=>{pO(l,{get content(){return e.content},get onPlaced(){return e.onPlaced}})},o=l=>{gO(l,$e({get content(){return e.content},get onPlaced(){return e.onPlaced}},()=>n))};ce(a,l=>{t()?l(s):l(o,!1)})}_(r,i)}var bO=ee("<!> <!>",1);function Y4(r,e){ge(e,!0);let t=L(e,"interactOutsideBehavior",3,"close"),n=L(e,"trapFocus",3,!0),i=L(e,"isValidEvent",3,()=>!1),a=L(e,"customAnchor",3,null),s=L(e,"isStatic",3,!1),o=L(e,"tooltip",3,!1),l=De(e,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip"]);mO(r,{get isStatic(){return s()},get id(){return e.id},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return a()},get enabled(){return e.enabled},get tooltip(){return o()},content:(u,h)=>{let d=()=>h?.().props,f=()=>h?.().wrapperProps;var p=bO(),m=F(p);{var y=S=>{Wc(S,{get preventScroll(){return e.preventScroll}})},v=S=>{var A=J(),C=F(A);{var k=I=>{Wc(I,{get preventScroll(){return e.preventScroll}})};ce(C,I=>{e.forceMount||I(k)},!0)}_(S,A)};ce(m,S=>{e.forceMount&&e.enabled?S(y):S(v,!1)})}var x=ae(m,2);Up(x,{get onOpenAutoFocus(){return e.onOpenAutoFocus},get onCloseAutoFocus(){return e.onCloseAutoFocus},get loop(){return e.loop},get enabled(){return e.enabled},get trapFocus(){return n()},get forceMount(){return e.forceMount},get ref(){return e.ref},focusScope:(A,C)=>{let k=()=>C?.().props;Pp(A,{get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get enabled(){return e.enabled},get ref(){return e.ref},children:(I,R)=>{{const U=(D,$)=>{let H=()=>$?.().props;jp(D,{get id(){return e.id},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get enabled(){return e.enabled},get ref(){return e.ref},children:(V,z)=>{var Z=J(),q=F(Z);{let re=j(()=>({props:rr(l,d(),H(),k(),{style:{pointerEvents:"auto"}}),wrapperProps:f()}));Te(q,()=>e.popper??Re,()=>g(re))}_(V,Z)},$$slots:{default:!0}})};Np(I,{get id(){return e.id},get onInteractOutside(){return e.onInteractOutside},get onFocusOutside(){return e.onFocusOutside},get interactOutsideBehavior(){return t()},isValidEvent:i(),get enabled(){return e.enabled},get ref(){return e.ref},children:U,$$slots:{default:!0}})}},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),_(u,p)},$$slots:{content:!0}}),pe()}function Am(r,e){let t=L(e,"interactOutsideBehavior",3,"close"),n=L(e,"trapFocus",3,!0),i=L(e,"isValidEvent",3,()=>!1),a=L(e,"customAnchor",3,null),s=L(e,"isStatic",3,!1),o=De(e,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref"]);Ys(r,{get open(){return e.open},get ref(){return e.ref},presence:c=>{Y4(c,$e({get popper(){return e.popper},get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get id(){return e.id},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get preventScroll(){return e.preventScroll},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return a()},get isStatic(){return s()},get enabled(){return e.open},get onInteractOutside(){return e.onInteractOutside},get onCloseAutoFocus(){return e.onCloseAutoFocus},get onOpenAutoFocus(){return e.onOpenAutoFocus},get interactOutsideBehavior(){return t()},get loop(){return e.loop},get trapFocus(){return n()},isValidEvent:i(),get onFocusOutside(){return e.onFocusOutside},forceMount:!1,get ref(){return e.ref}},()=>o))},$$slots:{presence:!0}})}function _m(r,e){let t=L(e,"interactOutsideBehavior",3,"close"),n=L(e,"trapFocus",3,!0),i=L(e,"isValidEvent",3,()=>!1),a=L(e,"customAnchor",3,null),s=L(e,"isStatic",3,!1),o=De(e,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);Y4(r,$e({get popper(){return e.popper},get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get id(){return e.id},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get preventScroll(){return e.preventScroll},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return a()},get isStatic(){return s()},get enabled(){return e.enabled},get onInteractOutside(){return e.onInteractOutside},get onCloseAutoFocus(){return e.onCloseAutoFocus},get onOpenAutoFocus(){return e.onOpenAutoFocus},get interactOutsideBehavior(){return t()},get loop(){return e.loop},get trapFocus(){return n()},isValidEvent:i(),get onFocusOutside(){return e.onFocusOutside}},()=>o,{forceMount:!0}))}var vO=ee("<div><div><!></div></div>"),yO=ee("<div><div><!></div></div>");function wO(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"forceMount",3,!1),s=L(e,"side",3,"bottom"),o=L(e,"onInteractOutside",3,br),l=L(e,"onEscapeKeydown",3,br),c=L(e,"preventScroll",3,!1),u=De(e,["$$slots","$$events","$$legacy","id","ref","forceMount","side","onInteractOutside","onEscapeKeydown","children","child","preventScroll"]);const h=bm.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),v=>i(v)),onInteractOutside:fe.with(()=>o()),onEscapeKeydown:fe.with(()=>l())}),d=j(()=>rr(u,h.props));var f=J(),p=F(f);{var m=v=>{_m(v,$e(()=>g(d),()=>h.popperProps,{get ref(){return h.opts.ref},get side(){return s()},get enabled(){return h.root.opts.open.current},get id(){return n()},get preventScroll(){return c()},forceMount:!0,popper:(S,A)=>{let C=()=>A?.().props,k=()=>A?.().wrapperProps;var I=J();const R=j(()=>rr(C(),{style:h.props.style}));var U=F(I);{var D=H=>{var V=J(),z=F(V);{let Z=j(()=>({props:g(R),wrapperProps:k(),...h.snippetProps}));Te(z,()=>e.child,()=>g(Z))}_(H,V)},$=H=>{var V=vO();Lt(V,()=>({...k()}));var z=te(V);Lt(z,()=>({...g(R)}));var Z=te(z);Te(Z,()=>e.children??Re),Q(z),Q(V),_(H,V)};ce(U,H=>{e.child?H(D):H($,!1)})}_(S,I)},$$slots:{popper:!0}}))},y=v=>{var x=J(),S=F(x);{var A=C=>{Am(C,$e(()=>g(d),()=>h.popperProps,{get ref(){return h.opts.ref},get side(){return s()},get open(){return h.root.opts.open.current},get id(){return n()},get preventScroll(){return c()},forceMount:!1,popper:(I,R)=>{let U=()=>R?.().props,D=()=>R?.().wrapperProps;var $=J();const H=j(()=>rr(U(),{style:h.props.style}));var V=F($);{var z=q=>{var re=J(),X=F(re);{let ie=j(()=>({props:g(H),wrapperProps:D(),...h.snippetProps}));Te(X,()=>e.child,()=>g(ie))}_(q,re)},Z=q=>{var re=yO();Lt(re,()=>({...D()}));var X=te(re);Lt(X,()=>({...g(H)}));var ie=te(X);Te(ie,()=>e.children??Re),Q(X),Q(re),_(q,re)};ce(V,q=>{e.child?q(z):q(Z,!1)})}_(I,$)},$$slots:{popper:!0}}))};ce(S,C=>{a()||C(A)},!0)}_(v,x)};ce(p,v=>{a()?v(m):v(y,!1)})}_(r,f),pe()}function Cm(r,e){ge(e,!0);let t=L(e,"mounted",15,!1),n=L(e,"onMountedChange",3,br);fp(()=>(t(!0),n()(!0),()=>{t(!1),n()(!1)})),pe()}var xO=ee("<div><!></div>"),SO=ee("<!> <!>",1);function kO(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"label",19,()=>e.value),s=L(e,"disabled",3,!1),o=L(e,"onHighlight",3,br),l=L(e,"onUnhighlight",3,br),c=De(e,["$$slots","$$events","$$legacy","id","ref","value","label","disabled","children","child","onHighlight","onUnhighlight"]);const u=vm.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),v=>i(v)),value:fe.with(()=>e.value),disabled:fe.with(()=>s()),label:fe.with(()=>a()),onHighlight:fe.with(()=>o()),onUnhighlight:fe.with(()=>l())}),h=j(()=>rr(c,u.props));var d=SO(),f=F(d);{var p=v=>{var x=J(),S=F(x);{let A=j(()=>({props:g(h),...u.snippetProps}));Te(S,()=>e.child,()=>g(A))}_(v,x)},m=v=>{var x=xO();Lt(x,()=>({...g(h)}));var S=te(x);Te(S,()=>e.children??Re,()=>u.snippetProps),Q(x),_(v,x)};ce(f,v=>{e.child?v(p):v(m,!1)})}var y=ae(f,2);Cm(y,{get mounted(){return u.mounted},set mounted(v){u.mounted=v}}),_(r,d),pe()}var AO=ee("<div><!></div>");function _O(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=De(e,["$$slots","$$events","$$legacy","id","ref","children","child"]);const s=wm.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),d=>i(d))}),o=j(()=>rr(a,s.props));var l=J(),c=F(l);{var u=d=>{var f=J(),p=F(f);Te(p,()=>e.child,()=>({props:g(o)})),_(d,f)},h=d=>{var f=AO();Lt(f,()=>({...g(o)}));var p=te(f);Te(p,()=>e.children??Re),Q(f),_(d,f)};ce(c,d=>{e.child?d(u):d(h,!1)})}_(r,l),pe()}var CO=ee("<div><!></div>"),EO=ee("<!> <!>",1);function TO(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"delay",3,()=>50),s=De(e,["$$slots","$$events","$$legacy","id","ref","delay","child","children"]);const o=xm.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),d=>i(d)),delay:fe.with(()=>a())}),l=j(()=>rr(s,o.props));var c=J(),u=F(c);{var h=d=>{var f=EO(),p=F(f);Cm(p,{get mounted(){return o.scrollButtonState.mounted},set mounted(x){o.scrollButtonState.mounted=x}});var m=ae(p,2);{var y=x=>{var S=J(),A=F(S);Te(A,()=>e.child,()=>({props:s})),_(x,S)},v=x=>{var S=CO();Lt(S,()=>({...g(l)}));var A=te(S);Te(A,()=>e.children??Re),Q(S),_(x,S)};ce(m,x=>{e.child?x(y):x(v,!1)})}_(d,f)};ce(u,d=>{o.canScrollDown&&d(h)})}_(r,c),pe()}var IO=ee("<div><!></div>"),MO=ee("<!> <!>",1);function OO(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"delay",3,()=>50),s=De(e,["$$slots","$$events","$$legacy","id","ref","delay","child","children"]);const o=Sm.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),d=>i(d)),delay:fe.with(()=>a())}),l=j(()=>rr(s,o.props));var c=J(),u=F(c);{var h=d=>{var f=MO(),p=F(f);Cm(p,{get mounted(){return o.scrollButtonState.mounted},set mounted(x){o.scrollButtonState.mounted=x}});var m=ae(p,2);{var y=x=>{var S=J(),A=F(S);Te(A,()=>e.child,()=>({props:s})),_(x,S)},v=x=>{var S=IO();Lt(S,()=>({...g(l)}));var A=te(S);Te(A,()=>e.children??Re),Q(S),_(x,S)};ce(m,x=>{e.child?x(y):x(v,!1)})}_(d,f)};ce(u,d=>{o.canScrollUp&&d(h)})}_(r,c),pe()}const NO=[jo,gs],RO=[ds,yp,_0],J4=[fs,vp,A0],PO=[...RO,...J4];function Q4(r){return r.pointerType==="mouse"}function FO(r,{select:e=!1}={}){if(!r||!r.focus)return;const t=hh(r);if(t.activeElement===r)return;const n=t.activeElement;r.focus({preventScroll:!0}),r!==n&&VT(r)&&e&&r.select()}function DO(r,{select:e=!1}={},t){const n=t();for(const i of r)if(FO(i,{select:e}),t()!==n)return!0}function wh(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function LO(r,e){if(!Lp(r,wh()))return BO(r,e);const t=hh(r),n=v4(t.body,wh());e==="prev"&&n.reverse();const i=n.indexOf(r);return i===-1?t.body:n.slice(i+1)[0]}function BO(r,e){const t=hh(r);if(!w4(r,wh()))return t.body;const n=y4(t.body,wh());e==="prev"&&n.reverse();const i=n.indexOf(r);return i===-1?t.body:n.slice(i+1).find(s=>Lp(s,wh()))??t.body}class Z4{#e;#t;#r;#n=oe(null);constructor(e){this.#e=e,this.#t=j(()=>this.#e.enabled()),this.#r=pm(!1,{afterMs:e.transitTimeout??300,onChange:t=>{g(this.#t)&&this.#e.setIsPointerInTransit?.(t)},getWindow:()=>k0(this.#e.triggerNode())}),zr([e.triggerNode,e.contentNode,e.enabled],([t,n,i])=>{if(!t||!n||!i)return;const a=o=>{this.#i(o,n)},s=o=>{this.#i(o,t)};return $s($r(t,"pointerleave",a),$r(n,"pointerleave",s))}),zr(()=>g(this.#n),()=>{const t=i=>{if(!g(this.#n))return;const a=i.target;if(!fh(a))return;const s={x:i.clientX,y:i.clientY},o=e.triggerNode()?.contains(a)||e.contentNode()?.contains(a),l=!HO(s,g(this.#n));o?this.#a():l&&(this.#a(),e.onPointerExit())},n=hh(e.triggerNode()??e.contentNode());if(n)return $r(n,"pointermove",t)})}#a(){O(this.#n,null),this.#r.current=!1}#i(e,t){const n=e.currentTarget;if(!qo(n))return;const i={x:e.clientX,y:e.clientY},a=UO(i,n.getBoundingClientRect()),s=zO(i,a),o=jO(t.getBoundingClientRect()),l=qO([...s,...o]);O(this.#n,l,!0),this.#r.current=!0}}function UO(r,e){const t=Math.abs(e.top-r.y),n=Math.abs(e.bottom-r.y),i=Math.abs(e.right-r.x),a=Math.abs(e.left-r.x);switch(Math.min(t,n,i,a)){case a:return"left";case i:return"right";case t:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function zO(r,e,t=5){const n=t*1.5;switch(e){case"top":return[{x:r.x-t,y:r.y+t},{x:r.x,y:r.y-n},{x:r.x+t,y:r.y+t}];case"bottom":return[{x:r.x-t,y:r.y-t},{x:r.x,y:r.y+n},{x:r.x+t,y:r.y-t}];case"left":return[{x:r.x+t,y:r.y-t},{x:r.x-n,y:r.y},{x:r.x+t,y:r.y+t}];case"right":return[{x:r.x-t,y:r.y-t},{x:r.x+n,y:r.y},{x:r.x-t,y:r.y+t}]}}function jO(r){const{top:e,right:t,bottom:n,left:i}=r;return[{x:i,y:e},{x:t,y:e},{x:t,y:n},{x:i,y:n}]}function HO(r,e){const{x:t,y:n}=r;let i=!1;for(let a=0,s=e.length-1;a<e.length;s=a++){const o=e[a].x,l=e[a].y,c=e[s].x,u=e[s].y;l>n!=u>n&&t<(c-o)*(n-l)/(u-l)+o&&(i=!i)}return i}function qO(r){const e=r.slice();return e.sort((t,n)=>t.x<n.x?-1:t.x>n.x?1:t.y<n.y?-1:t.y>n.y?1:0),GO(e)}function GO(r){if(r.length<=1)return r.slice();const e=[];for(let n=0;n<r.length;n++){const i=r[n];for(;e.length>=2;){const a=e[e.length-1],s=e[e.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))e.pop();else break}e.push(i)}e.pop();const t=[];for(let n=r.length-1;n>=0;n--){const i=r[n];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}const e6=new Gn("Menu.Root"),Em=new Gn("Menu.Root | Menu.Sub"),t6=new Gn("Menu.Content"),WO=new ZT("bitsmenuopen",{bubbles:!1,cancelable:!0}),VO=zo({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class Tm{static create(e){const t=new Tm(e);return e6.set(t)}opts;isUsingKeyboard=new Vo;#e=oe(!1);get ignoreCloseAutoFocus(){return g(this.#e)}set ignoreCloseAutoFocus(e){O(this.#e,e,!0)}#t=oe(!1);get isPointerInTransit(){return g(this.#t)}set isPointerInTransit(e){O(this.#t,e,!0)}constructor(e){this.opts=e}getBitsAttr=e=>VO.getAttr(e,this.opts.variant.current)}class Im{static create(e,t){return Em.set(new Im(e,t,null))}opts;root;parentMenu;contentId=fe.with(()=>"");#e=oe(null);get contentNode(){return g(this.#e)}set contentNode(e){O(this.#e,e,!0)}#t=oe(null);get triggerNode(){return g(this.#t)}set triggerNode(e){O(this.#t,e,!0)}constructor(e,t,n){this.opts=e,this.root=t,this.parentMenu=n,new dh({ref:fe.with(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),n&&zr(()=>n.opts.open.current,()=>{n.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class Mm{static create(e){return t6.set(new Mm(e,Em.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#e=oe("");get search(){return g(this.#e)}set search(e){O(this.#e,e,!0)}#t=0;#r;#n=oe(!1);get mounted(){return g(this.#n)}set mounted(e){O(this.#n,e,!0)}#a;constructor(e,t){this.opts=e,this.parentMenu=t,this.domContext=new Bo(e.ref),this.attachment=rn(this.opts.ref,n=>{this.parentMenu.contentNode!==n&&(this.parentMenu.contentNode=n)}),t.contentId=e.id,this.#a=e.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Z4({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:n=>{this.parentMenu.root.isPointerInTransit=n}}),this.#r=new V4({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new ET({rootNode:fe.with(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:fe.with(()=>"vertical")}),zr(()=>this.parentMenu.contentNode,n=>{if(!n)return;const i=()=>{Ra(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return WO.listen(n,i)}),Ft(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#t)})}#i(){const e=this.parentMenu.contentNode;return e?Array.from(e.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#s(){return this.parentMenu.root.isPointerInTransit}onCloseAutoFocus=e=>{this.opts.onCloseAutoFocus.current(e),!(e.defaultPrevented||this.#a)&&this.parentMenu.triggerNode&&Lp(this.parentMenu.triggerNode)&&this.parentMenu.triggerNode.focus()};handleTabKeyDown(e){let t=this.parentMenu;for(;t.parentMenu!==null;)t=t.parentMenu;if(!t.triggerNode)return;e.preventDefault();const n=LO(t.triggerNode,e.shiftKey?"prev":"next");n?(this.parentMenu.root.ignoreCloseAutoFocus=!0,t.onClose(),Ra(()=>{n.focus(),Ra(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(e){if(e.defaultPrevented)return;if(e.key===wp){this.handleTabKeyDown(e);return}const t=e.target,n=e.currentTarget;if(!qo(t)||!qo(n))return;const i=t.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,a=e.ctrlKey||e.altKey||e.metaKey,s=e.key.length===1;if(this.rovingFocusGroup.handleKeydown(t,e)||e.code==="Space")return;const l=this.#i();i&&!a&&s&&this.#r(e.key,l),e.target?.id===this.parentMenu.contentId.current&&PO.includes(e.key)&&(e.preventDefault(),J4.includes(e.key)&&l.reverse(),DO(l,{select:!1},()=>this.domContext.getActiveElement()))}onblur(e){fh(e.currentTarget)&&fh(e.target)&&(e.currentTarget.contains?.(e.target)||(this.domContext.getWindow().clearTimeout(this.#t),this.search=""))}onfocus(e){this.parentMenu.root.isUsingKeyboard.current&&Ra(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#s()}onItemLeave(e){if(e.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#s()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#s()}onOpenAutoFocus=e=>{if(e.defaultPrevented)return;e.preventDefault(),this.parentMenu.contentNode?.focus()};handleInteractOutside(e){if(!qT(e.target))return;const t=this.parentMenu.triggerNode?.id;if(e.target.id===t){e.preventDefault();return}e.target.closest(`#${t}`)&&e.preventDefault()}#o=j(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return g(this.#o)}set snippetProps(e){O(this.#o,e)}#l=j(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":Uo(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto"},...this.attachment}));get props(){return g(this.#l)}set props(e){O(this.#l,e)}popperProps={onCloseAutoFocus:e=>this.onCloseAutoFocus(e)}}class XO{opts;content;attachment;#e=oe(!1);constructor(e,t){this.opts=e,this.content=t,this.attachment=rn(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(e){if(!e.defaultPrevented&&Q4(e))if(this.opts.disabled.current)this.content.onItemLeave(e);else{if(this.content.onItemEnter())return;const n=e.currentTarget;if(!qo(n))return;n.focus()}}onpointerleave(e){e.defaultPrevented||Q4(e)&&this.content.onItemLeave(e)}onfocus(e){Ra(()=>{e.defaultPrevented||this.opts.disabled.current||O(this.#e,!0)})}onblur(e){Ra(()=>{e.defaultPrevented||O(this.#e,!1)})}#t=j(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":pT(this.opts.disabled.current),"data-disabled":hs(this.opts.disabled.current),"data-highlighted":g(this.#e)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}class Om{static create(e){const t=new XO(e,t6.get());return new Om(e,t)}opts;item;root;#e=!1;constructor(e,t){this.opts=e,this.item=t,this.root=t.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#t(){if(this.item.opts.disabled.current)return;const e=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(e),e.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(e){const t=this.item.content.search!=="";if(!(this.item.opts.disabled.current||t&&e.key===gs)&&NO.includes(e.key)){if(!qo(e.currentTarget))return;e.currentTarget.click(),e.preventDefault()}}onclick(e){this.item.opts.disabled.current||this.#t()}onpointerup(e){if(!e.defaultPrevented&&!this.#e){if(!qo(e.currentTarget))return;e.currentTarget?.click()}}onpointerdown(e){this.#e=!0}#r=j(()=>rr(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return g(this.#r)}set props(e){O(this.#r,e)}}class Nm{static create(e){return new Nm(e,e6.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(this.opts.ref)}#e=j(()=>({id:this.opts.id.current,role:"group",[this.root.getBitsAttr("separator")]:"",...this.attachment}));get props(){return g(this.#e)}set props(e){O(this.#e,e)}}class Rm{static create(e){return new Rm(e,Em.get())}opts;parentMenu;attachment;constructor(e,t){this.opts=e,this.parentMenu=t,this.attachment=rn(this.opts.ref,n=>this.parentMenu.triggerNode=n)}onpointerdown=e=>{if(!this.opts.disabled.current){if(e.pointerType==="touch")return e.preventDefault();e.button===0&&e.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||e.preventDefault())}};onpointerup=e=>{this.opts.disabled.current||e.pointerType==="touch"&&(e.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=e=>{if(!this.opts.disabled.current){if(e.key===gs||e.key===jo){this.parentMenu.toggleOpen(),e.preventDefault();return}e.key===ds&&(this.parentMenu.onOpen(),e.preventDefault())}};#e=j(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#t=j(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":pp(this.parentMenu.opts.open.current),"aria-controls":g(this.#e),"data-disabled":hs(this.opts.disabled.current),"data-state":Uo(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}var $O=ee("<div><!></div>");function KO(r,e){const t=un();ge(e,!0);let n=L(e,"ref",15,null),i=L(e,"id",19,()=>hn(t)),a=L(e,"disabled",3,!1),s=L(e,"onSelect",3,br),o=L(e,"closeOnSelect",3,!0),l=De(e,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const c=Om.create({id:fe.with(()=>i()),disabled:fe.with(()=>a()),onSelect:fe.with(()=>s()),ref:fe.with(()=>n(),m=>n(m)),closeOnSelect:fe.with(()=>o())}),u=j(()=>rr(l,c.props));var h=J(),d=F(h);{var f=m=>{var y=J(),v=F(y);Te(v,()=>e.child,()=>({props:g(u)})),_(m,y)},p=m=>{var y=$O();Lt(y,()=>({...g(u)}));var v=te(y);Te(v,()=>e.children??Re),Q(y),_(m,y)};ce(d,m=>{e.child?m(f):m(p,!1)})}_(r,h),pe()}var YO=ee("<div><!></div>");function JO(r,e){const t=un();ge(e,!0);let n=L(e,"ref",15,null),i=L(e,"id",19,()=>hn(t)),a=De(e,["$$slots","$$events","$$legacy","ref","id","child","children"]);const s=Nm.create({id:fe.with(()=>i()),ref:fe.with(()=>n(),d=>n(d))}),o=j(()=>rr(a,s.props));var l=J(),c=F(l);{var u=d=>{var f=J(),p=F(f);Te(p,()=>e.child,()=>({props:g(o)})),_(d,f)},h=d=>{var f=YO();Lt(f,()=>({...g(o)}));var p=te(f);Te(p,()=>e.children??Re),Q(f),_(d,f)};ce(c,d=>{e.child?d(u):d(h,!1)})}_(r,l),pe()}function r6(r,e){ge(e,!0);let t=L(e,"open",15,!1),n=L(e,"onOpenChange",3,br),i=L(e,"onOpenChangeComplete",3,br);E0.create({variant:fe.with(()=>"dialog"),open:fe.with(()=>t(),o=>{t(o),n()(o)}),onOpenChangeComplete:fe.with(()=>i())});var a=J(),s=F(a);Te(s,()=>e.children??Re),_(r,a),pe()}var QO=ee("<button><!></button>");function n6(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"disabled",3,!1),s=De(e,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const o=xp.create({variant:fe.with(()=>"close"),id:fe.with(()=>n()),ref:fe.with(()=>i(),f=>i(f)),disabled:fe.with(()=>!!a())}),l=j(()=>rr(s,o.props));var c=J(),u=F(c);{var h=f=>{var p=J(),m=F(p);Te(m,()=>e.child,()=>({props:g(l)})),_(f,p)},d=f=>{var p=QO();Lt(p,()=>({...g(l)}));var m=te(p);Te(m,()=>e.children??Re),Q(p),_(f,p)};ce(u,f=>{e.child?f(h):f(d,!1)})}_(r,c),pe()}var ZO=ee("<!> <!>",1),eN=ee("<!> <div><!></div>",1);function i6(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"forceMount",3,!1),s=L(e,"onCloseAutoFocus",3,br),o=L(e,"onOpenAutoFocus",3,br),l=L(e,"onEscapeKeydown",3,br),c=L(e,"onInteractOutside",3,br),u=L(e,"trapFocus",3,!0),h=L(e,"preventScroll",3,!0),d=L(e,"restoreScrollDelay",3,null),f=De(e,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]);const p=T0.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),y=>i(y))}),m=j(()=>rr(f,p.props));{const y=x=>{{const S=(C,k)=>{let I=()=>k?.().props;Pp(C,$e(()=>g(m),{get enabled(){return p.root.opts.open.current},get ref(){return p.opts.ref},onEscapeKeydown:R=>{l()(R),!R.defaultPrevented&&p.root.handleClose()},children:(R,U)=>{Np(R,$e(()=>g(m),{get ref(){return p.opts.ref},get enabled(){return p.root.opts.open.current},onInteractOutside:D=>{c()(D),!D.defaultPrevented&&p.root.handleClose()},children:(D,$)=>{jp(D,$e(()=>g(m),{get ref(){return p.opts.ref},get enabled(){return p.root.opts.open.current},children:(H,V)=>{var z=J(),Z=F(z);{var q=X=>{var ie=ZO(),P=F(ie);{var be=W=>{Wc(W,{get preventScroll(){return h()},get restoreScrollDelay(){return d()}})};ce(P,W=>{p.root.opts.open.current&&W(be)})}var _e=ae(P,2);{let W=j(()=>({props:rr(g(m),I()),...p.snippetProps}));Te(_e,()=>e.child,()=>g(W))}_(X,ie)},re=X=>{var ie=eN(),P=F(ie);Wc(P,{get preventScroll(){return h()}});var be=ae(P,2);Lt(be,W=>({...W}),[()=>rr(g(m),I())]);var _e=te(be);Te(_e,()=>e.children??Re),Q(be),_(X,ie)};ce(Z,X=>{e.child?X(q):X(re,!1)})}_(H,z)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))};let A=j(()=>S4({forceMount:a(),present:p.root.opts.open.current,open:p.root.opts.open.current}));Up(x,{get ref(){return p.opts.ref},loop:!0,get trapFocus(){return u()},get enabled(){return g(A)},get onOpenAutoFocus(){return o()},onCloseAutoFocus:C=>{s()(C),!C.defaultPrevented&&qc(1,()=>p.root.triggerNode?.focus())},focusScope:S,$$slots:{focusScope:!0}})}};let v=j(()=>p.root.opts.open.current||a());Ys(r,$e(()=>g(m),{get forceMount(){return a()},get open(){return g(v)},get ref(){return p.opts.ref},presence:y,$$slots:{presence:!0}}))}pe()}function tN(r,e){ge(e,!0);let t=L(e,"open",15,!1),n=L(e,"dir",3,"ltr"),i=L(e,"onOpenChange",3,br),a=L(e,"onOpenChangeComplete",3,br),s=L(e,"_internal_variant",3,"dropdown-menu");const o=Tm.create({variant:fe.with(()=>s()),dir:fe.with(()=>n()),onClose:()=>{t(!1),i()(!1)}});Im.create({open:fe.with(()=>t(),l=>{t(l),i()(l)}),onOpenChangeComplete:fe.with(()=>a())},o),gm(r,{children:(l,c)=>{var u=J(),h=F(u);Te(h,()=>e.children??Re),_(l,u)},$$slots:{default:!0}}),pe()}var rN=ee("<div><div><!></div></div>"),nN=ee("<div><div><!></div></div>");function iN(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"loop",3,!0),s=L(e,"onInteractOutside",3,br),o=L(e,"onEscapeKeydown",3,br),l=L(e,"onCloseAutoFocus",3,br),c=L(e,"forceMount",3,!1),u=L(e,"trapFocus",3,!1),h=De(e,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus"]);const d=Mm.create({id:fe.with(()=>n()),loop:fe.with(()=>a()),ref:fe.with(()=>i(),A=>i(A)),onCloseAutoFocus:fe.with(()=>l())}),f=j(()=>rr(h,d.props));function p(A){if(d.handleInteractOutside(A),!A.defaultPrevented&&(s()(A),!A.defaultPrevented)){if(A.target&&A.target instanceof Element){const C=`[${d.parentMenu.root.getBitsAttr("sub-content")}]`;if(A.target.closest(C))return}d.parentMenu.onClose()}}function m(A){o()(A),!A.defaultPrevented&&d.parentMenu.onClose()}var y=J(),v=F(y);{var x=A=>{_m(A,$e(()=>g(f),()=>d.popperProps,{get ref(){return d.opts.ref},get enabled(){return d.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:m,get trapFocus(){return u()},get loop(){return a()},forceMount:!0,get id(){return n()},popper:(k,I)=>{let R=()=>I?.().props,U=()=>I?.().wrapperProps;var D=J();const $=j(()=>rr(R(),{style:vh("dropdown-menu")}));var H=F(D);{var V=Z=>{var q=J(),re=F(q);{let X=j(()=>({props:g($),wrapperProps:U(),...d.snippetProps}));Te(re,()=>e.child,()=>g(X))}_(Z,q)},z=Z=>{var q=rN();Lt(q,()=>({...U()}));var re=te(q);Lt(re,()=>({...g($)}));var X=te(re);Te(X,()=>e.children??Re),Q(re),Q(q),_(Z,q)};ce(H,Z=>{e.child?Z(V):Z(z,!1)})}_(k,D)},$$slots:{popper:!0}}))},S=A=>{var C=J(),k=F(C);{var I=R=>{Am(R,$e(()=>g(f),()=>d.popperProps,{get ref(){return d.opts.ref},get open(){return d.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:m,get trapFocus(){return u()},get loop(){return a()},forceMount:!1,get id(){return n()},popper:(D,$)=>{let H=()=>$?.().props,V=()=>$?.().wrapperProps;var z=J();const Z=j(()=>rr(H(),{style:vh("dropdown-menu")}));var q=F(z);{var re=ie=>{var P=J(),be=F(P);{let _e=j(()=>({props:g(Z),wrapperProps:V(),...d.snippetProps}));Te(be,()=>e.child,()=>g(_e))}_(ie,P)},X=ie=>{var P=nN();Lt(P,()=>({...V()}));var be=te(P);Lt(be,()=>({...g(Z)}));var _e=te(be);Te(_e,()=>e.children??Re),Q(be),Q(P),_(ie,P)};ce(q,ie=>{e.child?ie(re):ie(X,!1)})}_(D,z)},$$slots:{popper:!0}}))};ce(k,R=>{c()||R(I)},!0)}_(A,C)};ce(v,A=>{c()?A(x):A(S,!1)})}_(r,y),pe()}var aN=ee("<button><!></button>");function sN(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"disabled",3,!1),s=L(e,"type",3,"button"),o=De(e,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=Rm.create({id:fe.with(()=>n()),disabled:fe.with(()=>a()??!1),ref:fe.with(()=>i(),u=>i(u))}),c=j(()=>rr(o,l.props,{type:s()}));km(r,{get id(){return n()},get ref(){return l.opts.ref},children:(u,h)=>{var d=J(),f=F(d);{var p=y=>{var v=J(),x=F(v);Te(x,()=>e.child,()=>({props:g(c)})),_(y,v)},m=y=>{var v=aN();Lt(v,()=>({...g(c)}));var x=te(v);Te(x,()=>e.children??Re),Q(v),_(y,v)};ce(f,y=>{e.child?y(p):y(m,!1)})}_(u,d)},$$slots:{default:!0}}),pe()}const oN=zo({component:"label",parts:["root"]});class Pm{static create(e){return new Pm(e)}opts;attachment;constructor(e){this.opts=e,this.attachment=rn(this.opts.ref),this.onmousedown=this.onmousedown.bind(this)}onmousedown(e){e.detail>1&&e.preventDefault()}#e=j(()=>({id:this.opts.id.current,[oN.root]:"",onmousedown:this.onmousedown,...this.attachment}));get props(){return g(this.#e)}set props(e){O(this.#e,e)}}var lN=ee("<label><!></label>");function cN(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=De(e,["$$slots","$$events","$$legacy","children","child","id","ref","for"]);const s=Pm.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),d=>i(d))}),o=j(()=>rr(a,s.props,{for:e.for}));var l=J(),c=F(l);{var u=d=>{var f=J(),p=F(f);Te(p,()=>e.child,()=>({props:g(o)})),_(d,f)},h=d=>{var f=lN();Lt(f,()=>({...g(o),for:e.for}));var p=te(f);Te(p,()=>e.children??Re),Q(f),_(d,f)};ce(c,d=>{e.child?d(u):d(h,!1)})}_(r,l),pe()}class Yc{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),Ft(this.handler)}handler(){let e=0;const t=this.#e();if(!t)return;const n=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return n.observe(t),()=>{window.cancelAnimationFrame(e),n.unobserve(t)}}}function uN(r,e,t){return Math.min(t,Math.max(e,r))}const xh=zo({component:"scroll-area",parts:["root","viewport","corner","thumb","scrollbar"]}),Sh=new Gn("ScrollArea.Root"),kh=new Gn("ScrollArea.Scrollbar"),W0=new Gn("ScrollArea.ScrollbarVisible"),Fm=new Gn("ScrollArea.ScrollbarAxis"),a6=new Gn("ScrollArea.ScrollbarShared");class Dm{static create(e){return Sh.set(new Dm(e))}opts;attachment;#e=oe(null);get scrollAreaNode(){return g(this.#e)}set scrollAreaNode(e){O(this.#e,e,!0)}#t=oe(null);get viewportNode(){return g(this.#t)}set viewportNode(e){O(this.#t,e,!0)}#r=oe(null);get contentNode(){return g(this.#r)}set contentNode(e){O(this.#r,e,!0)}#n=oe(null);get scrollbarXNode(){return g(this.#n)}set scrollbarXNode(e){O(this.#n,e,!0)}#a=oe(null);get scrollbarYNode(){return g(this.#a)}set scrollbarYNode(e){O(this.#a,e,!0)}#i=oe(0);get cornerWidth(){return g(this.#i)}set cornerWidth(e){O(this.#i,e,!0)}#s=oe(0);get cornerHeight(){return g(this.#s)}set cornerHeight(e){O(this.#s,e,!0)}#o=oe(!1);get scrollbarXEnabled(){return g(this.#o)}set scrollbarXEnabled(e){O(this.#o,e,!0)}#l=oe(!1);get scrollbarYEnabled(){return g(this.#l)}set scrollbarYEnabled(e){O(this.#l,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=rn(e.ref,t=>this.scrollAreaNode=t),this.domContext=new Bo(e.ref)}#c=j(()=>({id:this.opts.id.current,dir:this.opts.dir.current,style:{position:"relative","--bits-scroll-area-corner-height":`${this.cornerHeight}px`,"--bits-scroll-area-corner-width":`${this.cornerWidth}px`},[xh.root]:"",...this.attachment}));get props(){return g(this.#c)}set props(e){O(this.#c,e)}}class Lm{static create(e){return new Lm(e,Sh.get())}opts;root;attachment;#e=fe(Gc());#t=fe(null);contentAttachment=rn(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(e.ref,n=>this.root.viewportNode=n)}#r=j(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?"scroll":"hidden",overflowY:this.root.scrollbarYEnabled?"scroll":"hidden"},[xh.viewport]:"",...this.attachment}));get props(){return g(this.#r)}set props(e){O(this.#r,e)}#n=j(()=>({id:this.#e.current,"data-scroll-area-content":"",style:{minWidth:this.root.scrollbarXEnabled?"fit-content":void 0},...this.contentAttachment}));get contentProps(){return g(this.#n)}set contentProps(e){O(this.#n,e)}}class Bm{static create(e){return kh.set(new Bm(e,Sh.get()))}opts;root;#e=j(()=>this.opts.orientation.current==="horizontal");get isHorizontal(){return g(this.#e)}set isHorizontal(e){O(this.#e,e)}#t=oe(!1);get hasThumb(){return g(this.#t)}set hasThumb(e){O(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,zr(()=>this.isHorizontal,n=>n?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}}class Um{static create(){return new Um(kh.get())}scrollbar;root;#e=oe(!1);get isVisible(){return g(this.#e)}set isVisible(e){O(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Ft(()=>{const t=this.root.scrollAreaNode,n=this.root.opts.scrollHideDelay.current;let i=0;if(!t)return;const a=()=>{this.root.domContext.clearTimeout(i),dn(()=>this.isVisible=!0)},s=()=>{i&&this.root.domContext.clearTimeout(i),i=this.root.domContext.setTimeout(()=>{dn(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},n)},o=$s($r(t,"pointerenter",a),$r(t,"pointerleave",s));return()=>{this.root.domContext.getWindow().clearTimeout(i),o()}})}#t=j(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}class zm{static create(){return new zm(kh.get())}scrollbar;root;machine=new s4("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});#e=j(()=>this.machine.state.current==="hidden");get isHidden(){return g(this.#e)}set isHidden(e){O(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;const t=S0(()=>this.machine.dispatch("SCROLL_END"),100);Ft(()=>{const n=this.machine.state.current,i=this.root.opts.scrollHideDelay.current;if(n==="idle"){const a=this.root.domContext.setTimeout(()=>this.machine.dispatch("HIDE"),i);return()=>this.root.domContext.clearTimeout(a)}}),Ft(()=>{const n=this.root.viewportNode;if(!n)return;const i=this.scrollbar.isHorizontal?"scrollLeft":"scrollTop";let a=n[i];return gh(n,"scroll",()=>{const l=n[i];a!==l&&(this.machine.dispatch("SCROLL"),t()),a=l})}),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}onpointerenter(e){this.machine.dispatch("POINTER_ENTER")}onpointerleave(e){this.machine.dispatch("POINTER_LEAVE")}#t=j(()=>({"data-state":this.machine.state.current==="hidden"?"hidden":"visible",onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}class V0{static create(){return new V0(kh.get())}scrollbar;root;#e=oe(!1);get isVisible(){return g(this.#e)}set isVisible(e){O(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;const t=S0(()=>{const n=this.root.viewportNode;if(!n)return;const i=n.offsetWidth<n.scrollWidth,a=n.offsetHeight<n.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?i:a},10);new Yc(()=>this.root.viewportNode,t),new Yc(()=>this.root.contentNode,t)}#t=j(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}}class jm{static create(){return W0.set(new jm(kh.get()))}scrollbar;root;#e=oe(null);get thumbNode(){return g(this.#e)}set thumbNode(e){O(this.#e,e,!0)}#t=oe(0);get pointerOffset(){return g(this.#t)}set pointerOffset(e){O(this.#t,e,!0)}#r=oe({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return g(this.#r)}set sizes(e){O(this.#r,e)}#n=j(()=>s6(this.sizes.viewport,this.sizes.content));get thumbRatio(){return g(this.#n)}set thumbRatio(e){O(this.#n,e)}#a=j(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return g(this.#a)}set hasThumb(e){O(this.#a,e)}#i=oe("");get prevTransformStyle(){return g(this.#i)}set prevTransformStyle(e){O(this.#i,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Ft(()=>{this.scrollbar.hasThumb=this.hasThumb}),Ft(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return hN({pointerPos:e,pointerOffset:this.pointerOffset,sizes:this.sizes,dir:t})}onThumbPointerUp(){this.pointerOffset=0}onThumbPointerDown(e){this.pointerOffset=e}xOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const e=this.root.viewportNode.scrollLeft,n=`translate3d(${o6({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=n,this.prevTransformStyle=n}xOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=e)}xOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=this.getScrollPosition(e,this.root.opts.dir.current))}yOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const e=this.root.viewportNode.scrollTop,n=`translate3d(0, ${o6({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=n,this.prevTransformStyle=n}yOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=e)}yOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=this.getScrollPosition(e,this.root.opts.dir.current))}}class Hm{static create(e){return Fm.set(new Hm(e,W0.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=oe();get computedStyle(){return g(this.#e)}set computedStyle(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=rn(this.scrollbar.opts.ref,n=>this.root.scrollbarXNode=n),Ft(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Ft(()=>{this.onResize()})}onThumbPointerDown=e=>{this.scrollbarVis.onThumbPointerDown(e.x)};onDragScroll=e=>{this.scrollbarVis.xOnDragScroll(e.x)};onThumbPointerUp=()=>{this.scrollbarVis.onThumbPointerUp()};onThumbPositionChange=()=>{this.scrollbarVis.xOnThumbPositionChange()};onWheelScroll=(e,t)=>{if(!this.root.viewportNode)return;const n=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(n),c6(n,t)&&e.preventDefault()};onResize=()=>{this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollWidth,viewport:this.root.viewportNode.offsetWidth,scrollbar:{size:this.scrollbar.opts.ref.current.clientWidth,paddingStart:X0(this.computedStyle.paddingLeft),paddingEnd:X0(this.computedStyle.paddingRight)}})};#t=j(()=>$0(this.scrollbarVis.sizes));get thumbSize(){return g(this.#t)}set thumbSize(e){O(this.#t,e)}#r=j(()=>({id:this.scrollbar.opts.id.current,"data-orientation":"horizontal",style:{bottom:0,left:this.root.opts.dir.current==="rtl"?"var(--bits-scroll-area-corner-width)":0,right:this.root.opts.dir.current==="ltr"?"var(--bits-scroll-area-corner-width)":0,"--bits-scroll-area-thumb-width":`${this.thumbSize}px`},...this.attachment}));get props(){return g(this.#r)}set props(e){O(this.#r,e)}}class qm{static create(e){return Fm.set(new qm(e,W0.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=oe();get computedStyle(){return g(this.#e)}set computedStyle(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=rn(this.scrollbar.opts.ref,n=>this.root.scrollbarYNode=n),Ft(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Ft(()=>{this.onResize()}),this.onThumbPointerDown=this.onThumbPointerDown.bind(this),this.onDragScroll=this.onDragScroll.bind(this),this.onThumbPointerUp=this.onThumbPointerUp.bind(this),this.onThumbPositionChange=this.onThumbPositionChange.bind(this),this.onWheelScroll=this.onWheelScroll.bind(this),this.onResize=this.onResize.bind(this)}onThumbPointerDown(e){this.scrollbarVis.onThumbPointerDown(e.y)}onDragScroll(e){this.scrollbarVis.yOnDragScroll(e.y)}onThumbPointerUp(){this.scrollbarVis.onThumbPointerUp()}onThumbPositionChange(){this.scrollbarVis.yOnThumbPositionChange()}onWheelScroll(e,t){if(!this.root.viewportNode)return;const n=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(n),c6(n,t)&&e.preventDefault()}onResize(){this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollHeight,viewport:this.root.viewportNode.offsetHeight,scrollbar:{size:this.scrollbar.opts.ref.current.clientHeight,paddingStart:X0(this.computedStyle.paddingTop),paddingEnd:X0(this.computedStyle.paddingBottom)}})}#t=j(()=>$0(this.scrollbarVis.sizes));get thumbSize(){return g(this.#t)}set thumbSize(e){O(this.#t,e)}#r=j(()=>({id:this.scrollbar.opts.id.current,"data-orientation":"vertical",style:{top:0,right:this.root.opts.dir.current==="ltr"?0:void 0,left:this.root.opts.dir.current==="rtl"?0:void 0,bottom:"var(--bits-scroll-area-corner-height)","--bits-scroll-area-thumb-height":`${this.thumbSize}px`},...this.attachment}));get props(){return g(this.#r)}set props(e){O(this.#r,e)}}class Gm{static create(){return a6.set(new Gm(Fm.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=oe(null);get rect(){return g(this.#e)}set rect(e){O(this.#e,e)}#t=oe("");get prevWebkitUserSelect(){return g(this.#t)}set prevWebkitUserSelect(e){O(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#r=j(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return g(this.#r)}set maxScrollPos(e){O(this.#r,e)}constructor(e){this.scrollbarState=e,this.root=e.root,this.scrollbarVis=e.scrollbarVis,this.scrollbar=e.scrollbarVis.scrollbar,this.handleResize=S0(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,Ft(()=>{const t=this.maxScrollPos,n=this.scrollbar.opts.ref.current;this.root.viewportNode;const i=s=>{const o=s.target;n?.contains(o)&&this.handleWheelScroll(s,t)};return gh(this.root.domContext.getDocument(),"wheel",i,{passive:!1})}),yi(()=>{this.scrollbarVis.sizes,dn(()=>this.handleThumbPositionChange())}),new Yc(()=>this.scrollbar.opts.ref.current,this.handleResize),new Yc(()=>this.root.contentNode,this.handleResize),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerup=this.onpointerup.bind(this)}handleDragScroll(e){if(!this.rect)return;const t=e.clientX-this.rect.left,n=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:n})}onpointerdown(e){if(e.button!==0)return;e.target.setPointerCapture(e.pointerId),this.rect=this.scrollbar.opts.ref.current?.getBoundingClientRect()??null,this.prevWebkitUserSelect=this.root.domContext.getDocument().body.style.webkitUserSelect,this.root.domContext.getDocument().body.style.webkitUserSelect="none",this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior="auto"),this.handleDragScroll(e)}onpointermove(e){this.handleDragScroll(e)}onpointerup(e){const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.root.domContext.getDocument().body.style.webkitUserSelect=this.prevWebkitUserSelect,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=""),this.rect=null}#n=j(()=>rr({...this.scrollbarState.props,style:{position:"absolute",...this.scrollbarState.props.style},[xh.scrollbar]:"",onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup}));get props(){return g(this.#n)}set props(e){O(this.#n,e)}}class Wm{static create(e){return new Wm(e,a6.get())}opts;scrollbarState;attachment;#e;#t=oe();#r=S0(()=>{g(this.#t)&&(g(this.#t)(),O(this.#t,void 0))},100);constructor(e,t){this.opts=e,this.scrollbarState=t,this.#e=t.root,this.attachment=rn(this.opts.ref,n=>this.scrollbarState.scrollbarVis.thumbNode=n),Ft(()=>{const n=this.#e.viewportNode;if(!n)return;const i=()=>{if(this.#r(),!g(this.#t)){const s=dN(n,this.scrollbarState.handleThumbPositionChange);O(this.#t,s,!0),this.scrollbarState.handleThumbPositionChange()}};return dn(()=>this.scrollbarState.handleThumbPositionChange()),gh(n,"scroll",i)}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){const t=e.target;if(!t)return;const n=t.getBoundingClientRect(),i=e.clientX-n.left,a=e.clientY-n.top;this.scrollbarState.handleThumbPointerDown({x:i,y:a})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#n=j(()=>({id:this.opts.id.current,"data-state":this.scrollbarState.scrollbarVis.hasThumb?"visible":"hidden",style:{width:"var(--bits-scroll-area-thumb-width)",height:"var(--bits-scroll-area-thumb-height)",transform:this.scrollbarState.scrollbarVis.prevTransformStyle},onpointerdowncapture:this.onpointerdowncapture,onpointerup:this.onpointerup,[xh.thumb]:"",...this.attachment}));get props(){return g(this.#n)}set props(e){O(this.#n,e)}}class Vm{static create(e){return new Vm(e,Sh.get())}opts;root;attachment;#e=oe(0);#t=oe(0);#r=j(()=>!!(g(this.#e)&&g(this.#t)));get hasSize(){return g(this.#r)}set hasSize(e){O(this.#r,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(this.opts.ref),new Yc(()=>this.root.scrollbarXNode,()=>{const n=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=n,O(this.#t,n,!0)}),new Yc(()=>this.root.scrollbarYNode,()=>{const n=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=n,O(this.#e,n,!0)})}#n=j(()=>({id:this.opts.id.current,style:{width:g(this.#e),height:g(this.#t),position:"absolute",right:this.root.opts.dir.current==="ltr"?0:void 0,left:this.root.opts.dir.current==="rtl"?0:void 0,bottom:0},[xh.corner]:"",...this.attachment}));get props(){return g(this.#n)}set props(e){O(this.#n,e)}}function X0(r){return r?Number.parseInt(r,10):0}function s6(r,e){const t=r/e;return Number.isNaN(t)?0:t}function $0(r){const e=s6(r.viewport,r.content),t=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,n=(r.scrollbar.size-t)*e;return Math.max(n,18)}function hN({pointerPos:r,pointerOffset:e,sizes:t,dir:n="ltr"}){const i=$0(t),a=i/2,s=e||a,o=i-s,l=t.scrollbar.paddingStart+s,c=t.scrollbar.size-t.scrollbar.paddingEnd-o,u=t.content-t.viewport,h=n==="ltr"?[0,u]:[u*-1,0];return l6([l,c],h)(r)}function o6({scrollPos:r,sizes:e,dir:t="ltr"}){const n=$0(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=e.scrollbar.size-i,s=e.content-e.viewport,o=a-n,l=t==="ltr"?[0,s]:[s*-1,0],c=uN(r,l[0],l[1]);return l6([0,s],[0,o])(c)}function l6(r,e){return t=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const n=(e[1]-e[0])/(r[1]-r[0]);return e[0]+n*(t-r[0])}}function c6(r,e){return r>0&&r<e}function dN(r,e){let t={left:r.scrollLeft,top:r.scrollTop},n=0;const i=k0(r);return function a(){const s={left:r.scrollLeft,top:r.scrollTop},o=t.left!==s.left,l=t.top!==s.top;(o||l)&&e(),t=s,n=i.requestAnimationFrame(a)}(),()=>i.cancelAnimationFrame(n)}var fN=ee("<div><!></div>");function gN(r,e){const t=un();ge(e,!0);let n=L(e,"ref",15,null),i=L(e,"id",19,()=>hn(t)),a=L(e,"type",3,"hover"),s=L(e,"dir",3,"ltr"),o=L(e,"scrollHideDelay",3,600),l=De(e,["$$slots","$$events","$$legacy","ref","id","type","dir","scrollHideDelay","children","child"]);const c=Dm.create({type:fe.with(()=>a()),dir:fe.with(()=>s()),scrollHideDelay:fe.with(()=>o()),id:fe.with(()=>i()),ref:fe.with(()=>n(),m=>n(m))}),u=j(()=>rr(l,c.props));var h=J(),d=F(h);{var f=m=>{var y=J(),v=F(y);Te(v,()=>e.child,()=>({props:g(u)})),_(m,y)},p=m=>{var y=fN();Lt(y,()=>({...g(u)}));var v=te(y);Te(v,()=>e.children??Re),Q(y),_(m,y)};ce(d,m=>{e.child?m(f):m(p,!1)})}_(r,h),pe()}var pN=ee("<div><div><!></div></div>");function mN(r,e){const t=un();ge(e,!0);let n=L(e,"ref",15,null),i=L(e,"id",19,()=>hn(t)),a=De(e,["$$slots","$$events","$$legacy","ref","id","children"]);const s=Lm.create({id:fe.with(()=>i()),ref:fe.with(()=>n(),d=>n(d))}),o=j(()=>rr(a,s.props)),l=j(()=>rr({},s.contentProps));var c=pN();Lt(c,()=>({...g(o)}));var u=te(c);Lt(u,()=>({...g(l)}));var h=te(u);Te(h,()=>e.children??Re),Q(u),Q(c),_(r,c),pe()}var bN=ee("<div><!></div>");function u6(r,e){ge(e,!0);let t=De(e,["$$slots","$$events","$$legacy","child","children"]);const n=Gm.create(),i=j(()=>rr(t,n.props));var a=J(),s=F(a);{var o=c=>{var u=J(),h=F(u);Te(h,()=>e.child,()=>({props:g(i)})),_(c,u)},l=c=>{var u=bN();Lt(u,()=>({...g(i)}));var h=te(u);Te(h,()=>e.children??Re),Q(u),_(c,u)};ce(s,c=>{e.child?c(o):c(l,!1)})}_(r,a),pe()}function vN(r,e){ge(e,!0);let t=De(e,["$$slots","$$events","$$legacy"]);const n=new dp,i=Hm.create({mounted:fe.with(()=>n.current)}),a=j(()=>rr(t,i.props));u6(r,$e(()=>g(a))),pe()}function yN(r,e){ge(e,!0);let t=De(e,["$$slots","$$events","$$legacy"]);const n=new dp,i=qm.create({mounted:fe.with(()=>n.current)}),a=j(()=>rr(t,i.props));u6(r,$e(()=>g(a))),pe()}function K0(r,e){ge(e,!0);let t=De(e,["$$slots","$$events","$$legacy"]);const n=jm.create();var i=J(),a=F(i);{var s=l=>{vN(l,$e(()=>t))},o=l=>{yN(l,$e(()=>t))};ce(a,l=>{n.scrollbar.opts.orientation.current==="horizontal"?l(s):l(o,!1)})}_(r,i),pe()}function wN(r,e){ge(e,!0);let t=L(e,"forceMount",3,!1),n=De(e,["$$slots","$$events","$$legacy","forceMount"]);const i=V0.create(),a=j(()=>rr(n,i.props));{const s=l=>{K0(l,$e(()=>g(a)))};let o=j(()=>t()||i.isVisible);Ys(r,{get open(){return g(o)},get ref(){return i.scrollbar.opts.ref},presence:s,$$slots:{presence:!0}})}pe()}function xN(r,e){ge(e,!0);let t=L(e,"forceMount",3,!1),n=De(e,["$$slots","$$events","$$legacy","forceMount"]);const i=zm.create(),a=j(()=>rr(n,i.props));{const s=l=>{K0(l,$e(()=>g(a)))};let o=j(()=>t()||!i.isHidden);Ys(r,$e(()=>g(a),{get open(){return g(o)},get ref(){return i.scrollbar.opts.ref},presence:s,$$slots:{presence:!0}}))}pe()}function SN(r,e){ge(e,!0);let t=L(e,"forceMount",3,!1),n=De(e,["$$slots","$$events","$$legacy","forceMount"]);const i=Um.create(),a=V0.create(),s=j(()=>rr(n,i.props,a.props,{"data-state":i.isVisible?"visible":"hidden"})),o=j(()=>t()||i.isVisible&&a.isVisible);Ys(r,{get open(){return g(o)},get ref(){return a.scrollbar.opts.ref},presence:c=>{K0(c,$e(()=>g(s)))},$$slots:{presence:!0}}),pe()}function kN(r,e){const t=un();ge(e,!0);let n=L(e,"ref",15,null),i=L(e,"id",19,()=>hn(t)),a=De(e,["$$slots","$$events","$$legacy","ref","id","orientation"]);const s=Bm.create({orientation:fe.with(()=>e.orientation),id:fe.with(()=>i()),ref:fe.with(()=>n(),d=>n(d))}),o=j(()=>s.root.opts.type.current);var l=J(),c=F(l);{var u=d=>{SN(d,$e(()=>a,{get id(){return i()}}))},h=d=>{var f=J(),p=F(f);{var m=v=>{xN(v,$e(()=>a,{get id(){return i()}}))},y=v=>{var x=J(),S=F(x);{var A=k=>{wN(k,$e(()=>a,{get id(){return i()}}))},C=k=>{var I=J(),R=F(I);{var U=D=>{K0(D,$e(()=>a,{get id(){return i()}}))};ce(R,D=>{g(o)==="always"&&D(U)},!0)}_(k,I)};ce(S,k=>{g(o)==="auto"?k(A):k(C,!1)},!0)}_(v,x)};ce(p,v=>{g(o)==="scroll"?v(m):v(y,!1)},!0)}_(d,f)};ce(c,d=>{g(o)==="hover"?d(u):d(h,!1)})}_(r,l),pe()}var AN=ee("<div><!></div>");function _N(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","id","child","children","present"]);const i=new dp,a=Wm.create({id:fe.with(()=>e.id),ref:fe.with(()=>t(),h=>t(h)),mounted:fe.with(()=>i.current)}),s=j(()=>rr(n,a.props,{style:{hidden:!e.present}}));var o=J(),l=F(o);{var c=h=>{var d=J(),f=F(d);Te(f,()=>e.child,()=>({props:g(s)})),_(h,d)},u=h=>{var d=AN();Lt(d,()=>({...g(s)}));var f=te(d);Te(f,()=>e.children??Re),Q(d),_(h,d)};ce(l,h=>{e.child?h(c):h(u,!1)})}_(r,o),pe()}function CN(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"forceMount",3,!1),s=De(e,["$$slots","$$events","$$legacy","id","ref","forceMount"]);const o=W0.get();{const l=(u,h)=>{let d=()=>h?.().present;_N(u,$e(()=>s,{get id(){return n()},get present(){return d()},get ref(){return i()},set ref(f){i(f)}}))};let c=j(()=>a()||o.hasThumb);Ys(r,{get open(){return g(c)},get ref(){return o.scrollbar.opts.ref},presence:l,$$slots:{presence:!0}})}pe()}var EN=ee("<div><!></div>");function TN(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","id","children","child"]);const i=Vm.create({id:fe.with(()=>e.id),ref:fe.with(()=>t(),u=>t(u))}),a=j(()=>rr(n,i.props));var s=J(),o=F(s);{var l=u=>{var h=J(),d=F(h);Te(d,()=>e.child,()=>({props:g(a)})),_(u,h)},c=u=>{var h=EN();Lt(h,()=>({...g(a)}));var d=te(h);Te(d,()=>e.children??Re),Q(h),_(u,h)};ce(o,u=>{e.child?u(l):u(c,!1)})}_(r,s),pe()}function IN(r,e){const t=un();ge(e,!0);let n=L(e,"ref",15,null),i=L(e,"id",19,()=>hn(t)),a=De(e,["$$slots","$$events","$$legacy","ref","id"]);const s=Sh.get(),o=j(()=>!!(s.scrollbarXNode&&s.scrollbarYNode)),l=j(()=>s.opts.type.current!=="scroll"&&g(o));var c=J(),u=F(c);{var h=d=>{TN(d,$e(()=>a,{get id(){return i()},get ref(){return n()},set ref(f){n(f)}}))};ce(u,d=>{g(l)&&d(h)})}_(r,c),pe()}var MN=ee("<!> <!>",1);function ON(r,e){ge(e,!0);let t=L(e,"value",15),n=L(e,"onValueChange",3,br),i=L(e,"name",3,""),a=L(e,"disabled",3,!1),s=L(e,"open",15,!1),o=L(e,"onOpenChange",3,br),l=L(e,"onOpenChangeComplete",3,br),c=L(e,"loop",3,!1),u=L(e,"scrollAlignment",3,"nearest"),h=L(e,"required",3,!1),d=L(e,"items",19,()=>[]),f=L(e,"allowDeselect",3,!1);function p(){t()===void 0&&t(e.type==="single"?"":[])}p(),zr.pre(()=>t(),()=>{p()});let m=oe("");const y=cO.create({type:e.type,value:fe.with(()=>t(),k=>{t(k),n()(k)}),disabled:fe.with(()=>a()),required:fe.with(()=>h()),open:fe.with(()=>s(),k=>{s(k),o()(k)}),loop:fe.with(()=>c()),scrollAlignment:fe.with(()=>u()),name:fe.with(()=>i()),isCombobox:!1,items:fe.with(()=>d()),allowDeselect:fe.with(()=>f()),inputValue:fe.with(()=>g(m),k=>O(m,k,!0)),onOpenChangeComplete:fe.with(()=>l())});var v=MN(),x=F(v);gm(x,{children:(k,I)=>{var R=J(),U=F(R);Te(U,()=>e.children??Re),_(k,R)},$$slots:{default:!0}});var S=ae(x,2);{var A=k=>{var I=J(),R=F(I);{var U=D=>{var $=J(),H=F($);_n(H,16,()=>y.opts.value.current,V=>V,(V,z)=>{K4(V,{get value(){return z},get autocomplete(){return e.autocomplete}})}),_(D,$)};ce(R,D=>{y.opts.value.current.length&&D(U)})}_(k,I)},C=k=>{K4(k,{get autocomplete(){return e.autocomplete},get value(){return y.opts.value.current},set value(I){y.opts.value.current=I}})};ce(S,k=>{Array.isArray(y.opts.value.current)?k(A):k(C,!1)})}_(r,v),pe()}var NN=ee("<button><!></button>");function RN(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"type",3,"button"),s=De(e,["$$slots","$$events","$$legacy","id","ref","child","children","type"]);const o=mm.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),h=>i(h))}),l=j(()=>rr(s,o.props,{type:a()}));var c=J(),u=F(c);ve(u,()=>km,(h,d)=>{d(h,{get id(){return n()},get ref(){return o.opts.ref},children:(f,p)=>{var m=J(),y=F(m);{var v=S=>{var A=J(),C=F(A);Te(C,()=>e.child,()=>({props:g(l)})),_(S,A)},x=S=>{var A=NN();Lt(A,()=>({...g(l)}));var C=te(A);Te(C,()=>e.children??Re),Q(A),_(S,A)};ce(y,S=>{e.child?S(v):S(x,!1)})}_(f,m)},$$slots:{default:!0}})}),_(r,c),pe()}const PN={immediate:!0};class Xm{#e;#t;#r;#n=null;constructor(e,t,n={}){this.#r=e,this.#t=t,this.#e={...PN,...n},this.stop=this.stop.bind(this),this.start=this.start.bind(this),this.#e.immediate&&vi&&this.start(),Lo(this.stop)}#a(){this.#n!==null&&(window.clearTimeout(this.#n),this.#n=null)}stop(){this.#a()}start(...e){this.#a(),this.#n=window.setTimeout(()=>{this.#n=null,this.#r(...e)},this.#t)}}const h6=zo({component:"tooltip",parts:["content","trigger"]}),d6=new Gn("Tooltip.Provider"),$m=new Gn("Tooltip.Root");class Km{static create(e){return d6.set(new Km(e))}opts;#e=oe(!0);get isOpenDelayed(){return g(this.#e)}set isOpenDelayed(e){O(this.#e,e,!0)}isPointerInTransit=fe(!1);#t;#r=oe(null);constructor(e){this.opts=e,this.#t=new Xm(()=>{this.isOpenDelayed=!0},this.opts.skipDelayDuration.current,{immediate:!1})}#n=()=>{this.opts.skipDelayDuration.current!==0&&this.#t.start()};#a=()=>{this.#t.stop()};onOpen=e=>{g(this.#r)&&g(this.#r)!==e&&g(this.#r).handleClose(),this.#a(),this.isOpenDelayed=!1,O(this.#r,e,!0)};onClose=e=>{g(this.#r)===e&&O(this.#r,null),this.#n()};isTooltipOpen=e=>g(this.#r)===e}class Ym{static create(e){return $m.set(new Ym(e,d6.get()))}opts;provider;#e=j(()=>this.opts.delayDuration.current??this.provider.opts.delayDuration.current);get delayDuration(){return g(this.#e)}set delayDuration(e){O(this.#e,e)}#t=j(()=>this.opts.disableHoverableContent.current??this.provider.opts.disableHoverableContent.current);get disableHoverableContent(){return g(this.#t)}set disableHoverableContent(e){O(this.#t,e)}#r=j(()=>this.opts.disableCloseOnTriggerClick.current??this.provider.opts.disableCloseOnTriggerClick.current);get disableCloseOnTriggerClick(){return g(this.#r)}set disableCloseOnTriggerClick(e){O(this.#r,e)}#n=j(()=>this.opts.disabled.current??this.provider.opts.disabled.current);get disabled(){return g(this.#n)}set disabled(e){O(this.#n,e)}#a=j(()=>this.opts.ignoreNonKeyboardFocus.current??this.provider.opts.ignoreNonKeyboardFocus.current);get ignoreNonKeyboardFocus(){return g(this.#a)}set ignoreNonKeyboardFocus(e){O(this.#a,e)}#i=oe(null);get contentNode(){return g(this.#i)}set contentNode(e){O(this.#i,e,!0)}#s=oe(null);get triggerNode(){return g(this.#s)}set triggerNode(e){O(this.#s,e,!0)}#o=oe(!1);#l;#c=j(()=>this.opts.open.current?g(this.#o)?"delayed-open":"instant-open":"closed");get stateAttr(){return g(this.#c)}set stateAttr(e){O(this.#c,e)}constructor(e,t){this.opts=e,this.provider=t,this.#l=new Xm(()=>{O(this.#o,!0),this.opts.open.current=!0},this.delayDuration??0,{immediate:!1}),new dh({open:this.opts.open,ref:fe.with(()=>this.contentNode),onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),zr(()=>this.delayDuration,()=>{this.delayDuration!==void 0&&(this.#l=new Xm(()=>{O(this.#o,!0),this.opts.open.current=!0},this.delayDuration,{immediate:!1}))}),zr(()=>this.opts.open.current,n=>{n?this.provider.onOpen(this):this.provider.onClose(this)})}handleOpen=()=>{this.#l.stop(),O(this.#o,!1),this.opts.open.current=!0};handleClose=()=>{this.#l.stop(),this.opts.open.current=!1};#h=()=>{this.#l.stop();const e=!this.provider.isOpenDelayed,t=this.delayDuration??0;e||t===0?(O(this.#o,t>0&&e,!0),this.opts.open.current=!0):this.#l.start()};onTriggerEnter=()=>{this.#h()};onTriggerLeave=()=>{this.disableHoverableContent?this.handleClose():this.#l.stop()}}class Jm{static create(e){return new Jm(e,$m.get())}opts;root;attachment;#e=fe(!1);#t=oe(!1);#r=j(()=>this.opts.disabled.current||this.root.disabled);domContext;constructor(e,t){this.opts=e,this.root=t,this.domContext=new Bo(e.ref),this.attachment=rn(this.opts.ref,n=>this.root.triggerNode=n)}handlePointerUp=()=>{this.#e.current=!1};#n=()=>{g(this.#r)||(this.#e.current=!1)};#a=()=>{g(this.#r)||(this.#e.current=!0,this.domContext.getDocument().addEventListener("pointerup",()=>{this.handlePointerUp()},{once:!0}))};#i=e=>{g(this.#r)||e.pointerType!=="touch"&&(g(this.#t)||this.root.provider.isPointerInTransit.current||(this.root.onTriggerEnter(),O(this.#t,!0)))};#s=()=>{g(this.#r)||(this.root.onTriggerLeave(),O(this.#t,!1))};#o=e=>{this.#e.current||g(this.#r)||this.root.ignoreNonKeyboardFocus&&!GT(e.currentTarget)||this.root.handleOpen()};#l=()=>{g(this.#r)||this.root.handleClose()};#c=()=>{this.root.disableCloseOnTriggerClick||g(this.#r)||this.root.handleClose()};#h=j(()=>({id:this.opts.id.current,"aria-describedby":this.root.opts.open.current?this.root.contentNode?.id:void 0,"data-state":this.root.stateAttr,"data-disabled":hs(g(this.#r)),"data-delay-duration":`${this.root.delayDuration}`,[h6.trigger]:"",tabindex:g(this.#r)?void 0:0,disabled:this.opts.disabled.current,onpointerup:this.#n,onpointerdown:this.#a,onpointermove:this.#i,onpointerleave:this.#s,onfocus:this.#o,onblur:this.#l,onclick:this.#c,...this.attachment}));get props(){return g(this.#h)}set props(e){O(this.#h,e)}}class Qm{static create(e){return new Qm(e,$m.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=rn(this.opts.ref,n=>this.root.contentNode=n),new Z4({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&!this.root.disableHoverableContent,onPointerExit:()=>{this.root.provider.isTooltipOpen(this.root)&&this.root.handleClose()},setIsPointerInTransit:n=>{this.root.provider.isPointerInTransit.current=n},transitTimeout:this.root.provider.opts.skipDelayDuration.current}),fp(()=>$r(window,"scroll",n=>{const i=n.target;i&&i.contains(this.root.triggerNode)&&this.root.handleClose()}))}onInteractOutside=e=>{if(fh(e.target)&&this.root.triggerNode?.contains(e.target)&&this.root.disableCloseOnTriggerClick){e.preventDefault();return}this.opts.onInteractOutside.current(e),!e.defaultPrevented&&this.root.handleClose()};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current?.(e),!e.defaultPrevented&&this.root.handleClose()};onOpenAutoFocus=e=>{e.preventDefault()};onCloseAutoFocus=e=>{e.preventDefault()};#e=j(()=>({open:this.root.opts.open.current}));get snippetProps(){return g(this.#e)}set snippetProps(e){O(this.#e,e)}#t=j(()=>({id:this.opts.id.current,"data-state":this.root.stateAttr,"data-disabled":hs(this.root.disabled),style:{pointerEvents:"auto",outline:"none"},[h6.content]:"",...this.attachment}));get props(){return g(this.#t)}set props(e){O(this.#t,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus}}function FN(r,e){ge(e,!0);let t=L(e,"open",15,!1),n=L(e,"onOpenChange",3,br),i=L(e,"onOpenChangeComplete",3,br);Ym.create({open:fe.with(()=>t(),a=>{t(a),n()(a)}),delayDuration:fe.with(()=>e.delayDuration),disableCloseOnTriggerClick:fe.with(()=>e.disableCloseOnTriggerClick),disableHoverableContent:fe.with(()=>e.disableHoverableContent),ignoreNonKeyboardFocus:fe.with(()=>e.ignoreNonKeyboardFocus),disabled:fe.with(()=>e.disabled),onOpenChangeComplete:fe.with(()=>i())}),gm(r,{tooltip:!0,children:(a,s)=>{var o=J(),l=F(o);Te(l,()=>e.children??Re),_(a,o)},$$slots:{default:!0}}),pe()}var DN=ee("<div><div><!></div></div>"),LN=ee("<div><div><!></div></div>");function BN(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"ref",15,null),a=L(e,"side",3,"top"),s=L(e,"sideOffset",3,0),o=L(e,"align",3,"center"),l=L(e,"avoidCollisions",3,!0),c=L(e,"arrowPadding",3,0),u=L(e,"sticky",3,"partial"),h=L(e,"hideWhenDetached",3,!1),d=L(e,"collisionPadding",3,0),f=L(e,"onInteractOutside",3,br),p=L(e,"onEscapeKeydown",3,br),m=L(e,"forceMount",3,!1),y=De(e,["$$slots","$$events","$$legacy","children","child","id","ref","side","sideOffset","align","avoidCollisions","arrowPadding","sticky","hideWhenDetached","collisionPadding","onInteractOutside","onEscapeKeydown","forceMount"]);const v=Qm.create({id:fe.with(()=>n()),ref:fe.with(()=>i(),R=>i(R)),onInteractOutside:fe.with(()=>f()),onEscapeKeydown:fe.with(()=>p())}),x=j(()=>({side:a(),sideOffset:s(),align:o(),avoidCollisions:l(),arrowPadding:c(),sticky:u(),hideWhenDetached:h(),collisionPadding:d()})),S=j(()=>rr(y,g(x),v.props));var A=J(),C=F(A);{var k=R=>{_m(R,$e(()=>g(S),()=>v.popperProps,{get enabled(){return v.root.opts.open.current},get id(){return n()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!0,get ref(){return v.opts.ref},tooltip:!0,popper:(D,$)=>{let H=()=>$?.().props,V=()=>$?.().wrapperProps;var z=J();const Z=j(()=>rr(H(),{style:vh("tooltip")}));var q=F(z);{var re=ie=>{var P=J(),be=F(P);{let _e=j(()=>({props:g(Z),wrapperProps:V(),...v.snippetProps}));Te(be,()=>e.child,()=>g(_e))}_(ie,P)},X=ie=>{var P=DN();Lt(P,()=>({...V()}));var be=te(P);Lt(be,()=>({...g(Z)}));var _e=te(be);Te(_e,()=>e.children??Re),Q(be),Q(P),_(ie,P)};ce(q,ie=>{e.child?ie(re):ie(X,!1)})}_(D,z)},$$slots:{popper:!0}}))},I=R=>{var U=J(),D=F(U);{var $=H=>{Am(H,$e(()=>g(S),()=>v.popperProps,{get open(){return v.root.opts.open.current},get id(){return n()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!1,get ref(){return v.opts.ref},tooltip:!0,popper:(z,Z)=>{let q=()=>Z?.().props,re=()=>Z?.().wrapperProps;var X=J();const ie=j(()=>rr(q(),{style:vh("tooltip")}));var P=F(X);{var be=W=>{var me=J(),He=F(me);{let Xe=j(()=>({props:g(ie),wrapperProps:re(),...v.snippetProps}));Te(He,()=>e.child,()=>g(Xe))}_(W,me)},_e=W=>{var me=LN();Lt(me,()=>({...re()}));var He=te(me);Lt(He,()=>({...g(ie)}));var Xe=te(He);Te(Xe,()=>e.children??Re),Q(He),Q(me),_(W,me)};ce(P,W=>{e.child?W(be):W(_e,!1)})}_(z,X)},$$slots:{popper:!0}}))};ce(D,H=>{m()||H($)},!0)}_(R,U)};ce(C,R=>{m()?R(k):R(I,!1)})}_(r,A),pe()}var UN=ee("<button><!></button>");function zN(r,e){const t=un();ge(e,!0);let n=L(e,"id",19,()=>hn(t)),i=L(e,"disabled",3,!1),a=L(e,"type",3,"button"),s=L(e,"ref",15,null),o=De(e,["$$slots","$$events","$$legacy","children","child","id","disabled","type","ref"]);const l=Jm.create({id:fe.with(()=>n()),disabled:fe.with(()=>i()??!1),ref:fe.with(()=>s(),u=>s(u))}),c=j(()=>rr(o,l.props,{type:a()}));km(r,{get id(){return n()},get ref(){return l.opts.ref},tooltip:!0,children:(u,h)=>{var d=J(),f=F(d);{var p=y=>{var v=J(),x=F(v);Te(x,()=>e.child,()=>({props:g(c)})),_(y,v)},m=y=>{var v=UN();Lt(v,()=>({...g(c)}));var x=te(v);Te(x,()=>e.children??Re),Q(v),_(y,v)};ce(f,y=>{e.child?y(p):y(m,!1)})}_(u,d)},$$slots:{default:!0}}),pe()}function jN(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref"]);fO(r,$e(()=>n,{get ref(){return t()},set ref(i){t(i)}})),pe()}function HN(r,e){ge(e,!0);let t=L(e,"delayDuration",3,700),n=L(e,"disableCloseOnTriggerClick",3,!1),i=L(e,"disableHoverableContent",3,!1),a=L(e,"disabled",3,!1),s=L(e,"ignoreNonKeyboardFocus",3,!1),o=L(e,"skipDelayDuration",3,300);Km.create({delayDuration:fe.with(()=>t()),disableCloseOnTriggerClick:fe.with(()=>n()),disableHoverableContent:fe.with(()=>i()),disabled:fe.with(()=>a()),ignoreNonKeyboardFocus:fe.with(()=>s()),skipDelayDuration:fe.with(()=>o())});var l=J(),c=F(l);Te(c,()=>e.children??Re),_(r,l),pe()}let Ah=oe(!1);class Vo{static _refs=0;static _cleanup;constructor(){Ft(()=>(Vo._refs===0&&(Vo._cleanup=qu(()=>{const e=[],t=i=>{O(Ah,!1)},n=i=>{O(Ah,!0)};return e.push($r(document,"pointerdown",t,{capture:!0}),$r(document,"pointermove",t,{capture:!0}),$r(document,"keydown",n,{capture:!0})),$s(...e)})),Vo._refs++,()=>{Vo._refs--,Vo._refs===0&&(O(Ah,!1),Vo._cleanup?.())}))}get current(){return g(Ah)}set current(e){O(Ah,e,!0)}}const Zm="-",qN=r=>{const e=WN(r),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=r;return{getClassGroupId:s=>{const o=s.split(Zm);return o[0]===""&&o.length!==1&&o.shift(),f6(o,e)||GN(s)},getConflictingClassGroupIds:(s,o)=>{const l=t[s]||[];return o&&n[s]?[...l,...n[s]]:l}}},f6=(r,e)=>{if(r.length===0)return e.classGroupId;const t=r[0],n=e.nextPart.get(t),i=n?f6(r.slice(1),n):void 0;if(i)return i;if(e.validators.length===0)return;const a=r.join(Zm);return e.validators.find(({validator:s})=>s(a))?.classGroupId},g6=/^\[(.+)\]$/,GN=r=>{if(g6.test(r)){const e=g6.exec(r)[1],t=e?.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},WN=r=>{const{theme:e,classGroups:t}=r,n={nextPart:new Map,validators:[]};for(const i in t)e2(t[i],n,i,e);return n},e2=(r,e,t,n)=>{r.forEach(i=>{if(typeof i=="string"){const a=i===""?e:p6(e,i);a.classGroupId=t;return}if(typeof i=="function"){if(VN(i)){e2(i(n),e,t,n);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([a,s])=>{e2(s,p6(e,a),t,n)})})},p6=(r,e)=>{let t=r;return e.split(Zm).forEach(n=>{t.nextPart.has(n)||t.nextPart.set(n,{nextPart:new Map,validators:[]}),t=t.nextPart.get(n)}),t},VN=r=>r.isThemeGetter,XN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,n=new Map;const i=(a,s)=>{t.set(a,s),e++,e>r&&(e=0,n=t,t=new Map)};return{get(a){let s=t.get(a);if(s!==void 0)return s;if((s=n.get(a))!==void 0)return i(a,s),s},set(a,s){t.has(a)?t.set(a,s):i(a,s)}}},t2="!",r2=":",$N=r2.length,KN=r=>{const{prefix:e,experimentalParseClassName:t}=r;let n=i=>{const a=[];let s=0,o=0,l=0,c;for(let p=0;p<i.length;p++){let m=i[p];if(s===0&&o===0){if(m===r2){a.push(i.slice(l,p)),l=p+$N;continue}if(m==="/"){c=p;continue}}m==="["?s++:m==="]"?s--:m==="("?o++:m===")"&&o--}const u=a.length===0?i:i.substring(l),h=YN(u),d=h!==u,f=c&&c>l?c-l:void 0;return{modifiers:a,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}};if(e){const i=e+r2,a=n;n=s=>s.startsWith(i)?a(s.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(t){const i=n;n=a=>t({className:a,parseClassName:i})}return n},YN=r=>r.endsWith(t2)?r.substring(0,r.length-1):r.startsWith(t2)?r.substring(1):r,JN=r=>{const e=Object.fromEntries(r.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const i=[];let a=[];return n.forEach(s=>{s[0]==="["||e[s]?(i.push(...a.sort(),s),a=[]):a.push(s)}),i.push(...a.sort()),i}},QN=r=>({cache:XN(r.cacheSize),parseClassName:KN(r),sortModifiers:JN(r),...qN(r)}),ZN=/\s+/,eR=(r,e)=>{const{parseClassName:t,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a}=e,s=[],o=r.trim().split(ZN);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{isExternal:h,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=t(u);if(h){l=u+(l.length>0?" "+l:l);continue}let y=!!m,v=n(y?p.substring(0,m):p);if(!v){if(!y){l=u+(l.length>0?" "+l:l);continue}if(v=n(p),!v){l=u+(l.length>0?" "+l:l);continue}y=!1}const x=a(d).join(":"),S=f?x+t2:x,A=S+v;if(s.includes(A))continue;s.push(A);const C=i(v,y);for(let k=0;k<C.length;++k){const I=C[k];s.push(S+I)}l=u+(l.length>0?" "+l:l)}return l};function tR(){let r=0,e,t,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=m6(e))&&(n&&(n+=" "),n+=t);return n}const m6=r=>{if(typeof r=="string")return r;let e,t="";for(let n=0;n<r.length;n++)r[n]&&(e=m6(r[n]))&&(t&&(t+=" "),t+=e);return t};function rR(r,...e){let t,n,i,a=s;function s(l){const c=e.reduce((u,h)=>h(u),r());return t=QN(c),n=t.cache.get,i=t.cache.set,a=o,o(l)}function o(l){const c=n(l);if(c)return c;const u=eR(l,t);return i(l,u),u}return function(){return a(tR.apply(null,arguments))}}const Zn=r=>{const e=t=>t[r]||[];return e.isThemeGetter=!0,e},b6=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,v6=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nR=/^\d+\/\d+$/,iR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aR=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jc=r=>nR.test(r),Lr=r=>!!r&&!Number.isNaN(Number(r)),Xo=r=>!!r&&Number.isInteger(Number(r)),n2=r=>r.endsWith("%")&&Lr(r.slice(0,-1)),Zs=r=>iR.test(r),cR=()=>!0,uR=r=>aR.test(r)&&!sR.test(r),y6=()=>!1,hR=r=>oR.test(r),dR=r=>lR.test(r),fR=r=>!qt(r)&&!Gt(r),gR=r=>Qc(r,A6,y6),qt=r=>b6.test(r),jl=r=>Qc(r,_6,uR),i2=r=>Qc(r,yR,Lr),w6=r=>Qc(r,S6,y6),pR=r=>Qc(r,k6,dR),Y0=r=>Qc(r,C6,hR),Gt=r=>v6.test(r),_h=r=>Zc(r,_6),mR=r=>Zc(r,wR),x6=r=>Zc(r,S6),bR=r=>Zc(r,A6),vR=r=>Zc(r,k6),J0=r=>Zc(r,C6,!0),Qc=(r,e,t)=>{const n=b6.exec(r);return n?n[1]?e(n[1]):t(n[2]):!1},Zc=(r,e,t=!1)=>{const n=v6.exec(r);return n?n[1]?e(n[1]):t:!1},S6=r=>r==="position"||r==="percentage",k6=r=>r==="image"||r==="url",A6=r=>r==="length"||r==="size"||r==="bg-size",_6=r=>r==="length",yR=r=>r==="number",wR=r=>r==="family-name",C6=r=>r==="shadow",xR=rR(()=>{const r=Zn("color"),e=Zn("font"),t=Zn("text"),n=Zn("font-weight"),i=Zn("tracking"),a=Zn("leading"),s=Zn("breakpoint"),o=Zn("container"),l=Zn("spacing"),c=Zn("radius"),u=Zn("shadow"),h=Zn("inset-shadow"),d=Zn("text-shadow"),f=Zn("drop-shadow"),p=Zn("blur"),m=Zn("perspective"),y=Zn("aspect"),v=Zn("ease"),x=Zn("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...A(),Gt,qt],k=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],R=()=>[Gt,qt,l],U=()=>[Jc,"full","auto",...R()],D=()=>[Xo,"none","subgrid",Gt,qt],$=()=>["auto",{span:["full",Xo,Gt,qt]},Xo,Gt,qt],H=()=>[Xo,"auto",Gt,qt],V=()=>["auto","min","max","fr",Gt,qt],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...R()],re=()=>[Jc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],X=()=>[r,Gt,qt],ie=()=>[...A(),x6,w6,{position:[Gt,qt]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],be=()=>["auto","cover","contain",bR,gR,{size:[Gt,qt]}],_e=()=>[n2,_h,jl],W=()=>["","none","full",c,Gt,qt],me=()=>["",Lr,_h,jl],He=()=>["solid","dashed","dotted","double"],Xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Le=()=>[Lr,n2,x6,w6],bt=()=>["","none",p,Gt,qt],Ie=()=>["none",Lr,Gt,qt],Ve=()=>["none",Lr,Gt,qt],We=()=>[Lr,Gt,qt],Qe=()=>[Jc,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Zs],breakpoint:[Zs],color:[cR],container:[Zs],"drop-shadow":[Zs],ease:["in","out","in-out"],font:[fR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Zs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Zs],shadow:[Zs],spacing:["px",Lr],text:[Zs],"text-shadow":[Zs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jc,qt,Gt,y]}],container:["container"],columns:[{columns:[Lr,qt,Gt,o]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[Xo,"auto",Gt,qt]}],basis:[{basis:[Jc,"full","auto",o,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Lr,Jc,"auto","initial","none",qt]}],grow:[{grow:["",Lr,Gt,qt]}],shrink:[{shrink:["",Lr,Gt,qt]}],order:[{order:[Xo,"first","last","none",Gt,qt]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],w:[{w:[o,"screen",...re()]}],"min-w":[{"min-w":[o,"screen","none",...re()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",t,_h,jl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Gt,i2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",n2,qt]}],"font-family":[{font:[mR,qt,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Gt,qt]}],"line-clamp":[{"line-clamp":[Lr,"none",Gt,i2]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",Gt,qt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Gt,qt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...He(),"wavy"]}],"text-decoration-thickness":[{decoration:[Lr,"from-font","auto",Gt,jl]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[Lr,"auto",Gt,qt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Gt,qt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Gt,qt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:be()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xo,Gt,qt],radial:["",Gt,qt],conic:[Xo,Gt,qt]},vR,pR]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:_e()}],"gradient-via-pos":[{via:_e()}],"gradient-to-pos":[{to:_e()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...He(),"hidden","none"]}],"divide-style":[{divide:[...He(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...He(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Lr,Gt,qt]}],"outline-w":[{outline:["",Lr,_h,jl]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",u,J0,Y0]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",h,J0,Y0]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[Lr,jl]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",d,J0,Y0]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[Lr,Gt,qt]}],"mix-blend":[{"mix-blend":[...Xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Lr]}],"mask-image-linear-from-pos":[{"mask-linear-from":Le()}],"mask-image-linear-to-pos":[{"mask-linear-to":Le()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":Le()}],"mask-image-t-to-pos":[{"mask-t-to":Le()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":Le()}],"mask-image-r-to-pos":[{"mask-r-to":Le()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":Le()}],"mask-image-b-to-pos":[{"mask-b-to":Le()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":Le()}],"mask-image-l-to-pos":[{"mask-l-to":Le()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":Le()}],"mask-image-x-to-pos":[{"mask-x-to":Le()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":Le()}],"mask-image-y-to-pos":[{"mask-y-to":Le()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[Gt,qt]}],"mask-image-radial-from-pos":[{"mask-radial-from":Le()}],"mask-image-radial-to-pos":[{"mask-radial-to":Le()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Lr]}],"mask-image-conic-from-pos":[{"mask-conic-from":Le()}],"mask-image-conic-to-pos":[{"mask-conic-to":Le()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:be()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Gt,qt]}],filter:[{filter:["","none",Gt,qt]}],blur:[{blur:bt()}],brightness:[{brightness:[Lr,Gt,qt]}],contrast:[{contrast:[Lr,Gt,qt]}],"drop-shadow":[{"drop-shadow":["","none",f,J0,Y0]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",Lr,Gt,qt]}],"hue-rotate":[{"hue-rotate":[Lr,Gt,qt]}],invert:[{invert:["",Lr,Gt,qt]}],saturate:[{saturate:[Lr,Gt,qt]}],sepia:[{sepia:["",Lr,Gt,qt]}],"backdrop-filter":[{"backdrop-filter":["","none",Gt,qt]}],"backdrop-blur":[{"backdrop-blur":bt()}],"backdrop-brightness":[{"backdrop-brightness":[Lr,Gt,qt]}],"backdrop-contrast":[{"backdrop-contrast":[Lr,Gt,qt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Lr,Gt,qt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Lr,Gt,qt]}],"backdrop-invert":[{"backdrop-invert":["",Lr,Gt,qt]}],"backdrop-opacity":[{"backdrop-opacity":[Lr,Gt,qt]}],"backdrop-saturate":[{"backdrop-saturate":[Lr,Gt,qt]}],"backdrop-sepia":[{"backdrop-sepia":["",Lr,Gt,qt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Gt,qt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Lr,"initial",Gt,qt]}],ease:[{ease:["linear","initial",v,Gt,qt]}],delay:[{delay:[Lr,Gt,qt]}],animate:[{animate:["none",x,Gt,qt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Gt,qt]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:Ie()}],"rotate-x":[{"rotate-x":Ie()}],"rotate-y":[{"rotate-y":Ie()}],"rotate-z":[{"rotate-z":Ie()}],scale:[{scale:Ve()}],"scale-x":[{"scale-x":Ve()}],"scale-y":[{"scale-y":Ve()}],"scale-z":[{"scale-z":Ve()}],"scale-3d":["scale-3d"],skew:[{skew:We()}],"skew-x":[{"skew-x":We()}],"skew-y":[{"skew-y":We()}],transform:[{transform:[Gt,qt,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Gt,qt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Gt,qt]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[Lr,_h,jl,i2]}],stroke:[{stroke:["none",...X()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Qt(...r){return xR(Ku(r))}function Q0(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("text-lg leading-none font-semibold",e.class));ve(a,()=>Ep,(o,l)=>{l(o,$e({"data-slot":"dialog-title",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}var SR=ee("<div><!></div>");function kR(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=SR();Lt(i,s=>({"data-slot":"dialog-footer",class:s,...n}),[()=>Qt("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}var AR=ee("<div><!></div>");function E6(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=AR();Lt(i,s=>({"data-slot":"dialog-header",class:s,...n}),[()=>Qt("flex flex-col gap-2 text-center sm:text-left",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}function T6(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e.class));ve(a,()=>Hp,(o,l)=>{l(o,$e({"data-slot":"dialog-overlay",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/const _R={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var CR=Ml("<svg><!><!></svg>");function gr(r,e){ge(e,!0);const t=L(e,"color",3,"currentColor"),n=L(e,"size",3,24),i=L(e,"strokeWidth",3,2),a=L(e,"absoluteStrokeWidth",3,!1),s=L(e,"iconNode",19,()=>[]),o=De(e,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]);var l=CR();Lt(l,h=>({..._R,...o,width:n(),height:n(),stroke:t(),"stroke-width":h,class:["lucide-icon lucide",e.name&&`lucide-${e.name}`,e.class]}),[()=>a()?Number(i())*24/Number(n()):i()]);var c=te(l);_n(c,17,s,B9,(h,d)=>{var f=j(()=>pA(g(d),2));let p=()=>g(f)[0],m=()=>g(f)[1];var y=J(),v=F(y);j9(v,p,!0,(x,S)=>{Lt(x,()=>({...m()}))}),_(h,y)});var u=ae(c);Te(u,()=>e.children??Re),Q(l),_(r,l),pe()}function eo(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];gr(r,$e({name:"x"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}var ER=ee('<!> <span class="sr-only">Close</span>',1),TR=ee("<!> <!>",1),IR=ee("<!> <!>",1);function a2(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"showCloseButton",3,!0),i=De(e,["$$slots","$$events","$$legacy","ref","class","portalProps","children","showCloseButton"]);var a=J(),s=F(a);ve(s,()=>I6,(o,l)=>{l(o,$e(()=>e.portalProps,{children:(c,u)=>{var h=IR(),d=F(h);ve(d,()=>T6,(p,m)=>{m(p,{})});var f=ae(d,2);{let p=j(()=>Qt("fixed top-[50%] left-[50%] z-50 grid max-h-[100dvh] w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto rounded-lg border border-border/30 bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg md:max-h-[100vh]",e.class));ve(f,()=>i6,(m,y)=>{y(m,$e({"data-slot":"dialog-content",get class(){return g(p)}},()=>i,{get ref(){return t()},set ref(v){t(v)},children:(v,x)=>{var S=TR(),A=F(S);Te(A,()=>e.children??Re);var C=ae(A,2);{var k=I=>{var R=J(),U=F(R);ve(U,()=>n6,(D,$)=>{$(D,{class:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:(H,V)=>{var z=ER(),Z=F(z);eo(Z,{}),Rt(2),_(H,z)},$$slots:{default:!0}})}),_(I,R)};ce(C,I=>{n()&&I(k)})}_(v,S)},$$slots:{default:!0}}))})}_(c,h)},$$slots:{default:!0}}))}),_(r,a),pe()}function MR(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("text-sm text-muted-foreground",e.class));ve(a,()=>qp,(o,l)=>{l(o,$e({"data-slot":"dialog-description",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}const s2=r6,I6=Ll;function OR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M9 18v-6H5l7-7 7 7h-4v6H9z"}]];gr(r,$e({name:"arrow-big-up"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function NR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]];gr(r,$e({name:"arrow-up"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function M6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18"}]];gr(r,$e({name:"brain"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function Z0(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M20 6 9 17l-5-5"}]];gr(r,$e({name:"check"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function o2(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m6 9 6 6 6-6"}]];gr(r,$e({name:"chevron-down"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function O6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m15 18-6-6 6-6"}]];gr(r,$e({name:"chevron-left"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function RR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m18 15-6-6-6 6"}]];gr(r,$e({name:"chevron-up"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function N6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m9 18 6-6-6-6"}]];gr(r,$e({name:"chevron-right"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function PR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m7 15 5 5 5-5"}],["path",{d:"m7 9 5-5 5 5"}]];gr(r,$e({name:"chevrons-up-down"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function FR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];gr(r,$e({name:"circle-check-big"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function DR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m15 9-6 6"}],["path",{d:"m9 9 6 6"}]];gr(r,$e({name:"circle-x"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function LR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m16 18 6-6-6-6"}],["path",{d:"m8 6-6 6 6 6"}]];gr(r,$e({name:"code"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function R6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];gr(r,$e({name:"copy"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function BR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5"}],["path",{d:"M3 12A9 3 0 0 0 21 12"}]];gr(r,$e({name:"database"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function P6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];gr(r,$e({name:"download"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function UR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];gr(r,$e({name:"ellipsis"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function F6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];gr(r,$e({name:"eye"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function Ch(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]];gr(r,$e({name:"file-text"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function zR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["path",{d:"m14.5 12.5-5 5"}],["path",{d:"m9.5 12.5 5 5"}]];gr(r,$e({name:"file-x"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function D6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}]];gr(r,$e({name:"file"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function jR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z"}]];gr(r,$e({name:"funnel"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function L6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];gr(r,$e({name:"image"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function HR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"}],["path",{d:"m21 2-9.6 9.6"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5"}]];gr(r,$e({name:"key"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function l2(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];gr(r,$e({name:"loader-circle"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function B6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22"}]];gr(r,$e({name:"mic"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function qR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M5 12h14"}]];gr(r,$e({name:"minus"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function GR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21"}]];gr(r,$e({name:"monitor"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function WR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"}]];gr(r,$e({name:"moon"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function U6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M9 18V5l12-2v13"}],["circle",{cx:"6",cy:"18",r:"3"}],["circle",{cx:"18",cy:"16",r:"3"}]];gr(r,$e({name:"music"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function VR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"}],["path",{d:"M12 22V12"}],["polyline",{points:"3.29 7 12 12 20.71 7"}],["path",{d:"m7.5 4.27 9 5.15"}]];gr(r,$e({name:"package"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function XR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}]];gr(r,$e({name:"panel-left"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function $R(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"}]];gr(r,$e({name:"paperclip"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function KR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];gr(r,$e({name:"pencil"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function eu(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}],["path",{d:"M8 16H3v5"}]];gr(r,$e({name:"refresh-cw"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function c2(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]];gr(r,$e({name:"rotate-ccw"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function u2(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];gr(r,$e({name:"search"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function h2(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18"}]];gr(r,$e({name:"server"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function z6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}],["circle",{cx:"12",cy:"12",r:"3"}]];gr(r,$e({name:"settings"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function j6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"}]];gr(r,$e({name:"square-pen"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function YR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];gr(r,$e({name:"square"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function JR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]];gr(r,$e({name:"sun"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function QR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M10 2h4"}],["path",{d:"M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7"}],["path",{d:"M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2"}],["path",{d:"m2 2 20 20"}],["path",{d:"M12 12v-2"}]];gr(r,$e({name:"timer-off"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function Eh(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M3 6h18"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17"}]];gr(r,$e({name:"trash-2"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function Th(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];gr(r,$e({name:"triangle-alert"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function H6(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];gr(r,$e({name:"upload"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function ZR(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"}],["path",{d:"M16 9a5 5 0 0 1 0 6"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728"}]];gr(r,$e({name:"volume-2"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}function eP(r,e){ge(e,!0);/**
* @license @lucide/svelte v0.515.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/let t=De(e,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"}]];gr(r,$e({name:"wrench"},()=>t,{get iconNode(){return n},children:(i,a)=>{var s=J(),o=F(s);Te(o,()=>e.children??Re),_(i,s)},$$slots:{default:!0}})),pe()}const Di=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),d2=[.001,0,0,.001,0,0],f2=1.35,pa={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},$o={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},q6="pdfjs_internal_editor_",xr={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101,COMMENT:102},Jr={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},tP={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},_i={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},ef={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Wn={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},tu={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},tf={ERRORS:0,WARNINGS:1,INFOS:5},rf={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},nf={moveTo:0,lineTo:1,curveTo:2,closePath:3},rP={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let af=tf.WARNINGS;function nP(r){Number.isInteger(r)&&(af=r)}function iP(){return af}function sf(r){af>=tf.INFOS&&console.log(`Info: ${r}`)}function Sr(r){af>=tf.WARNINGS&&console.log(`Warning: ${r}`)}function pn(r){throw new Error(r)}function Vn(r,e){r||pn(e)}function aP(r){switch(r?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function G6(r,e=null,t=null){if(!r)return null;if(t&&typeof r=="string"&&(t.addDefaultProtocol&&r.startsWith("www.")&&r.match(/\./g)?.length>=2&&(r=`http://${r}`),t.tryConvertEncoding))try{r=uP(r)}catch{}const n=e?URL.parse(r,e):URL.parse(r);return aP(n)?n:null}function W6(r,e,t=!1){const n=URL.parse(r);return n?(n.hash=e,n.href):t&&G6(r,"http://example.com")?r.split("#",1)[0]+`${e?`#${e}`:""}`:""}function jr(r,e,t,n=!1){return Object.defineProperty(r,e,{value:t,enumerable:!n,configurable:!0,writable:!1}),t}const Hl=function(){function e(t,n){this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}();class V6 extends Hl{constructor(e,t){super(e,"PasswordException"),this.code=t}}class g2 extends Hl{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class p2 extends Hl{constructor(e){super(e,"InvalidPDFException")}}class of extends Hl{constructor(e,t,n){super(e,"ResponseException"),this.status=t,this.missing=n}}class sP extends Hl{constructor(e){super(e,"FormatError")}}class Ko extends Hl{constructor(e){super(e,"AbortException")}}function X6(r){(typeof r!="object"||r?.length===void 0)&&pn("Invalid argument for bytesToString");const e=r.length,t=8192;if(e<t)return String.fromCharCode.apply(null,r);const n=[];for(let i=0;i<e;i+=t){const a=Math.min(i+t,e),s=r.subarray(i,a);n.push(String.fromCharCode.apply(null,s))}return n.join("")}function Ih(r){typeof r!="string"&&pn("Invalid argument for stringToBytes");const e=r.length,t=new Uint8Array(e);for(let n=0;n<e;++n)t[n]=r.charCodeAt(n)&255;return t}function oP(r){return String.fromCharCode(r>>24&255,r>>16&255,r>>8&255,r&255)}function lP(){const r=new Uint8Array(4);return r[0]=1,new Uint32Array(r.buffer,0,1)[0]===1}function cP(){try{return new Function(""),!0}catch{return!1}}class fi{static get isLittleEndian(){return jr(this,"isLittleEndian",lP())}static get isEvalSupported(){return jr(this,"isEvalSupported",cP())}static get isOffscreenCanvasSupported(){return jr(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return jr(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:e,userAgent:t}=navigator;return jr(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){return jr(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const m2=Array.from(Array(256).keys(),r=>r.toString(16).padStart(2,"0"));class nr{static makeHexColor(e,t,n){return`#${m2[e]}${m2[t]}${m2[n]}`}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[1],t[1]=n,n=t[2],t[2]=t[3],t[3]=n,e[1]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t,n=0){const i=e[n],a=e[n+1];e[n]=i*t[0]+a*t[2]+t[4],e[n+1]=i*t[1]+a*t[3]+t[5]}static applyTransformToBezier(e,t,n=0){const i=t[0],a=t[1],s=t[2],o=t[3],l=t[4],c=t[5];for(let u=0;u<6;u+=2){const h=e[n+u],d=e[n+u+1];e[n+u]=h*i+d*s+l,e[n+u+1]=h*a+d*o+c}}static applyInverseTransform(e,t){const n=e[0],i=e[1],a=t[0]*t[3]-t[1]*t[2];e[0]=(n*t[3]-i*t[2]+t[2]*t[5]-t[4]*t[3])/a,e[1]=(-n*t[1]+i*t[0]+t[4]*t[1]-t[5]*t[0])/a}static axialAlignedBoundingBox(e,t,n){const i=t[0],a=t[1],s=t[2],o=t[3],l=t[4],c=t[5],u=e[0],h=e[1],d=e[2],f=e[3];let p=i*u+l,m=p,y=i*d+l,v=y,x=o*h+c,S=x,A=o*f+c,C=A;if(a!==0||s!==0){const k=a*u,I=a*d,R=s*h,U=s*f;p+=R,v+=R,y+=U,m+=U,x+=k,C+=k,A+=I,S+=I}n[0]=Math.min(n[0],p,y,m,v),n[1]=Math.min(n[1],x,A,S,C),n[2]=Math.max(n[2],p,y,m,v),n[3]=Math.max(n[3],x,A,S,C)}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){const n=e[0],i=e[1],a=e[2],s=e[3],o=n**2+i**2,l=n*a+i*s,c=a**2+s**2,u=(o+c)/2,h=Math.sqrt(u**2-(o*c-l**2));t[0]=Math.sqrt(u+h||1),t[1]=Math.sqrt(u-h||1)}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>i)return null;const a=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return a>s?null:[n,a,i,s]}static pointBoundingBox(e,t,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}static rectBoundingBox(e,t,n,i,a){a[0]=Math.min(a[0],e,n),a[1]=Math.min(a[1],t,i),a[2]=Math.max(a[2],e,n),a[3]=Math.max(a[3],t,i)}static#e(e,t,n,i,a,s,o,l,c,u){if(c<=0||c>=1)return;const h=1-c,d=c*c,f=d*c,p=h*(h*(h*e+3*c*t)+3*d*n)+f*i,m=h*(h*(h*a+3*c*s)+3*d*o)+f*l;u[0]=Math.min(u[0],p),u[1]=Math.min(u[1],m),u[2]=Math.max(u[2],p),u[3]=Math.max(u[3],m)}static#t(e,t,n,i,a,s,o,l,c,u,h,d){if(Math.abs(c)<1e-12){Math.abs(u)>=1e-12&&this.#e(e,t,n,i,a,s,o,l,-h/u,d);return}const f=u**2-4*h*c;if(f<0)return;const p=Math.sqrt(f),m=2*c;this.#e(e,t,n,i,a,s,o,l,(-u+p)/m,d),this.#e(e,t,n,i,a,s,o,l,(-u-p)/m,d)}static bezierBoundingBox(e,t,n,i,a,s,o,l,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,l),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,l),this.#t(e,n,a,o,t,i,s,l,3*(-e+3*(n-a)+o),6*(e-2*n+a),3*(n-e),c),this.#t(e,n,a,o,t,i,s,l,3*(-t+3*(i-s)+l),6*(t-2*i+s),3*(i-t),c)}}function uP(r){return decodeURIComponent(escape(r))}let b2=null,$6=null;function hP(r){return b2||(b2=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,$6=new Map([["ſt","ſt"]])),r.replaceAll(b2,(e,t,n)=>t?t.normalize("NFKC"):$6.get(n))}function K6(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const r=new Uint8Array(32);return crypto.getRandomValues(r),X6(r)}const v2="pdfjs_internal_id_";function dP(r,e,t){if(!Array.isArray(t)||t.length<2)return!1;const[n,i,...a]=t;if(!r(n)&&!Number.isInteger(n)||!e(i))return!1;const s=a.length;let o=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return s===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(s!==4)return!1;o=!1;break;default:return!1}for(const l of a)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function Li(r,e,t){return Math.min(Math.max(r,e),t)}function Y6(r){return Uint8Array.prototype.toBase64?r.toBase64():btoa(X6(r))}function fP(r){return Uint8Array.fromBase64?Uint8Array.fromBase64(r):Ih(atob(r))}typeof Promise.try!="function"&&(Promise.try=function(r,...e){return new Promise(t=>{t(r(...e))})}),typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(r){return r.reduce((e,t)=>e+t,0)});const to="http://www.w3.org/2000/svg";class ru{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function Mh(r,e="text"){if(Nh(r,document.baseURI)){const t=await fetch(r);if(!t.ok)throw new Error(t.statusText);switch(e){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json()}return t.text()}return new Promise((t,n)=>{const i=new XMLHttpRequest;i.open("GET",r,!0),i.responseType=e,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(e){case"arraybuffer":case"blob":case"json":t(i.response);return}t(i.responseText);return}n(new Error(i.statusText))}},i.send(null)})}class Oh{constructor({viewBox:e,userUnit:t,scale:n,rotation:i,offsetX:a=0,offsetY:s=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=i,this.offsetX=a,this.offsetY=s,n*=t;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let u,h,d,f;switch(i%=360,i<0&&(i+=360),i){case 180:u=-1,h=0,d=0,f=1;break;case 90:u=0,h=1,d=1,f=0;break;case 270:u=0,h=-1,d=-1,f=0;break;case 0:u=1,h=0,d=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(d=-d,f=-f);let p,m,y,v;u===0?(p=Math.abs(c-e[1])*n+a,m=Math.abs(l-e[0])*n+s,y=(e[3]-e[1])*n,v=(e[2]-e[0])*n):(p=Math.abs(l-e[0])*n+a,m=Math.abs(c-e[1])*n+s,y=(e[2]-e[0])*n,v=(e[3]-e[1])*n),this.transform=[u*n,h*n,d*n,f*n,p-u*n*l-d*n*c,m-h*n*l-f*n*c],this.width=y,this.height=v}get rawDims(){const e=this.viewBox;return jr(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new Oh({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:i,dontFlip:a})}convertToViewportPoint(e,t){const n=[e,t];return nr.applyTransform(n,this.transform),n}convertToViewportRectangle(e){const t=[e[0],e[1]];nr.applyTransform(t,this.transform);const n=[e[2],e[3]];return nr.applyTransform(n,this.transform),[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){const n=[e,t];return nr.applyInverseTransform(n,this.transform),n}}class y2 extends Hl{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function lf(r){const e=r.length;let t=0;for(;t<e&&r[t].trim()==="";)t++;return r.substring(t,t+5).toLowerCase()==="data:"}function w2(r){return typeof r=="string"&&/\.pdf$/i.test(r)}function gP(r){return[r]=r.split(/[#?]/,1),r.substring(r.lastIndexOf("/")+1)}function pP(r,e="document.pdf"){if(typeof r!="string")return e;if(lf(r))return Sr('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const n=(o=>{try{return new URL(o)}catch{try{return new URL(decodeURIComponent(o))}catch{try{return new URL(o,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch{return null}}}}})(r);if(!n)return e;const i=o=>{try{let l=decodeURIComponent(o);return l.includes("/")?(l=l.split("/").at(-1),l.test(/^\.pdf$/i)?l:o):l}catch{return o}},a=/\.pdf$/i,s=n.pathname.split("/").at(-1);if(a.test(s))return i(s);if(n.searchParams.size>0){const o=Array.from(n.searchParams.values()).reverse();for(const c of o)if(a.test(c))return i(c);const l=Array.from(n.searchParams.keys()).reverse();for(const c of l)if(a.test(c))return i(c)}if(n.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(l)return i(l[0])}return e}class J6{started=Object.create(null);times=[];time(e){e in this.started&&Sr(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||Sr(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:n}of this.times)t=Math.max(n.length,t);for(const{name:n,start:i,end:a}of this.times)e.push(`${n.padEnd(t)} ${a-i}ms
`);return e.join("")}}function Nh(r,e){const t=e?URL.parse(r,e):URL.parse(r);return t?.protocol==="http:"||t?.protocol==="https:"}function Pa(r){r.preventDefault()}function Xn(r){r.preventDefault(),r.stopPropagation()}function mP(r){console.log("Deprecated API usage: "+r)}class x2{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const t=this.#e.exec(e);if(!t)return null;const n=parseInt(t[1],10);let i=parseInt(t[2],10);i=i>=1&&i<=12?i-1:0;let a=parseInt(t[3],10);a=a>=1&&a<=31?a:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const c=t[7]||"Z";let u=parseInt(t[8],10);u=u>=0&&u<=23?u:0;let h=parseInt(t[9],10)||0;return h=h>=0&&h<=59?h:0,c==="-"?(s+=u,o+=h):c==="+"&&(s-=u,o-=h),new Date(Date.UTC(n,i,a,s,o,l))}}function bP(r,{scale:e=1,rotation:t=0}){const{width:n,height:i}=r.attributes.style,a=[0,0,parseInt(n),parseInt(i)];return new Oh({viewBox:a,userUnit:1,scale:e,rotation:t})}function cf(r){if(r.startsWith("#")){const e=parseInt(r.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return r.startsWith("rgb(")?r.slice(4,-1).split(",").map(e=>parseInt(e)):r.startsWith("rgba(")?r.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(Sr(`Not a valid color format: "${r}"`),[0,0,0])}function vP(r){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const t of r.keys()){e.style.color=t;const n=window.getComputedStyle(e).color;r.set(t,cf(n))}e.remove()}function Mn(r){const{a:e,b:t,c:n,d:i,e:a,f:s}=r.getTransform();return[e,t,n,i,a,s]}function ys(r){const{a:e,b:t,c:n,d:i,e:a,f:s}=r.getTransform().invertSelf();return[e,t,n,i,a,s]}function ql(r,e,t=!1,n=!0){if(e instanceof Oh){const{pageWidth:i,pageHeight:a}=e.rawDims,{style:s}=r,o=fi.isCSSRoundSupported,l=`var(--total-scale-factor) * ${i}px`,c=`var(--total-scale-factor) * ${a}px`,u=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,h=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!t||e.rotation%180===0?(s.width=u,s.height=h):(s.width=h,s.height=u)}n&&r.setAttribute("data-main-rotation",e.rotation)}class ws{constructor(){const{pixelRatio:e}=ws;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,n,i,a=-1){let s=1/0,o=1/0,l=1/0;n=ws.capPixels(n,a),n>0&&(s=Math.sqrt(n/(e*t))),i!==-1&&(o=i/e,l=i/t);const c=Math.min(s,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){const n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}}const S2=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Rh{#e=null;#t=null;#r;#n=null;#a=null;#i=null;#s=null;static#o=null;constructor(e){this.#r=e,Rh.#o||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=this.#r._uiManager._signal;e.addEventListener("contextmenu",Pa,{signal:t}),e.addEventListener("pointerdown",Rh.#l,{signal:t});const n=this.#n=document.createElement("div");n.className="buttons",e.append(n);const i=this.#r.toolbarPosition;if(i){const{style:a}=e,s=this.#r._uiManager.direction==="ltr"?1-i[0]:i[0];a.insetInlineEnd=`${100*s}%`,a.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#e}static#l(e){e.stopPropagation()}#c(e){this.#r._focusEventsAllowed=!1,Xn(e)}#h(e){this.#r._focusEventsAllowed=!0,Xn(e)}#u(e){const t=this.#r._uiManager._signal;e.addEventListener("focusin",this.#c.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#h.bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",Pa,{signal:t})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#a?.shown(),this.#i?.shown()}addDeleteButton(){const{editorType:e,_uiManager:t}=this.#r,n=document.createElement("button");n.className="delete",n.tabIndex=0,n.setAttribute("data-l10n-id",Rh.#o[e]),this.#u(n),n.addEventListener("click",i=>{t.delete()},{signal:t._signal}),this.#n.append(n)}get#g(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const t=await e.render();this.#u(t),this.#n.append(t,this.#g),this.#a=e}addComment(e){if(this.#i)return;const t=e.render();t&&(this.#u(t),this.#n.prepend(t,this.#g),this.#i=e,e.toolbar=this)}addColorPicker(e){if(this.#t)return;this.#t=e;const t=e.renderButton();this.#u(t),this.#n.append(t,this.#g)}async addEditSignatureButton(e){const t=this.#s=await e.renderEditButton(this.#r);this.#u(t),this.#n.append(t,this.#g)}async addButton(e,t){switch(e){case"colorPicker":this.addColorPicker(t);break;case"altText":await this.addAltText(t);break;case"editSignature":await this.addEditSignatureButton(t);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(t);break}}updateEditSignatureButton(e){this.#s&&(this.#s.title=e)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class yP{#e=null;#t=null;#r;constructor(e){this.#r=e}#n(){const e=this.#t=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",Pa,{signal:this.#r._signal});const t=this.#e=document.createElement("div");return t.className="buttons",e.append(t),this.#i(),e}#a(e,t){let n=0,i=0;for(const a of e){const s=a.y+a.height;if(s<n)continue;const o=a.x+(t?a.width:0);if(s>n){i=o,n=s;continue}t?o>i&&(i=o):o<i&&(i=o)}return[t?1-i:i,n]}show(e,t,n){const[i,a]=this.#a(t,n),{style:s}=this.#t||=this.#n();e.append(this.#t),s.insetInlineEnd=`${100*i}%`,s.top=`calc(${100*a}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#i(){const e=document.createElement("button");e.className="highlightButton",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const t=document.createElement("span");e.append(t),t.className="visuallyHidden",t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const n=this.#r._signal;e.addEventListener("contextmenu",Pa,{signal:n}),e.addEventListener("click",()=>{this.#r.highlightSelection("floating_button")},{signal:n}),this.#e.append(e)}}function Q6(r,e,t){for(const n of t)e.addEventListener(n,r[n].bind(r))}class wP{#e=0;get id(){return`${q6}${this.#e++}`}}class k2{#e=K6();#t=0;#r=null;static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',n=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=e;const a=i.decode().then(()=>(n.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(n.getImageData(0,0,1,1).data.buffer)[0]===0));return jr(this,"_isSVGFittingCanvas",a)}async#n(e,t){this.#r||=new Map;let n=this.#r.get(e);if(n===null)return null;if(n?.bitmap)return n.refCounter+=1,n;try{n||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let i;if(typeof t=="string"?(n.url=t,i=await Mh(t,"blob")):t instanceof File?i=n.file=t:t instanceof Blob&&(i=t),i.type==="image/svg+xml"){const a=k2._isSVGFittingCanvas,s=new FileReader,o=new Image,l=new Promise((c,u)=>{o.onload=()=>{n.bitmap=o,n.isSvg=!0,c()},s.onload=async()=>{const h=n.svgUrl=s.result;o.src=await a?`${h}#svgView(preserveAspectRatio(none))`:h},o.onerror=s.onerror=u});s.readAsDataURL(i),await l}else n.bitmap=await createImageBitmap(i);n.refCounter=1}catch(i){Sr(i),n=null}return this.#r.set(e,n),n&&this.#r.set(n.id,n),n}async getFromFile(e){const{lastModified:t,name:n,size:i,type:a}=e;return this.#n(`${t}_${n}_${i}_${a}`,e)}async getFromUrl(e){return this.#n(e,e)}async getFromBlob(e,t){const n=await t;return this.#n(e,n)}async getFromId(e){this.#r||=new Map;const t=this.#r.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){const{blobPromise:n}=t;return delete t.blobPromise,this.getFromBlob(t.id,n)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#r||=new Map;let n=this.#r.get(e);if(n?.bitmap)return n.refCounter+=1,n;const i=new OffscreenCanvas(t.width,t.height);return i.getContext("2d").drawImage(t,0,0),n={bitmap:i.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#r.set(e,n),this.#r.set(n.id,n),n}getSvgUrl(e){const t=this.#r.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#r||=new Map;const t=this.#r.get(e);if(!t||(t.refCounter-=1,t.refCounter!==0))return;const{bitmap:n}=t;if(!t.url&&!t.file){const i=new OffscreenCanvas(n.width,n.height);i.getContext("bitmaprenderer").transferFromImageBitmap(n),t.blobPromise=i.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}}class xP{#e=[];#t=!1;#r;#n=-1;constructor(e=128){this.#r=e}add({cmd:e,undo:t,post:n,mustExec:i,type:a=NaN,overwriteIfSameType:s=!1,keepUndo:o=!1}){if(i&&e(),this.#t)return;const l={cmd:e,undo:t,post:n,type:a};if(this.#n===-1){this.#e.length>0&&(this.#e.length=0),this.#n=0,this.#e.push(l);return}if(s&&this.#e[this.#n].type===a){o&&(l.undo=this.#e[this.#n].undo),this.#e[this.#n]=l;return}const c=this.#n+1;c===this.#r?this.#e.splice(0,1):(this.#n=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(l)}undo(){if(this.#n===-1)return;this.#t=!0;const{undo:e,post:t}=this.#e[this.#n];e(),t?.(),this.#t=!1,this.#n-=1}redo(){if(this.#n<this.#e.length-1){this.#n+=1,this.#t=!0;const{cmd:e,post:t}=this.#e[this.#n];e(),t?.(),this.#t=!1}}hasSomethingToUndo(){return this.#n!==-1}hasSomethingToRedo(){return this.#n<this.#e.length-1}cleanType(e){if(this.#n!==-1){for(let t=this.#n;t>=0;t--)if(this.#e[t].type!==e){this.#e.splice(t+1,this.#n-t),this.#n=t;return}this.#e.length=0,this.#n=-1}}destroy(){this.#e=null}}class Ph{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=fi.platform;for(const[n,i,a={}]of e)for(const s of n){const o=s.startsWith("mac+");t&&o?(this.callbacks.set(s.slice(4),{callback:i,options:a}),this.allKeys.add(s.split("+").at(-1))):!t&&!o&&(this.callbacks.set(s,{callback:i,options:a}),this.allKeys.add(s.split("+").at(-1)))}}#e(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;const n=this.callbacks.get(this.#e(t));if(!n)return;const{callback:i,options:{bubbles:a=!1,args:s=[],checker:o=null}}=n;o&&!o(e,t)||(i.bind(e,...s,t)(),a||Xn(t))}}class A2{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return vP(e),jr(this,"_colors",e)}convert(e){const t=cf(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[n,i]of this._colors)if(i.every((a,s)=>a===t[s]))return A2._colorsMapping.get(n);return t}getHexCode(e){const t=this._colors.get(e);return t?nr.makeHexColor(...t):e}}class Yo{#e=new AbortController;#t=null;#r=new Map;#n=new Map;#a=null;#i=null;#s=null;#o=new xP;#l=null;#c=null;#h=null;#u=0;#g=new Set;#p=null;#f=null;#d=new Set;_editorUndoBar=null;#m=!1;#y=!1;#b=!1;#w=null;#x=null;#v=null;#k=null;#C=!1;#A=null;#M=new wP;#I=!1;#T=!1;#E=null;#N=null;#L=null;#R=null;#j=null;#_=xr.NONE;#S=new Set;#B=null;#U=null;#H=null;#W=null;#V={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#q=[0,0];#P=null;#F=null;#G=null;#Y=null;#D=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=Yo.prototype,t=s=>s.#F.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),n=(s,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return jr(this,"_keyboardManager",new Ph([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],e.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:n}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(s,{target:o})=>!(o instanceof HTMLButtonElement)&&s.#F.contains(o)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:o})=>!(o instanceof HTMLButtonElement)&&s.#F.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-a,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[a,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-a],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,a],checker:t}]]))}constructor(e,t,n,i,a,s,o,l,c,u,h,d,f,p,m,y){const v=this._signal=this.#e.signal;this.#F=e,this.#G=t,this.#Y=n,this.#a=i,this.#l=a,this.#U=s,this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:v}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:v}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:v}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:v}),o._on("setpreference",this.onSetPreference.bind(this),{signal:v}),o._on("switchannotationeditorparams",x=>this.updateParams(x.type,x.value),{signal:v}),this.#ae(),this.#ce(),this.#Q(),this.#i=l.annotationStorage,this.#w=l.filterFactory,this.#H=c,this.#k=u||null,this.#m=h,this.#y=d,this.#b=f,this.#j=p||null,this.viewParameters={realScale:ru.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=y!==!1}destroy(){this.#D?.resolve(),this.#D=null,this.#e?.abort(),this.#e=null,this._signal=null;for(const e of this.#n.values())e.destroy();this.#n.clear(),this.#r.clear(),this.#d.clear(),this.#R?.clear(),this.#t=null,this.#S.clear(),this.#o.destroy(),this.#a?.destroy(),this.#l?.destroy(),this.#U?.destroy(),this.#A?.hide(),this.#A=null,this.#L?.destroy(),this.#L=null,this.#x&&(clearTimeout(this.#x),this.#x=null),this.#P&&(clearTimeout(this.#P),this.#P=null),this._editorUndoBar?.destroy()}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#j}get useNewAltTextFlow(){return this.#y}get useNewAltTextWhenAddingImage(){return this.#b}get hcmFilter(){return jr(this,"hcmFilter",this.#H?this.#w.addHCMFilter(this.#H.foreground,this.#H.background):"none")}get direction(){return jr(this,"direction",getComputedStyle(this.#F).direction)}get _highlightColors(){return jr(this,"_highlightColors",this.#k?new Map(this.#k.split(",").map(e=>(e=e.split("=").map(t=>t.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){const{_highlightColors:e}=this;if(!e)return jr(this,"highlightColors",null);const t=new Map,n=!!this.#H;for(const[i,a]of e){const s=i.endsWith("_HCM");if(n&&s){t.set(i.replace("_HCM",""),a);continue}!n&&!s&&t.set(i,a)}return jr(this,"highlightColors",t)}get highlightColorNames(){return jr(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;const t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#h=e}setMainHighlightColorPicker(e){this.#L=e}editAltText(e,t=!1){this.#a?.editAltText(this,e,t)}hasCommentManager(){return!!this.#l}editComment(e,t){this.#l?.open(this,e,t)}getSignature(e){this.#U?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#U}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){switch(e){case"enableNewAltTextWhenAddingImage":this.#b=t;break}}onPageChanging({pageNumber:e}){this.#u=e-1}focusMainContainer(){this.#F.focus()}findParent(e,t){for(const n of this.#n.values()){const{x:i,y:a,width:s,height:o}=n.div.getBoundingClientRect();if(e>=i&&e<=i+s&&t>=a&&t<=a+o)return n}return null}disableUserSelect(e=!1){this.#G.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#d.add(e)}removeShouldRescale(e){this.#d.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*ru.PDF_TO_CSS_UNITS;for(const t of this.#d)t.onScaleChanging();this.#h?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#$({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#J(e){const{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(const n of this.#n.values())if(n.hasTextLayer(e))return n;return null}highlightSelection(e=""){const t=document.getSelection();if(!t||t.isCollapsed)return;const{anchorNode:n,anchorOffset:i,focusNode:a,focusOffset:s}=t,o=t.toString(),c=this.#$(t).closest(".textLayer"),u=this.getSelectionBoxes(c);if(!u)return;t.empty();const h=this.#J(c),d=this.#_===xr.NONE,f=()=>{h?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:u,anchorNode:n,anchorOffset:i,focusNode:a,focusOffset:s,text:o}),d&&this.showAllEditors("highlight",!0,!0)};if(d){this.switchToMode(xr.HIGHLIGHT,f);return}f()}#ne(){const e=document.getSelection();if(!e||e.isCollapsed)return;const n=this.#$(e).closest(".textLayer"),i=this.getSelectionBoxes(n);i&&(this.#A||=new yP(this),this.#A.show(n,i,this.direction==="ltr"))}addToAnnotationStorage(e){!e.isEmpty()&&this.#i&&!this.#i.has(e.id)&&this.#i.setValue(e.id,e)}a11yAlert(e,t=null){const n=this.#Y;n&&(n.setAttribute("data-l10n-id",e),t?n.setAttribute("data-l10n-args",JSON.stringify(t)):n.removeAttribute("data-l10n-args"))}#ie(){const e=document.getSelection();if(!e||e.isCollapsed){this.#B&&(this.#A?.hide(),this.#B=null,this.#O({hasSelectedText:!1}));return}const{anchorNode:t}=e;if(t===this.#B)return;const i=this.#$(e).closest(".textLayer");if(!i){this.#B&&(this.#A?.hide(),this.#B=null,this.#O({hasSelectedText:!1}));return}if(this.#A?.hide(),this.#B=t,this.#O({hasSelectedText:!0}),!(this.#_!==xr.HIGHLIGHT&&this.#_!==xr.NONE)&&(this.#_===xr.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#C=this.isShiftKeyDown,!this.isShiftKeyDown)){const a=this.#_===xr.HIGHLIGHT?this.#J(i):null;a?.toggleDrawing();const s=new AbortController,o=this.combinedSignal(s),l=c=>{c.type==="pointerup"&&c.button!==0||(s.abort(),a?.toggleDrawing(!0),c.type==="pointerup"&&this.#K("main_toolbar"))};window.addEventListener("pointerup",l,{signal:o}),window.addEventListener("blur",l,{signal:o})}}#K(e=""){this.#_===xr.HIGHLIGHT?this.highlightSelection(e):this.#m&&this.#ne()}#ae(){document.addEventListener("selectionchange",this.#ie.bind(this),{signal:this._signal})}#se(){if(this.#v)return;this.#v=new AbortController;const e=this.combinedSignal(this.#v);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#oe(){this.#v?.abort(),this.#v=null}blur(){if(this.isShiftKeyDown=!1,this.#C&&(this.#C=!1,this.#K("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of this.#S)if(t.div.contains(e)){this.#N=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#N)return;const[e,t]=this.#N;this.#N=null,t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#Q(){if(this.#E)return;this.#E=new AbortController;const e=this.combinedSignal(this.#E);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#le(){this.#E?.abort(),this.#E=null}#Z(){if(this.#c)return;this.#c=new AbortController;const e=this.combinedSignal(this.#c);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#ee(){this.#c?.abort(),this.#c=null}#ce(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#Q(),this.#Z()}removeEditListeners(){this.#le(),this.#ee()}dragOver(e){for(const{type:t}of e.dataTransfer.items)for(const n of this.#f)if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const t of e.dataTransfer.items)for(const n of this.#f)if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const t=[];for(const n of this.#S){const i=n.serialize(!0);i&&t.push(i)}t.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:t}=e;for(const a of t.items)for(const s of this.#f)if(s.isHandlingMimeForPasting(a.type)){s.paste(a,this.currentLayer);return}let n=t.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(a){Sr(`paste: "${a.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();const i=this.currentLayer;try{const a=[];for(const l of n){const c=await i.deserialize(l);if(!c)return;a.push(c)}const s=()=>{for(const l of a)this.#te(l);this.#re(a)},o=()=>{for(const l of a)l.remove()};this.addCommands({cmd:s,undo:o,mustExec:!0})}catch(a){Sr(`paste: "${a.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),this.#_!==xr.NONE&&!this.isEditorHandlingKeyboard&&Yo._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,this.#C&&(this.#C=!1,this.#K("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}#O(e){Object.entries(e).some(([n,i])=>this.#V[n]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#V,e)}),this.#_===xr.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#z([[Jr.HIGHLIGHT_FREE,!0]]))}#z(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#se(),this.#Z(),this.#O({isEditing:this.#_!==xr.NONE,isEmpty:this.#X(),hasSomethingToUndo:this.#o.hasSomethingToUndo(),hasSomethingToRedo:this.#o.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#oe(),this.#ee(),this.#O({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#f){this.#f=e;for(const t of this.#f)this.#z(t.defaultPropertiesToUpdate)}}getId(){return this.#M.id}get currentLayer(){return this.#n.get(this.#u)}getLayer(e){return this.#n.get(e)}get currentPageIndex(){return this.#u}addLayer(e){this.#n.set(e.pageIndex,e),this.#I?e.enable():e.disable()}removeLayer(e){this.#n.delete(e.pageIndex)}async updateMode(e,t=null,n=!1,i=!1,a=!1){if(this.#_!==e&&!(this.#D&&(await this.#D.promise,!this.#D))){if(this.#D=Promise.withResolvers(),this.#h?.commitOrRemove(),this.#_=e,e===xr.NONE){this.setEditingState(!1),this.#he(),this._editorUndoBar?.hide(),this.#D.resolve();return}e===xr.SIGNATURE&&await this.#U?.loadSignatures(),this.setEditingState(!0),await this.#ue(),this.unselectAll();for(const s of this.#n.values())s.updateMode(e);if(!t){n&&this.addNewEditorFromKeyboard(),this.#D.resolve();return}for(const s of this.#r.values())s.annotationElementId===t||s.id===t?(this.setSelected(s),a?s.editComment():i&&s.enterInEditMode()):s.unselect();this.#D.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#_&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,t){if(this.#f){switch(e){case Jr.CREATE:this.currentLayer.addNewEditor(t);return;case Jr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#W||=new Map).set(e,t),this.showAllEditors("highlight",t);break}if(this.hasSelection)for(const n of this.#S)n.updateParams(e,t);else for(const n of this.#f)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(const a of this.#r.values())a.editorType===e&&a.show(t);(this.#W?.get(Jr.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#z([[Jr.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#T!==e){this.#T=e;for(const t of this.#n.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}async#ue(){if(!this.#I){this.#I=!0;const e=[];for(const t of this.#n.values())e.push(t.enable());await Promise.all(e);for(const t of this.#r.values())t.enable()}}#he(){if(this.unselectAll(),this.#I){this.#I=!1;for(const e of this.#n.values())e.disable();for(const e of this.#r.values())e.disable()}}getEditors(e){const t=[];for(const n of this.#r.values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return this.#r.get(e)}addEditor(e){this.#r.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#x&&clearTimeout(this.#x),this.#x=setTimeout(()=>{this.focusMainContainer(),this.#x=null},0)),this.#r.delete(e.id),e.annotationElementId&&this.#R?.delete(e.annotationElementId),this.unselect(e),(!e.annotationElementId||!this.#g.has(e.annotationElementId))&&this.#i?.remove(e.id)}addDeletedAnnotationElement(e){this.#g.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#g.has(e)}removeDeletedAnnotationElement(e){this.#g.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#te(e){const t=this.#n.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#z(e.propertiesToUpdate))}get#de(){let e=null;for(e of this.#S);return e}updateUI(e){this.#de===e&&this.#z(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#z(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#S.has(e)){this.#S.delete(e),e.unselect(),this.#O({hasSelectedEditor:this.hasSelection});return}this.#S.add(e),e.select(),this.#z(e.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.id}),this.#h?.commitOrRemove();for(const t of this.#S)t!==e&&t.unselect();this.#S.clear(),this.#S.add(e),e.select(),this.#z(e.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}isSelected(e){return this.#S.has(e)}get firstSelectedEditor(){return this.#S.values().next().value}unselect(e){e.unselect(),this.#S.delete(e),this.#O({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#S.size!==0}get isEnterHandled(){return this.#S.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#o.undo(),this.#O({hasSomethingToUndo:this.#o.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#X()}),this._editorUndoBar?.hide()}redo(){this.#o.redo(),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:this.#o.hasSomethingToRedo(),isEmpty:this.#X()})}addCommands(e){this.#o.add(e),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#X()})}cleanUndoStack(e){this.#o.cleanType(e)}#X(){if(this.#r.size===0)return!0;if(this.#r.size===1)for(const e of this.#r.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();const e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const t=e?[e]:[...this.#S],n=()=>{this._editorUndoBar?.show(i,t.length===1?t[0].editorType:t.length);for(const a of t)a.remove()},i=()=>{for(const a of t)this.#te(a)};this.addCommands({cmd:n,undo:i,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#re(e){for(const t of this.#S)t.unselect();this.#S.clear();for(const t of e)t.isEmpty()||(this.#S.add(t),t.select());this.#O({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#S)e.commit();this.#re(this.#r.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#_!==xr.NONE))&&!this.#h?.commitOrRemove()&&this.hasSelection){for(const e of this.#S)e.unselect();this.#S.clear(),this.#O({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#q[0]+=e,this.#q[1]+=t;const[i,a]=this.#q,s=[...this.#S],o=1e3;this.#P&&clearTimeout(this.#P),this.#P=setTimeout(()=>{this.#P=null,this.#q[0]=this.#q[1]=0,this.addCommands({cmd:()=>{for(const l of s)this.#r.has(l.id)&&(l.translateInPage(i,a),l.translationDone())},undo:()=>{for(const l of s)this.#r.has(l.id)&&(l.translateInPage(-i,-a),l.translationDone())},mustExec:!1})},o);for(const l of s)l.translateInPage(e,t),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#p=new Map;for(const e of this.#S)this.#p.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#p)return!1;this.disableUserSelect(!1);const e=this.#p;this.#p=null;let t=!1;for(const[{x:i,y:a,pageIndex:s},o]of e)o.newX=i,o.newY=a,o.newPageIndex=s,t||=i!==o.savedX||a!==o.savedY||s!==o.savedPageIndex;if(!t)return!1;const n=(i,a,s,o)=>{if(this.#r.has(i.id)){const l=this.#n.get(o);l?i._setParentAndPosition(l,a,s):(i.pageIndex=o,i.x=a,i.y=s)}};return this.addCommands({cmd:()=>{for(const[i,{newX:a,newY:s,newPageIndex:o}]of e)n(i,a,s,o)},undo:()=>{for(const[i,{savedX:a,savedY:s,savedPageIndex:o}]of e)n(i,a,s,o)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#p)for(const n of this.#p.keys())n.drag(e,t)}rebuild(e){if(e.parent===null){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#S.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#_}get imageManager(){return jr(this,"imageManager",new k2)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let c=0,u=t.rangeCount;c<u;c++)if(!e.contains(t.getRangeAt(c).commonAncestorContainer))return null;const{x:n,y:i,width:a,height:s}=e.getBoundingClientRect();let o;switch(e.getAttribute("data-main-rotation")){case"90":o=(c,u,h,d)=>({x:(u-i)/s,y:1-(c+h-n)/a,width:d/s,height:h/a});break;case"180":o=(c,u,h,d)=>({x:1-(c+h-n)/a,y:1-(u+d-i)/s,width:h/a,height:d/s});break;case"270":o=(c,u,h,d)=>({x:1-(u+d-i)/s,y:(c-n)/a,width:d/s,height:h/a});break;default:o=(c,u,h,d)=>({x:(c-n)/a,y:(u-i)/s,width:h/a,height:d/s});break}const l=[];for(let c=0,u=t.rangeCount;c<u;c++){const h=t.getRangeAt(c);if(!h.collapsed)for(const{x:d,y:f,width:p,height:m}of h.getClientRects())p===0||m===0||l.push(o(d,f,p,m))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#s||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#s?.delete(e)}renderAnnotationElement(e){const t=this.#s?.get(e.data.id);if(!t)return;const n=this.#i.getRawValue(t);n&&(this.#_===xr.NONE&&!n.hasBeenModified||n.renderAnnotationElement(e))}setMissingCanvas(e,t,n){const i=this.#R?.get(e);i&&(i.setCanvas(t,n),this.#R.delete(e))}addMissingCanvas(e,t){(this.#R||=new Map).set(e,t)}}class xs{#e=null;#t=!1;#r=null;#n=null;#a=null;#i=null;#s=!1;#o=null;#l=null;#c=null;#h=null;#u=!1;static#g=null;static _l10n=null;constructor(e){this.#l=e,this.#u=e._uiManager.useNewAltTextFlow,xs.#g||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(e){xs._l10n??=e}async render(){const e=this.#r=document.createElement("button");e.className="altText",e.tabIndex="0";const t=this.#n=document.createElement("span");e.append(t),this.#u?(e.classList.add("new"),e.setAttribute("data-l10n-id",xs.#g.missing),t.setAttribute("data-l10n-id",xs.#g["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const n=this.#l._uiManager._signal;e.addEventListener("contextmenu",Pa,{signal:n}),e.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:n});const i=a=>{a.preventDefault(),this.#l._uiManager.editAltText(this.#l),this.#u&&this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#p}})};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",a=>{a.target===e&&a.key==="Enter"&&(this.#s=!0,i(a))},{signal:n}),await this.#f(),e}get#p(){return this.#e&&"added"||this.#e===null&&this.guessedText&&"review"||"missing"}finish(){this.#r&&(this.#r.focus({focusVisible:this.#s}),this.#s=!1)}isEmpty(){return this.#u?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#u?this.#e!==null||!!this.#c:this.isEmpty()}get guessedText(){return this.#c}async setGuessedText(e){this.#e===null&&(this.#c=e,this.#h=await xs._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),this.#f())}toggleAltTextBadge(e=!1){if(!this.#u||this.#e){this.#o?.remove(),this.#o=null;return}if(!this.#o){const t=this.#o=document.createElement("div");t.className="noAltTextBadge",this.#l.div.append(t)}this.#o.classList.toggle("hidden",!e)}serialize(e){let t=this.#e;return!e&&this.#c===t&&(t=this.#h),{altText:t,decorative:this.#t,guessedText:this.#c,textWithDisclaimer:this.#h}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:i,cancel:a=!1}){n&&(this.#c=n,this.#h=i),!(this.#e===e&&this.#t===t)&&(a||(this.#e=e,this.#t=t),this.#f())}toggle(e=!1){this.#r&&(!e&&this.#i&&(clearTimeout(this.#i),this.#i=null),this.#r.disabled=!e)}shown(){this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#p}})}destroy(){this.#r?.remove(),this.#r=null,this.#n=null,this.#a=null,this.#o?.remove(),this.#o=null}async#f(){const e=this.#r;if(!e)return;if(this.#u){if(e.classList.toggle("done",!!this.#e),e.setAttribute("data-l10n-id",xs.#g[this.#p]),this.#n?.setAttribute("data-l10n-id",xs.#g[`${this.#p}-label`]),!this.#e){this.#a?.remove();return}}else{if(!this.#e&&!this.#t){e.classList.remove("done"),this.#a?.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=this.#a;if(!t){this.#a=t=document.createElement("span"),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${this.#l.id}`;const i=100,a=this.#l._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(this.#i),this.#i=null},{once:!0}),e.addEventListener("mouseenter",()=>{this.#i=setTimeout(()=>{this.#i=null,this.#a.classList.add("show"),this.#l._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:a}),e.addEventListener("mouseleave",()=>{this.#i&&(clearTimeout(this.#i),this.#i=null),this.#a?.classList.remove("show")},{signal:a})}this.#t?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=this.#e),t.parentNode||e.append(t),this.#l.getElementForAltText()?.setAttribute("aria-describedby",t.id)}}let uf=class{#e=null;#t=!1;#r=null;#n=null;#a=null;#i=null;#s=!1;constructor(e){this.#r=e,this.toolbar=null}render(){if(!this.#r._uiManager.hasCommentManager())return null;const e=this.#e=document.createElement("button");e.className="comment",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button");const t=this.#r._uiManager._signal;e.addEventListener("contextmenu",Pa,{signal:t}),e.addEventListener("pointerdown",i=>i.stopPropagation(),{signal:t});const n=i=>{i.preventDefault(),this.edit()};return e.addEventListener("click",n,{capture:!0,signal:t}),e.addEventListener("keydown",i=>{i.target===e&&i.key==="Enter"&&(this.#t=!0,n(i))},{signal:t}),e}edit(){const{bottom:e,left:t,right:n}=this.#r.getClientDimensions(),i={top:e};this.#r._uiManager.direction==="ltr"?i.right=n:i.left=t,this.#r._uiManager.editComment(this.#r,i)}finish(){this.#e&&(this.#e.focus({focusVisible:this.#t}),this.#t=!1)}isDeleted(){return this.#s||this.#a===""}hasBeenEdited(){return this.isDeleted()||this.#a!==this.#n}serialize(){return this.data}get data(){return{text:this.#a,date:this.#i,deleted:this.#s}}set data(e){if(e===null){this.#a="",this.#s=!0;return}this.#a=e,this.#i=new Date,this.#s=!1}setInitialText(e){this.#n=e,this.data=e}toggle(e=!1){this.#e&&(this.#e.disabled=!e)}shown(){}destroy(){this.#e?.remove(),this.#e=null,this.#a="",this.#i=null,this.#r=null,this.#t=!1,this.#s=!1}};class hf{#e;#t=!1;#r=null;#n;#a;#i;#s;#o=null;#l;#c=null;#h;#u=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:i=null,onPinching:a=null,onPinchEnd:s=null,signal:o}){this.#e=e,this.#r=n,this.#n=t,this.#a=i,this.#i=a,this.#s=s,this.#h=new AbortController,this.#l=AbortSignal.any([o,this.#h.signal]),e.addEventListener("touchstart",this.#g.bind(this),{passive:!1,signal:this.#l})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/ws.pixelRatio}#g(e){if(this.#n?.())return;if(e.touches.length===1){if(this.#o)return;const i=this.#o=new AbortController,a=AbortSignal.any([this.#l,i.signal]),s=this.#e,o={capture:!0,signal:a,passive:!1},l=c=>{c.pointerType==="touch"&&(this.#o?.abort(),this.#o=null)};s.addEventListener("pointerdown",c=>{c.pointerType==="touch"&&(Xn(c),l(c))},o),s.addEventListener("pointerup",l,o),s.addEventListener("pointercancel",l,o);return}if(!this.#u){this.#u=new AbortController;const i=AbortSignal.any([this.#l,this.#u.signal]),a=this.#e,s={signal:i,capture:!1,passive:!1};a.addEventListener("touchmove",this.#p.bind(this),s);const o=this.#f.bind(this);a.addEventListener("touchend",o,s),a.addEventListener("touchcancel",o,s),s.capture=!0,a.addEventListener("pointerdown",Xn,s),a.addEventListener("pointermove",Xn,s),a.addEventListener("pointercancel",Xn,s),a.addEventListener("pointerup",Xn,s),this.#a?.()}if(Xn(e),e.touches.length!==2||this.#r?.()){this.#c=null;return}let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),this.#c={touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY}}#p(e){if(!this.#c||e.touches.length!==2)return;Xn(e);let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]);const{screenX:i,screenY:a}=t,{screenX:s,screenY:o}=n,l=this.#c,{touch0X:c,touch0Y:u,touch1X:h,touch1Y:d}=l,f=h-c,p=d-u,m=s-i,y=o-a,v=Math.hypot(m,y)||1,x=Math.hypot(f,p)||1;if(!this.#t&&Math.abs(x-v)<=hf.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=i,l.touch0Y=a,l.touch1X=s,l.touch1Y=o,!this.#t){this.#t=!0;return}const S=[(i+s)/2,(a+o)/2];this.#i?.(S,x,v)}#f(e){e.touches.length>=2||(this.#u&&(this.#u.abort(),this.#u=null,this.#s?.()),this.#c&&(Xn(e),this.#c=null,this.#t=!1))}destroy(){this.#h?.abort(),this.#h=null,this.#o?.abort(),this.#o=null}}class or{#e=null;#t=null;#r=null;#n=null;#a=!1;#i=null;#s="";#o=!1;#l=null;#c=null;#h=null;#u=null;#g="";#p=!1;#f=null;#d=!1;#m=!1;#y=!1;#b=null;#w=0;#x=0;#v=null;#k=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#C=!1;#A=or._zIndex++;static _borderLineWidth=-1;static _colorManager=new A2;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=or.prototype._resizeWithKeyboard,t=Yo.TRANSLATE_SMALL,n=Yo.TRANSLATE_BIG;return jr(this,"_resizerKeyboardManager",new Ph([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,n]}],[["Escape","mac+Escape"],or.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null;const{rotation:t,rawDims:{pageWidth:n,pageHeight:i,pageX:a,pageY:s}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,i],this.pageTranslation=[a,s];const[o,l]=this.parentDimensions;this.x=e.x/o,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return jr(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new SP({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(or._l10n??=e,or._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),or._borderLineWidth!==-1)return;const n=getComputedStyle(document.documentElement);or._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){pn("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#C}set _isDraggable(e){this.#C=e,this.div?.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#A}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):this.#G(),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#p?this.#p=!1:this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,i){const[a,s]=this.parentDimensions;[n,i]=this.screenToPageTranslation(n,i),this.x=(e+n)/a,this.y=(t+i)/s,this.fixAndSetPosition()}_moveAfterPaste(e,t){const[n,i]=this.parentDimensions;this.setAt(e*n,t*i,this.width*n,this.height*i),this._onTranslated()}#M([e,t],n,i){[n,i]=this.screenToPageTranslation(n,i),this.x+=n/e,this.y+=i/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#M(this.parentDimensions,e,t)}translateInPage(e,t){this.#f||=[this.x,this.y,this.width,this.height],this.#M(this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){this.#f||=[this.x,this.y,this.width,this.height];const{div:n,parentDimensions:[i,a]}=this;if(this.x+=e/i,this.y+=t/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:h,y:d}=this.div.getBoundingClientRect();this.parent.findNewParent(this,h,d)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:o}=this;const[l,c]=this.getBaseTranslation();s+=l,o+=c;const{style:u}=n;u.left=`${(100*s).toFixed(2)}%`,u.top=`${(100*o).toFixed(2)}%`,this._onTranslating(s,o),n.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#f&&(this.#f[0]!==this.x||this.#f[1]!==this.y)}get _hasBeenResized(){return!!this.#f&&(this.#f[2]!==this.width||this.#f[3]!==this.height)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:n}=or,i=n/e,a=n/t;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:t},pageDimensions:[n,i]}=this;let{x:a,y:s,width:o,height:l}=this;if(o*=n,l*=i,a*=n,s*=i,this._mustFixPosition)switch(e){case 0:a=Li(a,0,n-o),s=Li(s,0,i-l);break;case 90:a=Li(a,0,n-l),s=Li(s,o,i);break;case 180:a=Li(a,o,n),s=Li(s,l,i);break;case 270:a=Li(a,l,n),s=Li(s,0,i-o);break}this.x=a/=n,this.y=s/=i;const[c,u]=this.getBaseTranslation();a+=c,s+=u,t.left=`${(100*a).toFixed(2)}%`,t.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#I(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(e,t){return or.#I(e,t,this.parentRotation)}pageTranslationToScreen(e,t){return or.#I(e,t,360-this.parentRotation)}#T(e){switch(e){case 90:{const[t,n]=this.pageDimensions;return[0,-t/n,n/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,n]=this.pageDimensions;return[0,t/n,-n/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(e,t){const[n,i]=this.parentDimensions,{style:a}=this.div;a.width=`${(100*e/n).toFixed(2)}%`,this.#o||(a.height=`${(100*t/i).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:t,width:n}=e,i=n.endsWith("%"),a=!this.#o&&t.endsWith("%");if(i&&a)return;const[s,o]=this.parentDimensions;i||(e.width=`${(100*parseFloat(n)/s).toFixed(2)}%`),!this.#o&&!a&&(e.height=`${(100*parseFloat(t)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#E(){if(this.#l)return;this.#l=document.createElement("div"),this.#l.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(const n of e){const i=document.createElement("div");this.#l.append(i),i.classList.add("resizer",n),i.setAttribute("data-resizer-name",n),i.addEventListener("pointerdown",this.#N.bind(this,n),{signal:t}),i.addEventListener("contextmenu",Pa,{signal:t}),i.tabIndex=-1}this.div.prepend(this.#l)}#N(e,t){t.preventDefault();const{isMac:n}=fi.platform;if(t.button!==0||t.ctrlKey&&n)return;this.#r?.toggle(!1);const i=this._isDraggable;this._isDraggable=!1,this.#c=[t.screenX,t.screenY];const a=new AbortController,s=this._uiManager.combinedSignal(a);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#j.bind(this,e),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",Xn,{passive:!1,signal:s}),window.addEventListener("contextmenu",Pa,{signal:s}),this.#h={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const o=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const c=()=>{a.abort(),this.parent.togglePointerEvents(!0),this.#r?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=o,this.div.style.cursor=l,this.#R()};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})}#L(e,t,n,i){this.width=n,this.height=i,this.x=e,this.y=t;const[a,s]=this.parentDimensions;this.setDims(a*n,s*i),this.fixAndSetPosition(),this._onResized()}_onResized(){}#R(){if(!this.#h)return;const{savedX:e,savedY:t,savedWidth:n,savedHeight:i}=this.#h;this.#h=null;const a=this.x,s=this.y,o=this.width,l=this.height;a===e&&s===t&&o===n&&l===i||this.addCommands({cmd:this.#L.bind(this,a,s,o,l),undo:this.#L.bind(this,e,t,n,i),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#j(e,t){const[n,i]=this.parentDimensions,a=this.x,s=this.y,o=this.width,l=this.height,c=or.MIN_SIZE/n,u=or.MIN_SIZE/i,h=this.#T(this.rotation),d=(q,re)=>[h[0]*q+h[2]*re,h[1]*q+h[3]*re],f=this.#T(360-this.rotation),p=(q,re)=>[f[0]*q+f[2]*re,f[1]*q+f[3]*re];let m,y,v=!1,x=!1;switch(e){case"topLeft":v=!0,m=(q,re)=>[0,0],y=(q,re)=>[q,re];break;case"topMiddle":m=(q,re)=>[q/2,0],y=(q,re)=>[q/2,re];break;case"topRight":v=!0,m=(q,re)=>[q,0],y=(q,re)=>[0,re];break;case"middleRight":x=!0,m=(q,re)=>[q,re/2],y=(q,re)=>[0,re/2];break;case"bottomRight":v=!0,m=(q,re)=>[q,re],y=(q,re)=>[0,0];break;case"bottomMiddle":m=(q,re)=>[q/2,re],y=(q,re)=>[q/2,0];break;case"bottomLeft":v=!0,m=(q,re)=>[0,re],y=(q,re)=>[q,0];break;case"middleLeft":x=!0,m=(q,re)=>[0,re/2],y=(q,re)=>[q,re/2];break}const S=m(o,l),A=y(o,l);let C=d(...A);const k=or._round(a+C[0]),I=or._round(s+C[1]);let R=1,U=1,D,$;if(t.fromKeyboard)({deltaX:D,deltaY:$}=t);else{const{screenX:q,screenY:re}=t,[X,ie]=this.#c;[D,$]=this.screenToPageTranslation(q-X,re-ie),this.#c[0]=q,this.#c[1]=re}if([D,$]=p(D/n,$/i),v){const q=Math.hypot(o,l);R=U=Math.max(Math.min(Math.hypot(A[0]-S[0]-D,A[1]-S[1]-$)/q,1/o,1/l),c/o,u/l)}else x?R=Li(Math.abs(A[0]-S[0]-D),c,1)/o:U=Li(Math.abs(A[1]-S[1]-$),u,1)/l;const H=or._round(o*R),V=or._round(l*U);C=d(...y(H,V));const z=k-C[0],Z=I-C[1];this.#f||=[this.x,this.y,this.width,this.height],this.width=H,this.height=V,this.x=z,this.y=Z,this.setDims(n*H,i*V),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#r?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#m)return this._editToolbar;this._editToolbar=new Rh(this),this.div.append(this._editToolbar.render()),this._editToolbar.addButton("comment",this.addCommentButton());const{toolbarButtons:e}=this;if(e)for(const[t,n]of e)await this._editToolbar.addButton(t,n);return this._editToolbar.addButton("delete"),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#r?.destroy())}addContainer(e){const t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#r||(xs.initialize(or._l10n),this.#r=new xs(this),this.#e&&(this.#r.data=this.#e,this.#e=null)),this.#r}get altTextData(){return this.#r?.data}set altTextData(e){this.#r&&(this.#r.data=e)}get guessedAltText(){return this.#r?.guessedText}async setGuessedAltText(e){await this.#r?.setGuessedText(e)}serializeAltText(e){return this.#r?.serialize(e)}hasAltText(){return!!this.#r&&!this.#r.isEmpty()}hasAltTextData(){return this.#r?.hasData()??!1}addCommentButton(){return this.#n?this.#n:this.#n=new uf(this)}get commentColor(){return null}get comment(){const e=this.#n;return{text:e.data.text,date:e.data.date,deleted:e.isDeleted(),color:this.commentColor}}set comment(e){this.#n||(this.#n=new uf(this)),this.#n.data=e}setCommentData(e){this.#n||(this.#n=new uf(this)),this.#n.setInitialText(e)}get hasEditedComment(){return this.#n?.hasBeenEdited()}async editComment(){this.#n||(this.#n=new uf(this)),this.#n.edit()}addComment(e){this.hasEditedComment&&(e.popup={contents:this.comment.text,deleted:this.comment.deleted})}render(){const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=this.#a?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),this.#W();const[t,n]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth=`${(100*n/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/n).toFixed(2)}%`);const[i,a]=this.getInitialTranslation();return this.translate(i,a),Q6(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#k||=new hf({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#_.bind(this),onPinching:this.#S.bind(this),onPinchEnd:this.#B.bind(this),signal:this._uiManager._signal})),this._uiManager._editorUndoBar?.hide(),e}#_(){this.#h={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#r?.toggle(!1),this.parent.togglePointerEvents(!1)}#S(e,t,n){let a=.7*(n/t)+1-.7;if(a===1)return;const s=this.#T(this.rotation),o=(k,I)=>[s[0]*k+s[2]*I,s[1]*k+s[3]*I],[l,c]=this.parentDimensions,u=this.x,h=this.y,d=this.width,f=this.height,p=or.MIN_SIZE/l,m=or.MIN_SIZE/c;a=Math.max(Math.min(a,1/d,1/f),p/d,m/f);const y=or._round(d*a),v=or._round(f*a);if(y===d&&v===f)return;this.#f||=[u,h,d,f];const x=o(d/2,f/2),S=or._round(u+x[0]),A=or._round(h+x[1]),C=o(y/2,v/2);this.x=S-C[0],this.y=A-C[1],this.width=y,this.height=v,this.setDims(l*y,c*v),this.fixAndSetPosition(),this._onResizing()}#B(){this.#r?.toggle(!0),this.parent.togglePointerEvents(!0),this.#R()}pointerdown(e){const{isMac:t}=fi.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(this.#p=!0,this._isDraggable){this.#H(e);return}this.#U(e)}#U(e){const{isMac:t}=fi.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#H(e){const{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1;const i=new AbortController,a=this._uiManager.combinedSignal(i),s={capture:!0,passive:!1,signal:a},o=c=>{i.abort(),this.#i=null,this.#p=!1,this._uiManager.endDragSession()||this.#U(c),n&&this._onStopDragging()};t&&(this.#w=e.clientX,this.#x=e.clientY,this.#i=e.pointerId,this.#s=e.pointerType,window.addEventListener("pointermove",c=>{n||(n=!0,this._onStartDragging());const{clientX:u,clientY:h,pointerId:d}=c;if(d!==this.#i){Xn(c);return}const[f,p]=this.screenToPageTranslation(u-this.#w,h-this.#x);this.#w=u,this.#x=h,this._uiManager.dragSelectedEditors(f,p)},s),window.addEventListener("touchmove",Xn,s),window.addEventListener("pointerdown",c=>{c.pointerType===this.#s&&(this.#k||c.isPrimary)&&o(c),Xn(c)},s));const l=c=>{if(!this.#i||this.#i===c.pointerId){o(c);return}Xn(c)};window.addEventListener("pointerup",l,{signal:a}),window.addEventListener("blur",l,{signal:a})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#b&&clearTimeout(this.#b),this.#b=setTimeout(()=>{this.#b=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){const i=this.parentScale,[a,s]=this.pageDimensions,[o,l]=this.pageTranslation,c=e/i,u=t/i,h=this.x*a,d=this.y*s,f=this.width*a,p=this.height*s;switch(n){case 0:return[h+c+o,s-d-u-p+l,h+c+f+o,s-d-u+l];case 90:return[h+u+o,s-d+c+l,h+u+p+o,s-d+c+f+l];case 180:return[h-c-f+o,s-d+u+l,h-c+o,s-d+u+p+l];case 270:return[h-u-p+o,s-d-c-f+l,h-u+o,s-d-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[n,i,a,s]=e,o=a-n,l=s-i;switch(this.rotation){case 0:return[n,t-s,o,l];case 90:return[n,t-i,l,o];case 180:return[a,t-i,o,l];case 270:return[a,t-s,l,o];default:throw new Error("Invalid rotation")}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),this.#m=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#m=!1,!0):!1}isInEditMode(){return this.#m}shouldGetKeyboardEvents(){return this.#y}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:t,bottom:n,right:i}=this.getClientDimensions(),{innerHeight:a,innerWidth:s}=window;return t<s&&i>0&&e<a&&n>0}#W(){if(this.#u||!this.div)return;this.#u=new AbortController;const e=this._uiManager.combinedSignal(this.#u);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#W()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,t=null){pn("An editor must be serializable")}static async deserialize(e,t,n){const i=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n,annotationElementId:e.annotationElementId});i.rotation=e.rotation,i.#e=e.accessibilityData,i._isCopy=e.isCopy||!1;const[a,s]=i.pageDimensions,[o,l,c,u]=i.getRectInCurrentCoords(e.rect,s);return i.x=o/a,i.y=l/s,i.width=c/a,i.height=u/s,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#u?.abort(),this.#u=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#b&&(clearTimeout(this.#b),this.#b=null),this.#G(),this.removeEditToolbar(),this.#v){for(const e of this.#v.values())clearTimeout(e);this.#v=null}this.parent=null,this.#k?.destroy(),this.#k=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#E(),this.#l.classList.remove("hidden"))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),this.#h={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const t=this.#l.children;if(!this.#t){this.#t=Array.from(t);const s=this.#V.bind(this),o=this.#q.bind(this),l=this._uiManager._signal;for(const c of this.#t){const u=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",s,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",this.#P.bind(this,u),{signal:l}),c.setAttribute("data-l10n-id",or._l10nResizer[u])}}const n=this.#t[0];let i=0;for(const s of t){if(s===n)break;i++}const a=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(a!==i){if(a<i)for(let o=0;o<i-a;o++)this.#l.append(this.#l.firstChild);else if(a>i)for(let o=0;o<a-i;o++)this.#l.firstChild.before(this.#l.lastChild);let s=0;for(const o of t){const c=this.#t[s++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",or._l10nResizer[c])}}this.#F(0),this.#y=!0,this.#l.firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#V(e){or._resizerKeyboardManager.exec(this,e)}#q(e){this.#y&&e.relatedTarget?.parentNode!==this.#l&&this.#G()}#P(e){this.#g=this.#y?e:""}#F(e){if(this.#t)for(const t of this.#t)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#y&&this.#j(this.#g,{deltaX:e,deltaY:t,fromKeyboard:!0})}#G(){this.#y=!1,this.#F(-1),this.#R()}_stopResizingWithKeyboard(){this.#G(),this.div.focus()}select(){if(!(this.isSelected&&this._editToolbar)){if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#r?.toggleAltTextBadge(!1)}}unselect(){this.isSelected&&(this.isSelected=!1,this.#l?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#r?.toggleAltTextBadge(!0))}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id})}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#d}set isEditing(e){this.#d=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){this.#o=!0;const n=e/t,{style:i}=this.div;i.aspectRatio=n,i.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){this.#v||=new Map;const{action:n}=e;let i=this.#v.get(n);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),this.#v.delete(n),this.#v.size===0&&(this.#v=null)},or._telemetryTimeout),this.#v.set(n,i);return}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#a=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#a=!0}renderAnnotationElement(e){let t=e.container.querySelector(".annotationContent");if(!t)t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);else if(t.nodeName==="CANVAS"){const n=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),n.before(t)}return t}resetAnnotationElement(e){const{firstChild:t}=e.container;t?.nodeName==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}}class SP extends or{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Z6=3285377520,Fa=4294901760,Ss=65535;class ey{constructor(e){this.h1=e?e&4294967295:Z6,this.h2=e?e&4294967295:Z6}update(e){let t,n;if(typeof e=="string"){t=new Uint8Array(e.length*2),n=0;for(let m=0,y=e.length;m<y;m++){const v=e.charCodeAt(m);v<=255?t[n++]=v:(t[n++]=v>>>8,t[n++]=v&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const i=n>>2,a=n-i*4,s=new Uint32Array(t.buffer,0,i);let o=0,l=0,c=this.h1,u=this.h2;const h=3432918353,d=461845907,f=h&Ss,p=d&Ss;for(let m=0;m<i;m++)m&1?(o=s[m],o=o*h&Fa|o*f&Ss,o=o<<15|o>>>17,o=o*d&Fa|o*p&Ss,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(l=s[m],l=l*h&Fa|l*f&Ss,l=l<<15|l>>>17,l=l*d&Fa|l*p&Ss,u^=l,u=u<<13|u>>>19,u=u*5+3864292196);switch(o=0,a){case 3:o^=t[i*4+2]<<16;case 2:o^=t[i*4+1]<<8;case 1:o^=t[i*4],o=o*h&Fa|o*f&Ss,o=o<<15|o>>>17,o=o*d&Fa|o*p&Ss,i&1?c^=o:u^=o}this.h1=c,this.h2=u}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&Fa|e*36045&Ss,t=t*4283543511&Fa|((t<<16|e>>>16)*2950163797&Fa)>>>16,e^=t>>>1,e=e*444984403&Fa|e*60499&Ss,t=t*3301882366&Fa|((t<<16|e>>>16)*3120437893&Fa)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const _2=Object.freeze({map:null,hash:"",transfer:void 0});class C2{#e=!1;#t=null;#r=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const n=this.#r.get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return this.#r.get(e)}remove(e){if(this.#r.delete(e),this.#r.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const t of this.#r.values())if(t instanceof or)return;this.onAnnotationEditor(null)}}setValue(e,t){const n=this.#r.get(e);let i=!1;if(n!==void 0)for(const[a,s]of Object.entries(t))n[a]!==s&&(i=!0,n[a]=s);else i=!0,this.#r.set(e,t);i&&this.#n(),t instanceof or&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#r.has(e)}get size(){return this.#r.size}#n(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new ty(this)}get serializable(){if(this.#r.size===0)return _2;const e=new Map,t=new ey,n=[],i=Object.create(null);let a=!1;for(const[s,o]of this.#r){const l=o instanceof or?o.serialize(!1,i):o;l&&(e.set(s,l),t.update(`${s}:${JSON.stringify(l)}`),a||=!!l.bitmap)}if(a)for(const s of e.values())s.bitmap&&n.push(s.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:_2}get editorStats(){let e=null;const t=new Map;for(const n of this.#r.values()){if(!(n instanceof or))continue;const i=n.telemetryFinalData;if(!i)continue;const{type:a}=i;t.has(a)||t.set(a,Object.getPrototypeOf(n).constructor),e||=Object.create(null);const s=e[a]||=new Map;for(const[o,l]of Object.entries(i)){if(o==="type")continue;let c=s.get(o);c||(c=new Map,s.set(o,c));const u=c.get(l)??0;c.set(l,u+1)}}for(const[n,i]of t)e[n]=i.computeTelemetryFinalData(e[n]);return e}resetModifiedIds(){this.#t=null}get modifiedIds(){if(this.#t)return this.#t;const e=[];for(const t of this.#r.values())!(t instanceof or)||!t.annotationElementId||!t.serialize()||e.push(t.annotationElementId);return this.#t={ids:new Set(e),hash:e.join(",")}}[Symbol.iterator](){return this.#r.entries()}}class ty extends C2{#e;constructor(e){super();const{map:t,hash:n,transfer:i}=e.serializable,a=structuredClone(t,i?{transfer:i}:null);this.#e={map:a,hash:n,transfer:i}}get print(){pn("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}get modifiedIds(){return jr(this,"modifiedIds",{ids:new Set,hash:""})}}class kP{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(!(!e||this.#e.has(e.loadedName))){if(Vn(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:a,style:s}=e,o=new FontFace(i,a,s);this.addNativeFontFace(o);try{await o.load(),this.#e.add(i),n?.(e)}catch{Sr(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}pn("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const n=e.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(i){throw Sr(`Failed to load font '${n.family}': '${i}'.`),e.disableFontFace=!0,i}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(n=>{const i=this._queueLoadingCallback(n);this._prepareFontLoadEvent(e,i)})}}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return jr(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return jr(this,"isSyncFontLoadingSupported",Di||fi.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(Vn(!i.done,"completeRequest() cannot be called twice."),i.done=!0;n.length>0&&n[0].done;){const a=n.shift();setTimeout(a.callback,0)}}const{loadingRequests:n}=this,i={done:!1,complete:t,callback:e};return n.push(i),i}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return jr(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function n(A,C){return A.charCodeAt(C)<<24|A.charCodeAt(C+1)<<16|A.charCodeAt(C+2)<<8|A.charCodeAt(C+3)&255}function i(A,C,k,I){const R=A.substring(0,C),U=A.substring(C+k);return R+I+U}let a,s;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;function u(A,C){if(++c>30){Sr("Load test font never loaded."),C();return}if(l.font="30px "+A,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){C();return}setTimeout(u.bind(null,A,C))}const h=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=i(d,976,h.length,h);const p=16,m=1482184792;let y=n(d,p);for(a=0,s=h.length-3;a<s;a+=4)y=y-m+n(h,a)|0;a<h.length&&(y=y-m+n(h+"XXX",a)|0),d=i(d,p,4,oP(y));const v=`url(data:font/opentype;base64,${btoa(d)});`,x=`@font-face {font-family:"${h}";src:${v}}`;this.insertRule(x);const S=this._document.createElement("div");S.style.visibility="hidden",S.style.width=S.style.height="10px",S.style.position="absolute",S.style.top=S.style.left="0px";for(const A of[e.loadedName,h]){const C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=A,S.append(C)}this._document.body.append(S),u(h,()=>{S.remove(),t.complete()})}}class AP{constructor(e,t=null){this.compiledGlyphs=Object.create(null);for(const n in e)this[n]=e[n];this._inspectFont=t}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${Y6(this.data)});`;let t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];const n=this.loadedName+"_path_"+t;let i;try{i=e.get(n)}catch(s){Sr(`getPathGenerator - ignoring character: "${s}".`)}const a=new Path2D(i||"");return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=a}}function _P(r){if(r instanceof URL)return r.href;if(typeof r=="string"){if(Di)return r;const e=URL.parse(r,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function CP(r){if(Di&&typeof Buffer<"u"&&r instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength)return r;if(typeof r=="string")return Ih(r);if(r instanceof ArrayBuffer||ArrayBuffer.isView(r)||typeof r=="object"&&!isNaN(r?.length))return new Uint8Array(r);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function df(r){if(typeof r!="string")return null;if(r.endsWith("/"))return r;throw new Error(`Invalid factory url: "${r}" must include trailing slash.`)}const E2=r=>typeof r=="object"&&Number.isInteger(r?.num)&&r.num>=0&&Number.isInteger(r?.gen)&&r.gen>=0,EP=r=>typeof r=="object"&&typeof r?.name=="string",TP=dP.bind(null,E2,EP);class IP{#e=new Map;#t=Promise.resolve();postMessage(e,t){const n={data:structuredClone(e,t?{transfer:t}:null)};this.#t.then(()=>{for(const[i]of this.#e)i.call(this,n)})}addEventListener(e,t,n=null){let i=null;if(n?.signal instanceof AbortSignal){const{signal:a}=n;if(a.aborted){Sr("LoopbackPort - cannot use an `aborted` signal.");return}const s=()=>this.removeEventListener(e,t);i=()=>a.removeEventListener("abort",s),a.addEventListener("abort",s)}this.#e.set(t,i)}removeEventListener(e,t){this.#e.get(t)?.(),this.#e.delete(t)}terminate(){for(const[,e]of this.#e)e?.();this.#e.clear()}}const ff={DATA:1,ERROR:2},$n={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function ry(){}function Ji(r){if(r instanceof Ko||r instanceof p2||r instanceof V6||r instanceof of||r instanceof g2)return r;switch(r instanceof Error||typeof r=="object"&&r!==null||pn('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),r.name){case"AbortException":return new Ko(r.message);case"InvalidPDFException":return new p2(r.message);case"PasswordException":return new V6(r.message,r.code);case"ResponseException":return new of(r.message,r.status,r.missing);case"UnknownErrorException":return new g2(r.message,r.details)}return new g2(r.message,r.toString())}class Fh{#e=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener("message",this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#n(e);return}if(e.callback){const n=e.callbackId,i=this.callbackCapabilities[n];if(!i)throw new Error(`Cannot resolve callback ${n}`);if(delete this.callbackCapabilities[n],e.callback===ff.DATA)i.resolve(e.data);else if(e.callback===ff.ERROR)i.reject(Ji(e.reason));else throw new Error("Unexpected callback case");return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const n=this.sourceName,i=e.sourceName,a=this.comObj;Promise.try(t,e.data).then(function(s){a.postMessage({sourceName:n,targetName:i,callback:ff.DATA,callbackId:e.callbackId,data:s})},function(s){a.postMessage({sourceName:n,targetName:i,callback:ff.ERROR,callbackId:e.callbackId,reason:Ji(s)})});return}if(e.streamId){this.#r(e);return}t(e.data)}on(e,t){const n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const i=this.callbackId++,a=Promise.withResolvers();this.callbackCapabilities[i]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},n)}catch(s){a.reject(s)}return a.promise}sendWithStream(e,t,n,i){const a=this.streamId++,s=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const u=Promise.withResolvers();return this.streamControllers[a]={controller:c,startCall:u,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:s,targetName:o,action:e,streamId:a,data:t,desiredSize:c.desiredSize},i),u.promise},pull:c=>{const u=Promise.withResolvers();return this.streamControllers[a].pullCall=u,l.postMessage({sourceName:s,targetName:o,stream:$n.PULL,streamId:a,desiredSize:c.desiredSize}),u.promise},cancel:c=>{Vn(c instanceof Error,"cancel must have a valid reason");const u=Promise.withResolvers();return this.streamControllers[a].cancelCall=u,this.streamControllers[a].isClosed=!0,l.postMessage({sourceName:s,targetName:o,stream:$n.CANCEL,streamId:a,reason:Ji(c)}),u.promise}},n)}#r(e){const t=e.streamId,n=this.sourceName,i=e.sourceName,a=this.comObj,s=this,o=this.actionHandler[e.action],l={enqueue(c,u=1,h){if(this.isCancelled)return;const d=this.desiredSize;this.desiredSize-=u,d>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),a.postMessage({sourceName:n,targetName:i,stream:$n.ENQUEUE,streamId:t,chunk:c},h)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:i,stream:$n.CLOSE,streamId:t}),delete s.streamSinks[t])},error(c){Vn(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:i,stream:$n.ERROR,streamId:t,reason:Ji(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[t]=l,Promise.try(o,e.data,l).then(function(){a.postMessage({sourceName:n,targetName:i,stream:$n.START_COMPLETE,streamId:t,success:!0})},function(c){a.postMessage({sourceName:n,targetName:i,stream:$n.START_COMPLETE,streamId:t,reason:Ji(c)})})}#n(e){const t=e.streamId,n=this.sourceName,i=e.sourceName,a=this.comObj,s=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case $n.START_COMPLETE:e.success?s.startCall.resolve():s.startCall.reject(Ji(e.reason));break;case $n.PULL_COMPLETE:e.success?s.pullCall.resolve():s.pullCall.reject(Ji(e.reason));break;case $n.PULL:if(!o){a.postMessage({sourceName:n,targetName:i,stream:$n.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||ry).then(function(){a.postMessage({sourceName:n,targetName:i,stream:$n.PULL_COMPLETE,streamId:t,success:!0})},function(c){a.postMessage({sourceName:n,targetName:i,stream:$n.PULL_COMPLETE,streamId:t,reason:Ji(c)})});break;case $n.ENQUEUE:if(Vn(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case $n.CLOSE:if(Vn(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),this.#a(s,t);break;case $n.ERROR:Vn(s,"error should have stream controller"),s.controller.error(Ji(e.reason)),this.#a(s,t);break;case $n.CANCEL_COMPLETE:e.success?s.cancelCall.resolve():s.cancelCall.reject(Ji(e.reason)),this.#a(s,t);break;case $n.CANCEL:if(!o)break;const l=Ji(e.reason);Promise.try(o.onCancel||ry,l).then(function(){a.postMessage({sourceName:n,targetName:i,stream:$n.CANCEL_COMPLETE,streamId:t,success:!0})},function(c){a.postMessage({sourceName:n,targetName:i,stream:$n.CANCEL_COMPLETE,streamId:t,reason:Ji(c)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#a(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}}class ny{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!this.#e})}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){pn("Abstract method `_createCanvas` called.")}}class MP extends ny{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){const n=this._document.createElement("canvas");return n.width=e,n.height=t,n}}class iy{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(t).then(n=>({cMapData:n,isCompressed:this.isCompressed})).catch(n=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}async _fetch(e){pn("Abstract method `_fetch` called.")}}class ay extends iy{async _fetch(e){const t=await Mh(e,this.isCompressed?"arraybuffer":"text");return t instanceof ArrayBuffer?new Uint8Array(t):Ih(t)}}class sy{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,n,i,a){return"none"}destroy(e=!1){}}class OP extends sy{#e;#t;#r;#n;#a;#i;#s=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#n=e,this.#a=t}get#o(){return this.#t||=new Map}get#l(){return this.#i||=new Map}get#c(){if(!this.#r){const e=this.#a.createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;const n=this.#a.createElementNS(to,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#r=this.#a.createElementNS(to,"defs"),e.append(n),n.append(this.#r),this.#a.body.append(e)}return this.#r}#h(e){if(e.length===1){const l=e[0],c=new Array(256);for(let h=0;h<256;h++)c[h]=l[h]/255;const u=c.join(",");return[u,u,u]}const[t,n,i]=e,a=new Array(256),s=new Array(256),o=new Array(256);for(let l=0;l<256;l++)a[l]=t[l]/255,s[l]=n[l]/255,o[l]=i[l]/255;return[a.join(","),s.join(","),o.join(",")]}#u(e){if(this.#e===void 0){this.#e="";const t=this.#a.URL;t!==this.#a.baseURI&&(lf(t)?Sr('#createUrl: ignore "data:"-URL for performance reasons.'):this.#e=W6(t,""))}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return"none";let t=this.#o.get(e);if(t)return t;const[n,i,a]=this.#h(e),s=e.length===1?n:`${n}${i}${a}`;if(t=this.#o.get(s),t)return this.#o.set(e,t),t;const o=`g_${this.#n}_transfer_map_${this.#s++}`,l=this.#u(o);this.#o.set(e,l),this.#o.set(s,l);const c=this.#f(o);return this.#m(n,i,a,c),l}addHCMFilter(e,t){const n=`${e}-${t}`,i="base";let a=this.#l.get(i);if(a?.key===n||(a?(a.filter?.remove(),a.key=n,a.url="none",a.filter=null):(a={key:n,url:"none",filter:null},this.#l.set(i,a)),!e||!t))return a.url;const s=this.#b(e);e=nr.makeHexColor(...s);const o=this.#b(t);if(t=nr.makeHexColor(...o),this.#c.style.color="",e==="#000000"&&t==="#ffffff"||e===t)return a.url;const l=new Array(256);for(let f=0;f<=255;f++){const p=f/255;l[f]=p<=.03928?p/12.92:((p+.055)/1.055)**2.4}const c=l.join(","),u=`g_${this.#n}_hcm_filter`,h=a.filter=this.#f(u);this.#m(c,c,c,h),this.#p(h);const d=(f,p)=>{const m=s[f]/255,y=o[f]/255,v=new Array(p+1);for(let x=0;x<=p;x++)v[x]=m+x/p*(y-m);return v.join(",")};return this.#m(d(0,5),d(1,5),d(2,5),h),a.url=this.#u(u),a.url}addAlphaFilter(e){let t=this.#o.get(e);if(t)return t;const[n]=this.#h([e]),i=`alpha_${n}`;if(t=this.#o.get(i),t)return this.#o.set(e,t),t;const a=`g_${this.#n}_alpha_map_${this.#s++}`,s=this.#u(a);this.#o.set(e,s),this.#o.set(i,s);const o=this.#f(a);return this.#y(n,o),s}addLuminosityFilter(e){let t=this.#o.get(e||"luminosity");if(t)return t;let n,i;if(e?([n]=this.#h([e]),i=`luminosity_${n}`):i="luminosity",t=this.#o.get(i),t)return this.#o.set(e,t),t;const a=`g_${this.#n}_luminosity_map_${this.#s++}`,s=this.#u(a);this.#o.set(e,s),this.#o.set(i,s);const o=this.#f(a);return this.#g(o),e&&this.#y(n,o),s}addHighlightHCMFilter(e,t,n,i,a){const s=`${t}-${n}-${i}-${a}`;let o=this.#l.get(e);if(o?.key===s||(o?(o.filter?.remove(),o.key=s,o.url="none",o.filter=null):(o={key:s,url:"none",filter:null},this.#l.set(e,o)),!t||!n))return o.url;const[l,c]=[t,n].map(this.#b.bind(this));let u=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),h=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[d,f]=[i,a].map(this.#b.bind(this));h<u&&([u,h,d,f]=[h,u,f,d]),this.#c.style.color="";const p=(v,x,S)=>{const A=new Array(256),C=(h-u)/S,k=v/255,I=(x-v)/(255*S);let R=0;for(let U=0;U<=S;U++){const D=Math.round(u+U*C),$=k+U*I;for(let H=R;H<=D;H++)A[H]=$;R=D+1}for(let U=R;U<256;U++)A[U]=A[R-1];return A.join(",")},m=`g_${this.#n}_hcm_${e}_filter`,y=o.filter=this.#f(m);return this.#p(y),this.#m(p(d[0],f[0],5),p(d[1],f[1],5),p(d[2],f[2],5),y),o.url=this.#u(m),o.url}destroy(e=!1){e&&this.#i?.size||(this.#r?.parentNode.parentNode.remove(),this.#r=null,this.#t?.clear(),this.#t=null,this.#i?.clear(),this.#i=null,this.#s=0)}#g(e){const t=this.#a.createElementNS(to,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),e.append(t)}#p(e){const t=this.#a.createElementNS(to,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(t)}#f(e){const t=this.#a.createElementNS(to,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#c.append(t),t}#d(e,t,n){const i=this.#a.createElementNS(to,t);i.setAttribute("type","discrete"),i.setAttribute("tableValues",n),e.append(i)}#m(e,t,n,i){const a=this.#a.createElementNS(to,"feComponentTransfer");i.append(a),this.#d(a,"feFuncR",e),this.#d(a,"feFuncG",t),this.#d(a,"feFuncB",n)}#y(e,t){const n=this.#a.createElementNS(to,"feComponentTransfer");t.append(n),this.#d(n,"feFuncA",e)}#b(e){return this.#c.style.color=e,cf(getComputedStyle(this.#c).getPropertyValue("color"))}}class oy{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetch(t).catch(n=>{throw new Error(`Unable to load font data at: ${t}`)})}async _fetch(e){pn("Abstract method `_fetch` called.")}}class ly extends oy{async _fetch(e){const t=await Mh(e,"arraybuffer");return new Uint8Array(t)}}class cy{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetch(t).catch(n=>{throw new Error(`Unable to load wasm data at: ${t}`)})}async _fetch(e){pn("Abstract method `_fetch` called.")}}class uy extends cy{async _fetch(e){const t=await Mh(e,"arraybuffer");return new Uint8Array(t)}}Di&&Sr("Please use the `legacy` build in Node.js environments.");async function T2(r){const t=await process.getBuiltinModule("fs").promises.readFile(r);return new Uint8Array(t)}class NP extends sy{}class RP extends ny{_createCanvas(e,t){return process.getBuiltinModule("module").createRequire(Fr&&Fr.tagName.toUpperCase()==="SCRIPT"&&Fr.src||new URL("_app/immutable/bundle.DkfpbWnE.js",document.baseURI).href)("@napi-rs/canvas").createCanvas(e,t)}}class PP extends iy{async _fetch(e){return T2(e)}}class FP extends oy{async _fetch(e){return T2(e)}}class DP extends cy{async _fetch(e){return T2(e)}}const gi={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function I2(r,e){if(!e)return;const t=e[2]-e[0],n=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],t,n),r.clip(i)}class M2{isModifyingCurrentTransform(){return!1}getPattern(){pn("Abstract method `getPattern` called.")}}class LP extends M2{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;this._type==="axial"?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const n of this._colorStops)t.addColorStop(n[0],n[1]);return t}getPattern(e,t,n,i){let a;if(i===gi.STROKE||i===gi.FILL){const s=t.current.getClippedPathBoundingBox(i,Mn(e))||[0,0,0,0],o=Math.ceil(s[2]-s[0])||1,l=Math.ceil(s[3]-s[1])||1,c=t.cachedCanvases.getCanvas("pattern",o,l),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-s[0],-s[1]),n=nr.transform(n,[1,0,0,1,s[0],s[1]]),u.transform(...t.baseTransform),this.matrix&&u.transform(...this.matrix),I2(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),a=e.createPattern(c.canvas,"no-repeat");const h=new DOMMatrix(n);a.setTransform(h)}else I2(e,this._bbox),a=this._createGradient(e);return a}}function O2(r,e,t,n,i,a,s,o){const l=e.coords,c=e.colors,u=r.data,h=r.width*4;let d;l[t+1]>l[n+1]&&(d=t,t=n,n=d,d=a,a=s,s=d),l[n+1]>l[i+1]&&(d=n,n=i,i=d,d=s,s=o,o=d),l[t+1]>l[n+1]&&(d=t,t=n,n=d,d=a,a=s,s=d);const f=(l[t]+e.offsetX)*e.scaleX,p=(l[t+1]+e.offsetY)*e.scaleY,m=(l[n]+e.offsetX)*e.scaleX,y=(l[n+1]+e.offsetY)*e.scaleY,v=(l[i]+e.offsetX)*e.scaleX,x=(l[i+1]+e.offsetY)*e.scaleY;if(p>=x)return;const S=c[a],A=c[a+1],C=c[a+2],k=c[s],I=c[s+1],R=c[s+2],U=c[o],D=c[o+1],$=c[o+2],H=Math.round(p),V=Math.round(x);let z,Z,q,re,X,ie,P,be;for(let _e=H;_e<=V;_e++){if(_e<y){const Le=_e<p?0:(p-_e)/(p-y);z=f-(f-m)*Le,Z=S-(S-k)*Le,q=A-(A-I)*Le,re=C-(C-R)*Le}else{let Le;_e>x?Le=1:y===x?Le=0:Le=(y-_e)/(y-x),z=m-(m-v)*Le,Z=k-(k-U)*Le,q=I-(I-D)*Le,re=R-(R-$)*Le}let W;_e<p?W=0:_e>x?W=1:W=(p-_e)/(p-x),X=f-(f-v)*W,ie=S-(S-U)*W,P=A-(A-D)*W,be=C-(C-$)*W;const me=Math.round(Math.min(z,X)),He=Math.round(Math.max(z,X));let Xe=h*_e+me*4;for(let Le=me;Le<=He;Le++)W=(z-Le)/(z-X),W<0?W=0:W>1&&(W=1),u[Xe++]=Z-(Z-ie)*W|0,u[Xe++]=q-(q-P)*W|0,u[Xe++]=re-(re-be)*W|0,u[Xe++]=255}}function BP(r,e,t){const n=e.coords,i=e.colors;let a,s;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(a=0;a<l;a++){let u=a*o;for(let h=0;h<c;h++,u++)O2(r,t,n[u],n[u+1],n[u+o],i[u],i[u+1],i[u+o]),O2(r,t,n[u+o+1],n[u+1],n[u+o],i[u+o+1],i[u+1],i[u+o])}break;case"triangles":for(a=0,s=n.length;a<s;a+=3)O2(r,t,n[a],n[a+1],n[a+2],i[a],i[a+1],i[a+2]);break;default:throw new Error("illegal figure")}}class UP extends M2{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,t,n){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,u=Math.ceil(this._bounds[3])-l,h=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3),d=Math.min(Math.ceil(Math.abs(u*e[1]*1.1)),3e3),f=c/h,p=u/d,m={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/f,scaleY:1/p},y=h+4,v=d+4,x=n.getCanvas("mesh",y,v),S=x.context,A=S.createImageData(h,d);if(t){const k=A.data;for(let I=0,R=k.length;I<R;I+=4)k[I]=t[0],k[I+1]=t[1],k[I+2]=t[2],k[I+3]=255}for(const k of this._figures)BP(A,k,m);return S.putImageData(A,2,2),{canvas:x.canvas,offsetX:o-2*f,offsetY:l-2*p,scaleX:f,scaleY:p}}isModifyingCurrentTransform(){return!0}getPattern(e,t,n,i){I2(e,this._bbox);const a=new Float32Array(2);if(i===gi.SHADING)nr.singularValueDecompose2dScale(Mn(e),a);else if(this.matrix){nr.singularValueDecompose2dScale(this.matrix,a);const[o,l]=a;nr.singularValueDecompose2dScale(t.baseTransform,a),a[0]*=o,a[1]*=l}else nr.singularValueDecompose2dScale(t.baseTransform,a);const s=this._createMeshCanvas(a,i===gi.SHADING?null:this._background,t.cachedCanvases);return i!==gi.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}}class zP extends M2{getPattern(){return"hotpink"}}function jP(r){switch(r[0]){case"RadialAxial":return new LP(r);case"Mesh":return new UP(r);case"Dummy":return new zP}throw new Error(`Unknown IR type: ${r[0]}`)}const hy={COLORED:1,UNCOLORED:2};class N2{static MAX_PATTERN_SIZE=3e3;constructor(e,t,n,i){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=t,this.canvasGraphicsFactory=n,this.baseTransform=i}createPatternCanvas(e){const{bbox:t,operatorList:n,paintType:i,tilingType:a,color:s,canvasGraphicsFactory:o}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),sf("TilingType: "+a);const u=t[0],h=t[1],d=t[2],f=t[3],p=d-u,m=f-h,y=new Float32Array(2);nr.singularValueDecompose2dScale(this.matrix,y);const[v,x]=y;nr.singularValueDecompose2dScale(this.baseTransform,y);const S=v*y[0],A=x*y[1];let C=p,k=m,I=!1,R=!1;const U=Math.ceil(l*S),D=Math.ceil(c*A),$=Math.ceil(p*S),H=Math.ceil(m*A);U>=$?C=l:I=!0,D>=H?k=c:R=!0;const V=this.getSizeAndScale(C,this.ctx.canvas.width,S),z=this.getSizeAndScale(k,this.ctx.canvas.height,A),Z=e.cachedCanvases.getCanvas("pattern",V.size,z.size),q=Z.context,re=o.createCanvasGraphics(q);if(re.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(re,i,s),q.translate(-V.scale*u,-z.scale*h),re.transform(V.scale,0,0,z.scale,0,0),q.save(),this.clipBbox(re,u,h,d,f),re.baseTransform=Mn(re.ctx),re.executeOperatorList(n),re.endDrawing(),q.restore(),I||R){const X=Z.canvas;I&&(C=l),R&&(k=c);const ie=this.getSizeAndScale(C,this.ctx.canvas.width,S),P=this.getSizeAndScale(k,this.ctx.canvas.height,A),be=ie.size,_e=P.size,W=e.cachedCanvases.getCanvas("pattern-workaround",be,_e),me=W.context,He=I?Math.floor(p/l):0,Xe=R?Math.floor(m/c):0;for(let Le=0;Le<=He;Le++)for(let bt=0;bt<=Xe;bt++)me.drawImage(X,be*Le,_e*bt,be,_e,0,0,be,_e);return{canvas:W.canvas,scaleX:ie.scale,scaleY:P.scale,offsetX:u,offsetY:h}}return{canvas:Z.canvas,scaleX:V.scale,scaleY:z.scale,offsetX:u,offsetY:h}}getSizeAndScale(e,t,n){const i=Math.max(N2.MAX_PATTERN_SIZE,t);let a=Math.ceil(e*n);return a>=i?a=i:n=a/e,{scale:n,size:a}}clipBbox(e,t,n,i,a){const s=i-t,o=a-n;e.ctx.rect(t,n,s,o),nr.axialAlignedBoundingBox([t,n,i,a],Mn(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const i=e.ctx,a=e.current;switch(t){case hy.COLORED:const{fillStyle:s,strokeStyle:o}=this.ctx;i.fillStyle=a.fillColor=s,i.strokeStyle=a.strokeColor=o;break;case hy.UNCOLORED:i.fillStyle=i.strokeStyle=n,a.fillColor=a.strokeColor=n;break;default:throw new sP(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,n,i){let a=n;i!==gi.SHADING&&(a=nr.transform(a,t.baseTransform),this.matrix&&(a=nr.transform(a,this.matrix)));const s=this.createPatternCanvas(t);let o=new DOMMatrix(a);o=o.translate(s.offsetX,s.offsetY),o=o.scale(1/s.scaleX,1/s.scaleY);const l=e.createPattern(s.canvas,"repeat");return l.setTransform(o),l}}function HP({src:r,srcPos:e=0,dest:t,width:n,height:i,nonBlackColor:a=4294967295,inverseDecode:s=!1}){const o=fi.isLittleEndian?4278190080:255,[l,c]=s?[a,o]:[o,a],u=n>>3,h=n&7,d=r.length;t=new Uint32Array(t.buffer);let f=0;for(let p=0;p<i;p++){for(const y=e+u;e<y;e++){const v=e<d?r[e]:255;t[f++]=v&128?c:l,t[f++]=v&64?c:l,t[f++]=v&32?c:l,t[f++]=v&16?c:l,t[f++]=v&8?c:l,t[f++]=v&4?c:l,t[f++]=v&2?c:l,t[f++]=v&1?c:l}if(h===0)continue;const m=e<d?r[e++]:255;for(let y=0;y<h;y++)t[f++]=m&1<<7-y?c:l}return{srcPos:e,destPos:f}}const dy=16,fy=100,qP=15,gy=10,Qi=16,R2=new DOMMatrix,ma=new Float32Array(2),nu=new Float32Array([1/0,1/0,-1/0,-1/0]);function GP(r,e){if(r._removeMirroring)throw new Error("Context is already forwarding operations.");r.__originalSave=r.save,r.__originalRestore=r.restore,r.__originalRotate=r.rotate,r.__originalScale=r.scale,r.__originalTranslate=r.translate,r.__originalTransform=r.transform,r.__originalSetTransform=r.setTransform,r.__originalResetTransform=r.resetTransform,r.__originalClip=r.clip,r.__originalMoveTo=r.moveTo,r.__originalLineTo=r.lineTo,r.__originalBezierCurveTo=r.bezierCurveTo,r.__originalRect=r.rect,r.__originalClosePath=r.closePath,r.__originalBeginPath=r.beginPath,r._removeMirroring=()=>{r.save=r.__originalSave,r.restore=r.__originalRestore,r.rotate=r.__originalRotate,r.scale=r.__originalScale,r.translate=r.__originalTranslate,r.transform=r.__originalTransform,r.setTransform=r.__originalSetTransform,r.resetTransform=r.__originalResetTransform,r.clip=r.__originalClip,r.moveTo=r.__originalMoveTo,r.lineTo=r.__originalLineTo,r.bezierCurveTo=r.__originalBezierCurveTo,r.rect=r.__originalRect,r.closePath=r.__originalClosePath,r.beginPath=r.__originalBeginPath,delete r._removeMirroring},r.save=function(){e.save(),this.__originalSave()},r.restore=function(){e.restore(),this.__originalRestore()},r.translate=function(t,n){e.translate(t,n),this.__originalTranslate(t,n)},r.scale=function(t,n){e.scale(t,n),this.__originalScale(t,n)},r.transform=function(t,n,i,a,s,o){e.transform(t,n,i,a,s,o),this.__originalTransform(t,n,i,a,s,o)},r.setTransform=function(t,n,i,a,s,o){e.setTransform(t,n,i,a,s,o),this.__originalSetTransform(t,n,i,a,s,o)},r.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},r.rotate=function(t){e.rotate(t),this.__originalRotate(t)},r.clip=function(t){e.clip(t),this.__originalClip(t)},r.moveTo=function(t,n){e.moveTo(t,n),this.__originalMoveTo(t,n)},r.lineTo=function(t,n){e.lineTo(t,n),this.__originalLineTo(t,n)},r.bezierCurveTo=function(t,n,i,a,s,o){e.bezierCurveTo(t,n,i,a,s,o),this.__originalBezierCurveTo(t,n,i,a,s,o)},r.rect=function(t,n,i,a){e.rect(t,n,i,a),this.__originalRect(t,n,i,a)},r.closePath=function(){e.closePath(),this.__originalClosePath()},r.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class WP{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let i;return this.cache[e]!==void 0?(i=this.cache[e],this.canvasFactory.reset(i,t,n)):(i=this.canvasFactory.create(t,n),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function gf(r,e,t,n,i,a,s,o,l,c){const[u,h,d,f,p,m]=Mn(r);if(h===0&&d===0){const x=s*u+p,S=Math.round(x),A=o*f+m,C=Math.round(A),k=(s+l)*u+p,I=Math.abs(Math.round(k)-S)||1,R=(o+c)*f+m,U=Math.abs(Math.round(R)-C)||1;return r.setTransform(Math.sign(u),0,0,Math.sign(f),S,C),r.drawImage(e,t,n,i,a,0,0,I,U),r.setTransform(u,h,d,f,p,m),[I,U]}if(u===0&&f===0){const x=o*d+p,S=Math.round(x),A=s*h+m,C=Math.round(A),k=(o+c)*d+p,I=Math.abs(Math.round(k)-S)||1,R=(s+l)*h+m,U=Math.abs(Math.round(R)-C)||1;return r.setTransform(0,Math.sign(h),Math.sign(d),0,S,C),r.drawImage(e,t,n,i,a,0,0,U,I),r.setTransform(u,h,d,f,p,m),[U,I]}r.drawImage(e,t,n,i,a,s,o,l,c);const y=Math.hypot(u,h),v=Math.hypot(d,f);return[y*l,v*c]}class py{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=d2;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=_i.FILL;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(e,t){this.clipBox=new Float32Array([0,0,e,t]),this.minMax=nu.slice()}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=gi.FILL,t=null){const n=this.minMax.slice();if(e===gi.STROKE){t||pn("Stroke bounding box must include transform."),nr.singularValueDecompose2dScale(t,ma);const i=ma[0]*this.lineWidth/2,a=ma[1]*this.lineWidth/2;n[0]-=i,n[1]-=a,n[2]+=i,n[3]+=a}return n}updateClipFromPath(){const e=nr.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(nu,0)}getClippedPathBoundingBox(e=gi.FILL,t=null){return nr.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function my(r,e){if(e instanceof ImageData){r.putImageData(e,0,0);return}const t=e.height,n=e.width,i=t%Qi,a=(t-i)/Qi,s=i===0?a:a+1,o=r.createImageData(n,Qi);let l=0,c;const u=e.data,h=o.data;let d,f,p,m;if(e.kind===ef.GRAYSCALE_1BPP){const y=u.byteLength,v=new Uint32Array(h.buffer,0,h.byteLength>>2),x=v.length,S=n+7>>3,A=4294967295,C=fi.isLittleEndian?4278190080:255;for(d=0;d<s;d++){for(p=d<a?Qi:i,c=0,f=0;f<p;f++){const k=y-l;let I=0;const R=k>S?n:k*8-7,U=R&-8;let D=0,$=0;for(;I<U;I+=8)$=u[l++],v[c++]=$&128?A:C,v[c++]=$&64?A:C,v[c++]=$&32?A:C,v[c++]=$&16?A:C,v[c++]=$&8?A:C,v[c++]=$&4?A:C,v[c++]=$&2?A:C,v[c++]=$&1?A:C;for(;I<R;I++)D===0&&($=u[l++],D=128),v[c++]=$&D?A:C,D>>=1}for(;c<x;)v[c++]=0;r.putImageData(o,0,d*Qi)}}else if(e.kind===ef.RGBA_32BPP){for(f=0,m=n*Qi*4,d=0;d<a;d++)h.set(u.subarray(l,l+m)),l+=m,r.putImageData(o,0,f),f+=Qi;d<s&&(m=n*i*4,h.set(u.subarray(l,l+m)),r.putImageData(o,0,f))}else if(e.kind===ef.RGB_24BPP)for(p=Qi,m=n*p,d=0;d<s;d++){for(d>=a&&(p=i,m=n*p),c=0,f=m;f--;)h[c++]=u[l++],h[c++]=u[l++],h[c++]=u[l++],h[c++]=255;r.putImageData(o,0,d*Qi)}else throw new Error(`bad image kind: ${e.kind}`)}function by(r,e){if(e.bitmap){r.drawImage(e.bitmap,0,0);return}const t=e.height,n=e.width,i=t%Qi,a=(t-i)/Qi,s=i===0?a:a+1,o=r.createImageData(n,Qi);let l=0;const c=e.data,u=o.data;for(let h=0;h<s;h++){const d=h<a?Qi:i;({srcPos:l}=HP({src:c,srcPos:l,dest:u,width:n,height:d,nonBlackColor:0})),r.putImageData(o,0,h*Qi)}}function Dh(r,e){const t=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of t)r[n]!==void 0&&(e[n]=r[n]);r.setLineDash!==void 0&&(e.setLineDash(r.getLineDash()),e.lineDashOffset=r.lineDashOffset)}function pf(r){r.strokeStyle=r.fillStyle="#000000",r.fillRule="nonzero",r.globalAlpha=1,r.lineWidth=1,r.lineCap="butt",r.lineJoin="miter",r.miterLimit=10,r.globalCompositeOperation="source-over",r.font="10px sans-serif",r.setLineDash!==void 0&&(r.setLineDash([]),r.lineDashOffset=0);const{filter:e}=r;e!=="none"&&e!==""&&(r.filter="none")}function vy(r,e){if(e)return!0;nr.singularValueDecompose2dScale(r,ma);const t=Math.fround(ws.pixelRatio*ru.PDF_TO_CSS_UNITS);return ma[0]<=t&&ma[1]<=t}const VP=["butt","round","square"],XP=["miter","round","bevel"],$P={},yy={};class iu{constructor(e,t,n,i,a,{optionalContentConfig:s,markedContentStack:o=null},l,c){this.ctx=e,this.current=new py(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=i,this.filterFactory=a,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=s,this.cachedCanvases=new WP(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return typeof e=="string"?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:i=null}){const a=this.ctx.canvas.width,s=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,a,s),this.ctx.fillStyle=o,n){const l=this.cachedCanvases.getCanvas("transparent",a,s);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...Mn(this.compositeCtx))}this.ctx.save(),pf(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=Mn(this.ctx)}executeOperatorList(e,t,n,i){const a=e.argsArray,s=e.fnArray;let o=t||0;const l=a.length;if(l===o)return o;const c=l-o>gy&&typeof n=="function",u=c?Date.now()+qP:0;let h=0;const d=this.commonObjs,f=this.objs;let p;for(;;){if(i!==void 0&&o===i.nextBreakPoint)return i.breakIt(o,n),o;if(p=s[o],p!==rf.dependency)this[p].apply(this,a[o]);else for(const m of a[o]){const y=m.startsWith("g_")?d:f;if(!y.has(m))return y.get(m,n),o}if(o++,o===l)return o;if(c&&++h>gy){if(Date.now()>u)return n(),o;h=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){const n=e.width??e.displayWidth,i=e.height??e.displayHeight;let a=Math.max(Math.hypot(t[0],t[1]),1),s=Math.max(Math.hypot(t[2],t[3]),1),o=n,l=i,c="prescale1",u,h;for(;a>2&&o>1||s>2&&l>1;){let d=o,f=l;a>2&&o>1&&(d=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),a/=o/d),s>2&&l>1&&(f=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,s/=l/f),u=this.cachedCanvases.getCanvas(c,d,f),h=u.context,h.clearRect(0,0,d,f),h.drawImage(e,0,0,o,l,0,0,d,f),e=u.canvas,o=d,l=f,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:l}}_createMaskCanvas(e){const t=this.ctx,{width:n,height:i}=e,a=this.current.fillColor,s=this.current.patternFill,o=Mn(t);let l,c,u,h;if((e.bitmap||e.data)&&e.count>1){const U=e.bitmap||e.data.buffer;c=JSON.stringify(s?o:[o.slice(0,4),a]),l=this._cachedBitmapsMap.get(U),l||(l=new Map,this._cachedBitmapsMap.set(U,l));const D=l.get(c);if(D&&!s){const $=Math.round(Math.min(o[0],o[2])+o[4]),H=Math.round(Math.min(o[1],o[3])+o[5]);return{canvas:D,offsetX:$,offsetY:H}}u=D}u||(h=this.cachedCanvases.getCanvas("maskCanvas",n,i),by(h.context,e));let d=nr.transform(o,[1/n,0,0,-1/i,0,0]);d=nr.transform(d,[1,0,0,1,0,-i]);const f=nu.slice();nr.axialAlignedBoundingBox([0,0,n,i],d,f);const[p,m,y,v]=f,x=Math.round(y-p)||1,S=Math.round(v-m)||1,A=this.cachedCanvases.getCanvas("fillCanvas",x,S),C=A.context,k=p,I=m;C.translate(-k,-I),C.transform(...d),u||(u=this._scaleImage(h.canvas,ys(C)),u=u.img,l&&s&&l.set(c,u)),C.imageSmoothingEnabled=vy(Mn(C),e.interpolate),gf(C,u,0,0,u.width,u.height,0,0,n,i),C.globalCompositeOperation="source-in";const R=nr.transform(ys(C),[1,0,0,1,-k,-I]);return C.fillStyle=s?a.getPattern(t,this,R,gi.FILL):a,C.fillRect(0,0,n,i),l&&!s&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,A.canvas)),{canvas:A.canvas,offsetX:Math.round(k),offsetY:Math.round(I)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=VP[e]}setLineJoin(e){this.ctx.lineJoin=XP[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const n=this.ctx;n.setLineDash!==void 0&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.ctx.globalAlpha=this.current.fillAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(n,e,t);this.suspendedCtx=this.ctx;const a=this.ctx=i.context;a.setTransform(this.suspendedCtx.getTransform()),Dh(this.suspendedCtx,a),GP(a,this.suspendedCtx),this.setGState([["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Dh(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,n,i){const a=i[0],s=i[1],o=i[2]-a,l=i[3]-s;o===0||l===0||(this.genericComposeSMask(t.context,n,o,l,t.subtype,t.backdrop,t.transferMap,a,s,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore())}genericComposeSMask(e,t,n,i,a,s,o,l,c,u,h){let d=e.canvas,f=l-u,p=c-h;if(s)if(f<0||p<0||f+n>d.width||p+i>d.height){const y=this.cachedCanvases.getCanvas("maskExtension",n,i),v=y.context;v.drawImage(d,-f,-p),v.globalCompositeOperation="destination-atop",v.fillStyle=s,v.fillRect(0,0,n,i),v.globalCompositeOperation="source-over",d=y.canvas,f=p=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const y=new Path2D;y.rect(f,p,n,i),e.clip(y),e.globalCompositeOperation="destination-atop",e.fillStyle=s,e.fillRect(f,p,n,i),e.restore()}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),a==="Alpha"&&o?t.filter=this.filterFactory.addAlphaFilter(o):a==="Luminosity"&&(t.filter=this.filterFactory.addLuminosityFilter(o));const m=new Path2D;m.rect(l,c,n,i),t.clip(m),t.globalCompositeOperation="destination-in",t.drawImage(d,f,p,n,i,l,c,n,i),t.restore()}save(){this.inSMaskMode&&Dh(this.ctx,this.suspendedCtx),this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){if(this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&Dh(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,t,n,i,a,s){this.ctx.transform(e,t,n,i,a,s),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n){let[i]=t;if(!n){i||=t[0]=new Path2D,this[e](i);return}if(!(i instanceof Path2D)){const a=t[0]=new Path2D;for(let s=0,o=i.length;s<o;)switch(i[s++]){case nf.moveTo:a.moveTo(i[s++],i[s++]);break;case nf.lineTo:a.lineTo(i[s++],i[s++]);break;case nf.curveTo:a.bezierCurveTo(i[s++],i[s++],i[s++],i[s++],i[s++],i[s++]);break;case nf.closePath:a.closePath();break;default:Sr(`Unrecognized drawing path operator: ${i[s-1]}`);break}i=a}nr.axialAlignedBoundingBox(n,Mn(this.ctx),this.current.minMax),this[e](i)}closePath(){this.ctx.closePath()}stroke(e,t=!0){const n=this.ctx,i=this.current.strokeColor;if(n.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof i=="object"&&i?.getPattern){const a=i.isModifyingCurrentTransform()?n.getTransform():null;if(n.save(),n.strokeStyle=i.getPattern(n,this,ys(n),gi.STROKE),a){const s=new Path2D;s.addPath(e,n.getTransform().invertSelf().multiplySelf(a)),e=s}this.rescaleAndStroke(e,!1),n.restore()}else this.rescaleAndStroke(e,!0);t&&this.consumePath(e,this.current.getClippedPathBoundingBox(gi.STROKE,Mn(this.ctx))),n.globalAlpha=this.current.fillAlpha}closeStroke(e){this.stroke(e)}fill(e,t=!0){const n=this.ctx,i=this.current.fillColor,a=this.current.patternFill;let s=!1;if(a){const l=i.isModifyingCurrentTransform()?n.getTransform():null;if(n.save(),n.fillStyle=i.getPattern(n,this,ys(n),gi.FILL),l){const c=new Path2D;c.addPath(e,n.getTransform().invertSelf().multiplySelf(l)),e=c}s=!0}const o=this.current.getClippedPathBoundingBox();this.contentVisible&&o!==null&&(this.pendingEOFill?(n.fill(e,"evenodd"),this.pendingEOFill=!1):n.fill(e)),s&&n.restore(),t&&this.consumePath(e,o)}eoFill(e){this.pendingEOFill=!0,this.fill(e)}fillStroke(e){this.fill(e,!1),this.stroke(e,!1),this.consumePath(e)}eoFillStroke(e){this.pendingEOFill=!0,this.fillStroke(e)}closeFillStroke(e){this.fillStroke(e)}closeEOFillStroke(e){this.pendingEOFill=!0,this.fillStroke(e)}endPath(e){this.consumePath(e)}rawFillPath(e){this.ctx.fill(e)}clip(){this.pendingClip=$P}eoClip(){this.pendingClip=yy}beginText(){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(e===void 0)return;const n=new Path2D,i=t.getTransform().invertSelf();for(const{transform:a,x:s,y:o,fontSize:l,path:c}of e)c&&n.addPath(c,new DOMMatrix(a).preMultiplySelf(i).translate(s,o).scale(l,-l));t.clip(n),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){const n=this.commonObjs.get(e),i=this.current;if(!n)throw new Error(`Can't find font for ${e}`);if(i.fontMatrix=n.fontMatrix||d2,(i.fontMatrix[0]===0||i.fontMatrix[3]===0)&&Sr("Invalid font matrix for font "+e),t<0?(t=-t,i.fontDirection=-1):i.fontDirection=1,this.current.font=n,this.current.fontSize=t,n.isType3Font)return;const a=n.loadedName||"sans-serif",s=n.systemFontInfo?.css||`"${a}", ${n.fallbackName}`;let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let c=t;t<dy?c=dy:t>fy&&(c=fy),this.current.fontSizeScale=t/c,this.ctx.font=`${l} ${o} ${c}px ${s}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e){const{current:t}=this;t.textMatrix=e,t.textMatrixScale=Math.hypot(e[0],e[1]),t.x=t.lineX=0,t.y=t.lineY=0}nextLine(){this.moveText(0,this.current.leading)}#r(e,t,n){const i=new Path2D;return i.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),i}paintChar(e,t,n,i,a){const s=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,u=o.fontSize/o.fontSizeScale,h=c&_i.FILL_STROKE_MASK,d=!!(c&_i.ADD_TO_PATH_FLAG),f=o.patternFill&&!l.missingFile,p=o.patternStroke&&!l.missingFile;let m;if((l.disableFontFace||d||f||p)&&!l.missingFile&&(m=l.getPathGenerator(this.commonObjs,e)),m&&(l.disableFontFace||f||p)){s.save(),s.translate(t,n),s.scale(u,-u);let y;if((h===_i.FILL||h===_i.FILL_STROKE)&&(i?(y=s.getTransform(),s.setTransform(...i),s.fill(this.#r(m,y,i))):s.fill(m)),h===_i.STROKE||h===_i.FILL_STROKE)if(a){y||=s.getTransform(),s.setTransform(...a);const{a:v,b:x,c:S,d:A}=y,C=nr.inverseTransform(a),k=nr.transform([v,x,S,A,0,0],C);nr.singularValueDecompose2dScale(k,ma),s.lineWidth*=Math.max(ma[0],ma[1])/u,s.stroke(this.#r(m,y,a))}else s.lineWidth/=u,s.stroke(m);s.restore()}else(h===_i.FILL||h===_i.FILL_STROKE)&&s.fillText(e,t,n),(h===_i.STROKE||h===_i.FILL_STROKE)&&s.strokeText(e,t,n);d&&(this.pendingTextPaths||=[]).push({transform:Mn(s),x:t,y:n,fontSize:u,path:m})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let n=!1;for(let i=3;i<t.length;i+=4)if(t[i]>0&&t[i]<255){n=!0;break}return jr(this,"isFontSubpixelAAEnabled",n)}showText(e){const t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);const i=t.fontSize;if(i===0)return;const a=this.ctx,s=t.fontSizeScale,o=t.charSpacing,l=t.wordSpacing,c=t.fontDirection,u=t.textHScale*c,h=e.length,d=n.vertical,f=d?1:-1,p=n.defaultVMetrics,m=i*t.fontMatrix[0],y=t.textRenderingMode===_i.FILL&&!n.disableFontFace&&!t.patternFill;a.save(),t.textMatrix&&a.transform(...t.textMatrix),a.translate(t.x,t.y+t.textRise),c>0?a.scale(u,-1):a.scale(u,1);let v,x;if(t.patternFill){a.save();const I=t.fillColor.getPattern(a,this,ys(a),gi.FILL);v=Mn(a),a.restore(),a.fillStyle=I}if(t.patternStroke){a.save();const I=t.strokeColor.getPattern(a,this,ys(a),gi.STROKE);x=Mn(a),a.restore(),a.strokeStyle=I}let S=t.lineWidth;const A=t.textMatrixScale;if(A===0||S===0){const I=t.textRenderingMode&_i.FILL_STROKE_MASK;(I===_i.STROKE||I===_i.FILL_STROKE)&&(S=this.getSinglePixelWidth())}else S/=A;if(s!==1&&(a.scale(s,s),S/=s),a.lineWidth=S,n.isInvalidPDFjsFont){const I=[];let R=0;for(const U of e)I.push(U.unicode),R+=U.width;a.fillText(I.join(""),0,0),t.x+=R*m*u,a.restore(),this.compose();return}let C=0,k;for(k=0;k<h;++k){const I=e[k];if(typeof I=="number"){C+=f*I*i/1e3;continue}let R=!1;const U=(I.isSpace?l:0)+o,D=I.fontChar,$=I.accent;let H,V,z=I.width;if(d){const q=I.vmetric||p,re=-(I.vmetric?q[1]:z*.5)*m,X=q[2]*m;z=q?-q[0]:z,H=re/s,V=(C+X)/s}else H=C/s,V=0;if(n.remeasure&&z>0){const q=a.measureText(D).width*1e3/i*s;if(z<q&&this.isFontSubpixelAAEnabled){const re=z/q;R=!0,a.save(),a.scale(re,1),H/=re}else z!==q&&(H+=(z-q)/2e3*i/s)}if(this.contentVisible&&(I.isInFont||n.missingFile)){if(y&&!$)a.fillText(D,H,V);else if(this.paintChar(D,H,V,v,x),$){const q=H+i*$.offset.x/s,re=V-i*$.offset.y/s;this.paintChar($.fontChar,q,re,v,x)}}const Z=d?z*m-U*c:z*m+U*c;C+=Z,R&&a.restore()}d?t.y-=C:t.x+=C*u,a.restore(),this.compose()}showType3Text(e){const t=this.ctx,n=this.current,i=n.font,a=n.fontSize,s=n.fontDirection,o=i.vertical?1:-1,l=n.charSpacing,c=n.wordSpacing,u=n.textHScale*s,h=n.fontMatrix||d2,d=e.length,f=n.textRenderingMode===_i.INVISIBLE;let p,m,y,v;if(!(f||a===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,t.save(),n.textMatrix&&t.transform(...n.textMatrix),t.translate(n.x,n.y+n.textRise),t.scale(u,s),p=0;p<d;++p){if(m=e[p],typeof m=="number"){v=o*m*a/1e3,this.ctx.translate(v,0),n.x+=v*u;continue}const x=(m.isSpace?c:0)+l,S=i.charProcOperatorList[m.operatorListId];S?this.contentVisible&&(this.save(),t.scale(a,a),t.transform(...h),this.executeOperatorList(S),this.restore()):Sr(`Type3 character "${m.operatorListId}" is not available.`);const A=[m.width,0];nr.applyTransform(A,h),y=A[0]*a+x,t.translate(y,0),n.x+=y*u}t.restore()}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,n,i,a,s){const o=new Path2D;o.rect(n,i,a-n,s-i),this.ctx.clip(o),this.endPath()}getColorN_Pattern(e){let t;if(e[0]==="TilingPattern"){const n=this.baseTransform||Mn(this.ctx),i={createCanvasGraphics:a=>new iu(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new N2(e,this.ctx,i,n)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e){this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e){this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t=null){let n;return this.cachedPatterns.has(e)?n=this.cachedPatterns.get(e):(n=jP(this.getObject(e)),this.cachedPatterns.set(e,n)),t&&(n.matrix=t),n}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,ys(t),gi.SHADING);const i=ys(t);if(i){const{width:a,height:s}=t.canvas,o=nu.slice();nr.axialAlignedBoundingBox([0,0,a,s],i,o);const[l,c,u,h]=o;this.ctx.fillRect(l,c,u-l,h-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){pn("Should not call beginInlineImage")}beginImageData(){pn("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=Mn(this.ctx),t)){nr.axialAlignedBoundingBox(t,this.baseTransform,this.current.minMax);const[n,i,a,s]=t,o=new Path2D;o.rect(n,i,a-n,s-i),this.ctx.clip(o),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||sf("TODO: Support non-isolated groups."),e.knockout&&Sr("Knockout groups not supported.");const n=Mn(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let i=nu.slice();nr.axialAlignedBoundingBox(e.bbox,Mn(t),i);const a=[0,0,t.canvas.width,t.canvas.height];i=nr.intersect(i,a)||[0,0,0,0];const s=Math.floor(i[0]),o=Math.floor(i[1]),l=Math.max(Math.ceil(i[2])-s,1),c=Math.max(Math.ceil(i[3])-o,1);this.current.startNewPathAndClipBox([0,0,l,c]);let u="groupAt"+this.groupLevel;e.smask&&(u+="_smask_"+this.smaskCounter++%2);const h=this.cachedCanvases.getCanvas(u,l,c),d=h.context;d.translate(-s,-o),d.transform(...n);let f=new Path2D;const[p,m,y,v]=e.bbox;if(f.rect(p,m,y-p,v-m),e.matrix){const x=new Path2D;x.addPath(f,new DOMMatrix(e.matrix)),f=x}d.clip(f),e.smask?this.smaskStack.push({canvas:h.canvas,context:d,offsetX:s,offsetY:o,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(s,o),t.save()),Dh(t,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const i=Mn(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...i);const a=nu.slice();nr.axialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],i,a),this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(a)}}beginAnnotation(e,t,n,i,a){if(this.#e(),pf(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),t){const s=t[2]-t[0],o=t[3]-t[1];if(a&&this.annotationCanvasMap){n=n.slice(),n[4]-=t[0],n[5]-=t[1],t=t.slice(),t[0]=t[1]=0,t[2]=s,t[3]=o,nr.singularValueDecompose2dScale(Mn(this.ctx),ma);const{viewportScale:l}=this,c=Math.ceil(s*this.outputScaleX*l),u=Math.ceil(o*this.outputScaleY*l);this.annotationCanvas=this.canvasFactory.create(c,u);const{canvas:h,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(e,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(ma[0],0,0,-ma[1],0,o*ma[1]),pf(this.ctx)}else{pf(this.ctx),this.endPath();const l=new Path2D;l.rect(t[0],t[1],s,o),this.ctx.clip(l)}}this.current=new py(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;e=this.getObject(e.data,e),e.count=t;const n=this.ctx,i=this._createMaskCanvas(e),a=i.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(a,i.offsetX,i.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n=0,i=0,a,s){if(!this.contentVisible)return;e=this.getObject(e.data,e);const o=this.ctx;o.save();const l=Mn(o);o.transform(t,n,i,a,0,0);const c=this._createMaskCanvas(e);o.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]);for(let u=0,h=s.length;u<h;u+=2){const d=nr.transform(l,[t,n,i,a,s[u],s[u+1]]);o.drawImage(c.canvas,d[4],d[5])}o.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const t=this.ctx,n=this.current.fillColor,i=this.current.patternFill;for(const a of e){const{data:s,width:o,height:l,transform:c}=a,u=this.cachedCanvases.getCanvas("maskCanvas",o,l),h=u.context;h.save();const d=this.getObject(s,a);by(h,d),h.globalCompositeOperation="source-in",h.fillStyle=i?n.getPattern(h,this,ys(t),gi.FILL):n,h.fillRect(0,0,o,l),h.restore(),t.save(),t.transform(...c),t.scale(1,-1),gf(t,u.canvas,0,0,o,l,0,-1,1,1),t.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const t=this.getObject(e);if(!t){Sr("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t)}paintImageXObjectRepeat(e,t,n,i){if(!this.contentVisible)return;const a=this.getObject(e);if(!a){Sr("Dependent image isn't ready yet");return}const s=a.width,o=a.height,l=[];for(let c=0,u=i.length;c<u;c+=2)l.push({transform:[t,0,0,n,i[c],i[c+1]],x:0,y:0,w:s,h:o});this.paintInlineImageXObjectGroup(a,l)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:t,width:n,height:i}=e,a=this.cachedCanvases.getCanvas("inlineImage",n,i),s=a.context;return s.filter=this.current.transferMaps,s.drawImage(t,0,0),s.filter="none",a.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const t=e.width,n=e.height,i=this.ctx;this.save();const{filter:a}=i;a!=="none"&&a!==""&&(i.filter="none"),i.scale(1/t,-1/n);let s;if(e.bitmap)s=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)s=e;else{const c=this.cachedCanvases.getCanvas("inlineImage",t,n).context;my(c,e),s=this.applyTransferMapsToCanvas(c)}const o=this._scaleImage(s,ys(i));i.imageSmoothingEnabled=vy(Mn(i),e.interpolate),gf(i,o.img,0,0,o.paintWidth,o.paintHeight,0,-n,t,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,t){if(!this.contentVisible)return;const n=this.ctx;let i;if(e.bitmap)i=e.bitmap;else{const a=e.width,s=e.height,l=this.cachedCanvases.getCanvas("inlineImage",a,s).context;my(l,e),i=this.applyTransferMapsToCanvas(l)}for(const a of t)n.save(),n.transform(...a.transform),n.scale(1,-1),gf(n,i,a.x,a.y,a.w,a.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e,t){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(n||(this.pendingClip===yy?i.clip(e,"evenodd"):i.clip(e)),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=Mn(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,i)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:t,b:n,c:i,d:a}=this.ctx.getTransform();let s,o;if(n===0&&i===0){const l=Math.abs(t),c=Math.abs(a);if(l===c)if(e===0)s=o=1/l;else{const u=l*e;s=o=u<1?1/u:1}else if(e===0)s=1/l,o=1/c;else{const u=l*e,h=c*e;s=u<1?1/u:1,o=h<1?1/h:1}}else{const l=Math.abs(t*a-n*i),c=Math.hypot(t,n),u=Math.hypot(i,a);if(e===0)s=u/l,o=c/l;else{const h=e*l;s=u>h?u/h:1,o=c>h?c/h:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e,t){const{ctx:n,current:{lineWidth:i}}=this,[a,s]=this.getScaleForStroking();if(a===s){n.lineWidth=(i||1)*a,n.stroke(e);return}const o=n.getLineDash();t&&n.save(),n.scale(a,s),R2.a=1/a,R2.d=1/s;const l=new Path2D;if(l.addPath(e,R2),o.length>0){const c=Math.max(a,s);n.setLineDash(o.map(u=>u/c)),n.lineDashOffset/=c}n.lineWidth=i||1,n.stroke(l),t&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const r in rf)iu.prototype[r]!==void 0&&(iu.prototype[rf[r]]=iu.prototype[r]);class au{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");this.#t=e}}class KP{#e;#t;constructor({parsedData:e,rawData:t}){this.#e=e,this.#t=t}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}[Symbol.iterator](){return this.#e.entries()}}const su=Symbol("INTERNAL");class YP{#e=!1;#t=!1;#r=!1;#n=!0;constructor(e,{name:t,intent:n,usage:i,rbGroups:a}){this.#e=!!(e&pa.DISPLAY),this.#t=!!(e&pa.PRINT),this.name=t,this.intent=n,this.usage=i,this.rbGroups=a}get visible(){if(this.#r)return this.#n;if(!this.#n)return!1;const{print:e,view:t}=this.usage;return this.#e?t?.viewState!=="OFF":this.#t?e?.printState!=="OFF":!0}_setVisible(e,t,n=!1){e!==su&&pn("Internal method `_setVisible` called."),this.#r=n,this.#n=t}}class JP{#e=null;#t=new Map;#r=null;#n=null;constructor(e,t=pa.DISPLAY){if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#n=e.order;for(const n of e.groups)this.#t.set(n.id,new YP(t,n));if(e.baseState==="OFF")for(const n of this.#t.values())n._setVisible(su,!1);for(const n of e.on)this.#t.get(n)._setVisible(su,!0);for(const n of e.off)this.#t.get(n)._setVisible(su,!1);this.#r=this.getHash()}}#a(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let i=1;i<t;i++){const a=e[i];let s;if(Array.isArray(a))s=this.#a(a);else if(this.#t.has(a))s=this.#t.get(a).visible;else return Sr(`Optional content group not found: ${a}`),!0;switch(n){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return n==="And"}isVisible(e){if(this.#t.size===0)return!0;if(!e)return sf("Optional content group not defined."),!0;if(e.type==="OCG")return this.#t.has(e.id)?this.#t.get(e.id).visible:(Sr(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return this.#a(e.expression);if(!e.policy||e.policy==="AnyOn"){for(const t of e.ids){if(!this.#t.has(t))return Sr(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const t of e.ids){if(!this.#t.has(t))return Sr(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const t of e.ids){if(!this.#t.has(t))return Sr(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const t of e.ids){if(!this.#t.has(t))return Sr(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!1}return!0}return Sr(`Unknown optional content policy ${e.policy}.`),!0}return Sr(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){const i=this.#t.get(e);if(!i){Sr(`Optional content group not found: ${e}`);return}if(n&&t&&i.rbGroups.length)for(const a of i.rbGroups)for(const s of a)s!==e&&this.#t.get(s)?._setVisible(su,!1,!0);i._setVisible(su,!!t,!0),this.#e=null}setOCGState({state:e,preserveRB:t}){let n;for(const i of e){switch(i){case"ON":case"OFF":case"Toggle":n=i;continue}const a=this.#t.get(i);if(a)switch(n){case"ON":this.setVisibility(i,!0,t);break;case"OFF":this.setVisibility(i,!1,t);break;case"Toggle":this.setVisibility(i,!a.visible,t);break}}this.#e=null}get hasInitialVisibility(){return this.#r===null||this.getHash()===this.#r}getOrder(){return this.#t.size?this.#n?this.#n.slice():[...this.#t.keys()]:null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;const e=new ey;for(const[t,n]of this.#t)e.update(`${t}:${n.visible}`);return this.#e=e.hexdigest()}[Symbol.iterator](){return this.#t.entries()}}class QP{constructor(e,{disableRange:t=!1,disableStream:n=!1}){Vn(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:i,initialData:a,progressiveDone:s,contentDispositionFilename:o}=e;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=o,a?.length>0){const l=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!n,this._isRangeSupported=!t,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){const n=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const i=this._rangeReaders.some(function(a){return a._begin!==e?!1:(a._enqueue(n),!0)});Vn(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){Vn(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new ZP(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new eF(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}}class ZP{constructor(e,t,n=!1,i=null){this._stream=e,this._done=n||!1,this._filename=w2(i)?i:null,this._queuedChunks=t||[],this._loaded=0;for(const a of this._queuedChunks)this._loaded+=a.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class eF{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function tF(r){let e=!0,t=n("filename\\*","i").exec(r);if(t){t=t[1];let u=o(t);return u=unescape(u),u=l(u),u=c(u),a(u)}if(t=s(r),t){const u=c(t);return a(u)}if(t=n("filename","i").exec(r),t){t=t[1];let u=o(t);return u=c(u),a(u)}function n(u,h){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',h)}function i(u,h){if(u){if(!/^[\x00-\xFF]+$/.test(h))return h;try{const d=new TextDecoder(u,{fatal:!0}),f=Ih(h);h=d.decode(f),e=!1}catch{}}return h}function a(u){return e&&/[\x80-\xff]/.test(u)&&(u=i("utf-8",u),e&&(u=i("iso-8859-1",u))),u}function s(u){const h=[];let d;const f=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(d=f.exec(u))!==null;){let[,m,y,v]=d;if(m=parseInt(m,10),m in h){if(m===0)break;continue}h[m]=[y,v]}const p=[];for(let m=0;m<h.length&&m in h;++m){let[y,v]=h[m];v=o(v),y&&(v=unescape(v),m===0&&(v=l(v))),p.push(v)}return p.join("")}function o(u){if(u.startsWith('"')){const h=u.slice(1).split('\\"');for(let d=0;d<h.length;++d){const f=h[d].indexOf('"');f!==-1&&(h[d]=h[d].slice(0,f),h.length=d+1),h[d]=h[d].replaceAll(/\\(.)/g,"$1")}u=h.join('"')}return u}function l(u){const h=u.indexOf("'");if(h===-1)return u;const d=u.slice(0,h),p=u.slice(h+1).replace(/^[^']*'/,"");return i(d,p)}function c(u){return!u.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(u)?u:u.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(h,d,f,p){if(f==="q"||f==="Q")return p=p.replaceAll("_"," "),p=p.replaceAll(/=([0-9a-fA-F]{2})/g,function(m,y){return String.fromCharCode(parseInt(y,16))}),i(d,p);try{p=atob(p)}catch{}return i(d,p)})}return""}function wy(r,e){const t=new Headers;if(!r||!e||typeof e!="object")return t;for(const n in e){const i=e[n];i!==void 0&&t.append(n,i)}return t}function mf(r){return URL.parse(r)?.origin??null}function xy({responseHeaders:r,isHttp:e,rangeChunkSize:t,disableRange:n}){const i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(r.get("Content-Length"),10);return!Number.isInteger(a)||(i.suggestedLength=a,a<=2*t)||n||!e||r.get("Accept-Ranges")!=="bytes"||(r.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function Sy(r){const e=r.get("Content-Disposition");if(e){let t=tF(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(w2(t))return t}return null}function Lh(r,e){return new of(`Unexpected server response (${r}) while retrieving PDF "${e}".`,r,r===404||r===0&&e.startsWith("file:"))}function ky(r){return r===200||r===206}function Ay(r,e,t){return{method:"GET",headers:r,signal:t.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function _y(r){return r instanceof Uint8Array?r.buffer:r instanceof ArrayBuffer?r:(Sr(`getArrayBuffer - unexpected data format: ${r}`),new Uint8Array(r).buffer)}class rF{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=wy(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Vn(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new nF(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new iF(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class nF{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;const n=new Headers(e.headers),i=t.url;fetch(i,Ay(n,this._withCredentials,this._abortController)).then(a=>{if(e._responseOrigin=mf(a.url),!ky(a.status))throw Lh(a.status,i);this._reader=a.body.getReader(),this._headersCapability.resolve();const s=a.headers,{allowRangeRequests:o,suggestedLength:l}=xy({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=Sy(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Ko("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:_y(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class iF{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const i=e.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;const a=new Headers(e.headers);a.append("Range",`bytes=${t}-${n-1}`);const s=i.url;fetch(s,Ay(a,this._withCredentials,this._abortController)).then(o=>{const l=mf(o.url);if(l!==e._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${e._responseOrigin}".`);if(!ky(o.status))throw Lh(o.status,s);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:_y(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}const P2=200,F2=206;function aF(r){const e=r.response;return typeof e!="string"?e:Ih(e).buffer}class sF{_responseOrigin=null;constructor({url:e,httpHeaders:t,withCredentials:n}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=wy(this.isHttp,t),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const t=new XMLHttpRequest,n=this.currXhrId++,i=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const[a,s]of this.headers)t.setRequestHeader(a,s);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),i.expectedStatus=F2):i.expectedStatus=P2,t.responseType="arraybuffer",Vn(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>{e.onError(t.status)},t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){const n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const i=n.xhr;if(i.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),i.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],i.status===0&&this.isHttp){n.onError(i.status);return}const a=i.status||P2;if(!(a===P2&&n.expectedStatus===F2)&&a!==n.expectedStatus){n.onError(i.status);return}const o=aF(i);if(a===F2){const l=i.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);c?n.onDone({begin:parseInt(c[1],10),chunk:o}):(Sr('Missing or invalid "Content-Range" header.'),n.onError(0))}else o?n.onDone({begin:0,chunk:o}):n.onError(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}class oF{constructor(e){this._source=e,this._manager=new sF(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return Vn(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new lF(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const n=new cF(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class lF{constructor(e,t){this._manager=e,this._url=t.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e);this._manager._responseOrigin=mf(t.responseURL);const n=t.getAllResponseHeaders(),i=new Headers(n?n.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(o=>{const[l,...c]=o.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:a,suggestedLength:s}=xy({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=Sy(i),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=Lh(e,this._url),this._headersCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class cF{constructor(e,t,n){this._manager=e,this._url=e.url,this._requestId=e.request({begin:t,end:n,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const e=mf(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=Lh(e,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const uF=/^[a-z][a-z0-9\-+.]+:/i;function hF(r){if(uF.test(r))return new URL(r);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(r))}class dF{constructor(e){this.source=e,this.url=hF(e.url),Vn(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Vn(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new fF(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new gF(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class fF{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const n=process.getBuiltinModule("fs");n.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},i=>{i.code==="ENOENT"&&(i=Lh(0,this._url.href)),this._storedError=i,this._headersCapability.reject(i)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Ko("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class gF{constructor(e,t,n){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const i=e.source;this._isStreamingSupported=!i.disableStream;const a=process.getBuiltinModule("fs");this._setReadableStream(a.createReadStream(this._url,{start:t,end:n-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const Bh=Symbol("INITIAL_DATA");class Cy{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:Bh}}get(e,t=null){if(t){const i=this.#t(e);return i.promise.then(()=>t(i.data)),null}const n=this.#e[e];if(!n||n.data===Bh)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){const t=this.#e[e];return!!t&&t.data!==Bh}delete(e){const t=this.#e[e];return!t||t.data===Bh?!1:(delete this.#e[e],!0)}resolve(e,t=null){const n=this.#t(e);n.data=t,n.resolve()}clear(){for(const e in this.#e){const{data:t}=this.#e[e];t?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const e in this.#e){const{data:t}=this.#e[e];t!==Bh&&(yield[e,t])}}}const pF=1e5,Ey=30;class Bi{#e=Promise.withResolvers();#t=null;#r=!1;#n=!!globalThis.FontInspector?.enabled;#a=null;#i=null;#s=0;#o=0;#l=null;#c=null;#h=0;#u=0;#g=Object.create(null);#p=[];#f=null;#d=[];#m=new WeakMap;#y=null;static#b=new Map;static#w=new Map;static#x=new WeakMap;static#v=null;static#k=new Set;constructor({textContentSource:e,container:t,viewport:n}){if(e instanceof ReadableStream)this.#f=e;else if(typeof e=="object")this.#f=new ReadableStream({start(l){l.enqueue(e),l.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#c=t,this.#u=n.scale*ws.pixelRatio,this.#h=n.rotation,this.#i={div:null,properties:null,ctx:null};const{pageWidth:i,pageHeight:a,pageX:s,pageY:o}=n.rawDims;this.#y=[1,0,0,-1,-s,o+a],this.#o=i,this.#s=a,Bi.#E(),ql(t,n),this.#e.promise.finally(()=>{Bi.#k.delete(this),this.#i=null,this.#g=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:t}=fi.platform;return jr(this,"fontFamilyMap",new Map([["sans-serif",`${e&&t?"Calibri, ":""}sans-serif`],["monospace",`${e&&t?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{this.#l.read().then(({value:t,done:n})=>{if(n){this.#e.resolve();return}this.#a??=t.lang,Object.assign(this.#g,t.styles),this.#C(t.items),e()},this.#e.reject)};return this.#l=this.#f.getReader(),Bi.#k.add(this),e(),this.#e.promise}update({viewport:e,onBefore:t=null}){const n=e.scale*ws.pixelRatio,i=e.rotation;if(i!==this.#h&&(t?.(),this.#h=i,ql(this.#c,{rotation:i})),n!==this.#u){t?.(),this.#u=n;const a={div:null,properties:null,ctx:Bi.#I(this.#a)};for(const s of this.#d)a.properties=this.#m.get(s),a.div=s,this.#M(a)}}cancel(){const e=new Ko("TextLayer task cancelled.");this.#l?.cancel(e).catch(()=>{}),this.#l=null,this.#e.reject(e)}get textDivs(){return this.#d}get textContentItemsStr(){return this.#p}#C(e){if(this.#r)return;this.#i.ctx??=Bi.#I(this.#a);const t=this.#d,n=this.#p;for(const i of e){if(t.length>pF){Sr("Ignoring additional textDivs for performance reasons."),this.#r=!0;return}if(i.str===void 0){if(i.type==="beginMarkedContentProps"||i.type==="beginMarkedContent"){const a=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),i.id&&this.#t.setAttribute("id",`${i.id}`),a.append(this.#t)}else i.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}n.push(i.str),this.#A(i)}}#A(e){const t=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};this.#d.push(t);const i=nr.transform(this.#y,e.transform);let a=Math.atan2(i[1],i[0]);const s=this.#g[e.fontName];s.vertical&&(a+=Math.PI/2);let o=this.#n&&s.fontSubstitution||s.fontFamily;o=Bi.fontFamilyMap.get(o)||o;const l=Math.hypot(i[2],i[3]),c=l*Bi.#N(o,s,this.#a);let u,h;a===0?(u=i[4],h=i[5]-c):(u=i[4]+c*Math.sin(a),h=i[5]-c*Math.cos(a));const d="calc(var(--total-scale-factor) *",f=t.style;this.#t===this.#c?(f.left=`${(100*u/this.#o).toFixed(2)}%`,f.top=`${(100*h/this.#s).toFixed(2)}%`):(f.left=`${d}${u.toFixed(2)}px)`,f.top=`${d}${h.toFixed(2)}px)`),f.fontSize=`${d}${(Bi.#v*l).toFixed(2)}px)`,f.fontFamily=o,n.fontSize=l,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,this.#n&&(t.dataset.fontName=s.fontSubstitutionLoadedName||e.fontName),a!==0&&(n.angle=a*(180/Math.PI));let p=!1;if(e.str.length>1)p=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const m=Math.abs(e.transform[0]),y=Math.abs(e.transform[3]);m!==y&&Math.max(m,y)/Math.min(m,y)>1.5&&(p=!0)}if(p&&(n.canvasWidth=s.vertical?e.height:e.width),this.#m.set(t,n),this.#i.div=t,this.#i.properties=n,this.#M(this.#i),n.hasText&&this.#t.append(t),n.hasEOL){const m=document.createElement("br");m.setAttribute("role","presentation"),this.#t.append(m)}}#M(e){const{div:t,properties:n,ctx:i}=e,{style:a}=t;let s="";if(Bi.#v>1&&(s=`scale(${1/Bi.#v})`),n.canvasWidth!==0&&n.hasText){const{fontFamily:o}=a,{canvasWidth:l,fontSize:c}=n;Bi.#T(i,c*this.#u,o);const{width:u}=i.measureText(t.textContent);u>0&&(s=`scaleX(${l*this.#u/u}) ${s}`)}n.angle!==0&&(s=`rotate(${n.angle}deg) ${s}`),s.length>0&&(a.transform=s)}static cleanup(){if(!(this.#k.size>0)){this.#b.clear();for(const{canvas:e}of this.#w.values())e.remove();this.#w.clear()}}static#I(e=null){let t=this.#w.get(e||="");if(!t){const n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=e,document.body.append(n),t=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#w.set(e,t),this.#x.set(t,{size:0,family:""})}return t}static#T(e,t,n){const i=this.#x.get(e);t===i.size&&n===i.family||(e.font=`${t}px ${n}`,i.size=t,i.family=n)}static#E(){if(this.#v!==null)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#v=e.getBoundingClientRect().height,e.remove()}static#N(e,t,n){const i=this.#b.get(e);if(i)return i;const a=this.#I(n);a.canvas.width=a.canvas.height=Ey,this.#T(a,Ey,e);const s=a.measureText(""),o=s.fontBoundingBoxAscent,l=Math.abs(s.fontBoundingBoxDescent);a.canvas.width=a.canvas.height=0;let c=.8;return o?c=o/(o+l):(fi.platform.isFirefox&&Sr("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?c=t.ascent:t.descent&&(c=1+t.descent)),this.#b.set(e,c),c}}class Uh{static textContent(e){const t=[],n={items:t,styles:Object.create(null)};function i(a){if(!a)return;let s=null;const o=a.name;if(o==="#text")s=a.value;else if(Uh.shouldBuildText(o))a?.attributes?.textContent?s=a.attributes.textContent:a.value&&(s=a.value);else return;if(s!==null&&t.push({str:s}),!!a.children)for(const l of a.children)i(l)}return i(e),n}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}const mF=100;function D2(r={}){typeof r=="string"||r instanceof URL?r={url:r}:(r instanceof ArrayBuffer||ArrayBuffer.isView(r))&&(r={data:r});const e=new L2,{docId:t}=e,n=r.url?_P(r.url):null,i=r.data?CP(r.data):null,a=r.httpHeaders||null,s=r.withCredentials===!0,o=r.password??null,l=r.range instanceof Ty?r.range:null,c=Number.isInteger(r.rangeChunkSize)&&r.rangeChunkSize>0?r.rangeChunkSize:2**16;let u=r.worker instanceof zh?r.worker:null;const h=r.verbosity,d=typeof r.docBaseUrl=="string"&&!lf(r.docBaseUrl)?r.docBaseUrl:null,f=df(r.cMapUrl),p=r.cMapPacked!==!1,m=r.CMapReaderFactory||(Di?PP:ay),y=df(r.iccUrl),v=df(r.standardFontDataUrl),x=r.StandardFontDataFactory||(Di?FP:ly),S=df(r.wasmUrl),A=r.WasmFactory||(Di?DP:uy),C=r.stopAtErrors!==!0,k=Number.isInteger(r.maxImageSize)&&r.maxImageSize>-1?r.maxImageSize:-1,I=r.isEvalSupported!==!1,R=typeof r.isOffscreenCanvasSupported=="boolean"?r.isOffscreenCanvasSupported:!Di,U=typeof r.isImageDecoderSupported=="boolean"?r.isImageDecoderSupported:!Di&&(fi.platform.isFirefox||!globalThis.chrome),D=Number.isInteger(r.canvasMaxAreaInBytes)?r.canvasMaxAreaInBytes:-1,$=typeof r.disableFontFace=="boolean"?r.disableFontFace:Di,H=r.fontExtraProperties===!0,V=r.enableXfa===!0,z=r.ownerDocument||globalThis.document,Z=r.disableRange===!0,q=r.disableStream===!0,re=r.disableAutoFetch===!0,X=r.pdfBug===!0,ie=r.CanvasFactory||(Di?RP:MP),P=r.FilterFactory||(Di?NP:OP),be=r.enableHWA===!0,_e=r.useWasm!==!1,W=l?l.length:r.length??NaN,me=typeof r.useSystemFonts=="boolean"?r.useSystemFonts:!Di&&!$,He=typeof r.useWorkerFetch=="boolean"?r.useWorkerFetch:!!(m===ay&&x===ly&&A===uy&&f&&v&&S&&Nh(f,document.baseURI)&&Nh(v,document.baseURI)&&Nh(S,document.baseURI)),Xe=null;nP(h);const Le={canvasFactory:new ie({ownerDocument:z,enableHWA:be}),filterFactory:new P({docId:t,ownerDocument:z}),cMapReaderFactory:He?null:new m({baseUrl:f,isCompressed:p}),standardFontDataFactory:He?null:new x({baseUrl:v}),wasmFactory:He?null:new A({baseUrl:S})};u||(u=zh.create({verbosity:h,port:au.workerPort}),e._worker=u);const bt={docId:t,apiVersion:"5.4.54",data:i,password:o,disableAutoFetch:re,rangeChunkSize:c,length:W,docBaseUrl:d,enableXfa:V,evaluatorOptions:{maxImageSize:k,disableFontFace:$,ignoreErrors:C,isEvalSupported:I,isOffscreenCanvasSupported:R,isImageDecoderSupported:U,canvasMaxAreaInBytes:D,fontExtraProperties:H,useSystemFonts:me,useWasm:_e,useWorkerFetch:He,cMapUrl:f,iccUrl:y,standardFontDataUrl:v,wasmUrl:S}},Ie={ownerDocument:z,pdfBug:X,styleElement:Xe,loadingParams:{disableAutoFetch:re,enableXfa:V}};return u.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const Ve=u.messageHandler.sendWithPromise("GetDocRequest",bt,i?[i.buffer]:null);let We;if(l)We=new QP(l,{disableRange:Z,disableStream:q});else if(!i){if(!n)throw new Error("getDocument - no `url` parameter provided.");const Qe=Nh(n)?rF:Di?dF:oF;We=new Qe({url:n,length:W,httpHeaders:a,withCredentials:s,rangeChunkSize:c,disableRange:Z,disableStream:q})}return Ve.then(Qe=>{if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const mt=new Fh(t,Qe,u.port),Ke=new yF(mt,e,We,Ie,Le,be);e._transport=Ke,mt.send("Ready",null)})}).catch(e._capability.reject),e}class L2{static#e=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId=`d${L2.#e++}`;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}class Ty{#e=Promise.withResolvers();#t=[];#r=[];#n=[];#a=[];constructor(e,t,n=!1,i=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=i}addRangeListener(e){this.#a.push(e)}addProgressListener(e){this.#n.push(e)}addProgressiveReadListener(e){this.#r.push(e)}addProgressiveDoneListener(e){this.#t.push(e)}onDataRange(e,t){for(const n of this.#a)n(e,t)}onDataProgress(e,t){this.#e.promise.then(()=>{for(const n of this.#n)n(e,t)})}onDataProgressiveRead(e){this.#e.promise.then(()=>{for(const t of this.#r)t(e)})}onDataProgressiveDone(){this.#e.promise.then(()=>{for(const e of this.#t)e()})}transportReady(){this.#e.resolve()}requestDataRange(e,t){pn("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class bF{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return jr(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class vF{#e=!1;constructor(e,t,n,i=!1){this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=i?new J6:null,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new Cy,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:i=0,dontFlip:a=!1}={}){return new Oh({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:i,dontFlip:a})}getAnnotations({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return jr(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:t=e.canvas,viewport:n,intent:i="display",annotationMode:a=$o.ENABLE,transform:s=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:u=null,printAnnotationStorage:h=null,isEditing:d=!1}){this._stats?.time("Overall");const f=this._transport.getRenderingIntent(i,a,h,d),{renderingIntent:p,cacheKey:m}=f;this.#e=!1,l||=this._transport.getOptionalContentConfig(p);let y=this._intentStates.get(m);y||(y=Object.create(null),this._intentStates.set(m,y)),y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const v=!!(p&pa.PRINT);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(f));const x=C=>{y.renderTasks.delete(S),v&&(this.#e=!0),this.#t(),C?(S.capability.reject(C),this._abortOperatorList({intentState:y,reason:C instanceof Error?C:new Error(C)})):S.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},S=new ou({callback:x,params:{canvas:t,canvasContext:e,viewport:n,transform:s,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:u,enableHWA:this._transport.enableHWA});(y.renderTasks||=new Set).add(S);const A=S.task;return Promise.all([y.displayReadyCapability.promise,l]).then(([C,k])=>{if(this.destroyed){x();return}if(this._stats?.time("Rendering"),!(k.renderingIntent&p))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");S.initializeGraphics({transparency:C,optionalContentConfig:k}),S.operatorListChanged()}).catch(x),A}getOperatorList({intent:e="display",annotationMode:t=$o.ENABLE,printAnnotationStorage:n=null,isEditing:i=!1}={}){function a(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const s=this._transport.getRenderingIntent(e,t,n,i,!0);let o=this._intentStates.get(s.cacheKey);o||(o=Object.create(null),this._intentStates.set(s.cacheKey,o));let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=a,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(n=>Uh.textContent(n));const t=this.streamTextContent(e);return new Promise(function(n,i){function a(){s.read().then(function({value:l,done:c}){if(c){n(o);return}o.lang??=l.lang,Object.assign(o.styles,l.styles),o.items.push(...l.items),a()},i)}const s=t.getReader(),o={items:[],styles:Object.create(null),lang:null};a()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#e=!1,Promise.all(e)}cleanup(e=!1){this.#e=!0;const t=this.#t();return e&&t&&(this._stats&&=new J6),t}#t(){if(!this.#e||this.destroyed)return!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}_startRenderPage(e,t){const n=this._intentStates.get(t);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,i=e.length;n<i;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const n of t.renderTasks)n.operatorListChanged();e.lastChunk&&this.#t()}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:i}){const{map:a,transfer:s}=n,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:a,modifiedIds:i},s).getReader(),c=this._intentStates.get(t);c.streamReader=l;const u=()=>{l.read().then(({value:h,done:d})=>{if(d){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,c),u())},h=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const d of c.renderTasks)d.operatorListChanged();this.#t()}if(c.displayReadyCapability)c.displayReadyCapability.reject(h);else if(c.opListReadCapability)c.opListReadCapability.reject(h);else throw h}})};u()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(t instanceof y2){let i=mF;t.extraDelay>0&&t.extraDelay<1e3&&(i+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},i);return}}if(e.streamReader.cancel(new Ko(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[i,a]of this._intentStates)if(a===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}const En=class En{constructor({name:e=null,port:t=null,verbosity:n=iP()}={}){zs(this,Gi);zs(this,dl,Promise.withResolvers());zs(this,ns,null);zs(this,xo,null);zs(this,dc,null);if(this.name=e,this.destroyed=!1,this.verbosity=n,t){if(In(En,gc).has(t))throw new Error("Cannot use more than one PDFWorker per port.");In(En,gc).set(t,this),js(this,Gi,cA).call(this,t)}else js(this,Gi,uA).call(this)}get promise(){return In(this,dl).promise}get port(){return In(this,xo)}get messageHandler(){return In(this,ns)}destroy(){this.destroyed=!0,In(this,dc)?.terminate(),oa(this,dc,null),In(En,gc).delete(In(this,xo)),oa(this,xo,null),In(this,ns)?.destroy(),oa(this,ns,null)}static create(e){const t=In(this,gc).get(e?.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new En(e)}static get workerSrc(){if(au.workerSrc)return au.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return jr(this,"_setupFakeWorkerGlobal",(async()=>In(this,Ou,Z1)?In(this,Ou,Z1):(await import(this.workerSrc)).WorkerMessageHandler)())}};dl=new WeakMap,ns=new WeakMap,xo=new WeakMap,dc=new WeakMap,F1=new WeakMap,fc=new WeakMap,gc=new WeakMap,Gi=new WeakSet,Q1=function(){In(this,dl).resolve(),In(this,ns).send("configure",{verbosity:this.verbosity})},cA=function(e){oa(this,xo,e),oa(this,ns,new Fh("main","worker",e)),In(this,ns).on("ready",()=>{}),js(this,Gi,Q1).call(this)},uA=function(){if(In(En,fc)||In(En,Ou,Z1)){js(this,Gi,Nd).call(this);return}let{workerSrc:e}=En;try{En._isSameOrigin(window.location,e)||(e=En._createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),n=new Fh("main","worker",t),i=()=>{a.abort(),n.destroy(),t.terminate(),this.destroyed?In(this,dl).reject(new Error("Worker was destroyed")):js(this,Gi,Nd).call(this)},a=new AbortController;t.addEventListener("error",()=>{In(this,dc)||i()},{signal:a.signal}),n.on("test",o=>{if(a.abort(),this.destroyed||!o){i();return}oa(this,ns,n),oa(this,xo,t),oa(this,dc,t),js(this,Gi,Q1).call(this)}),n.on("ready",o=>{if(a.abort(),this.destroyed){i();return}try{s()}catch{js(this,Gi,Nd).call(this)}});const s=()=>{const o=new Uint8Array;n.send("test",o,[o.buffer])};s();return}catch{sf("The worker has been disabled.")}js(this,Gi,Nd).call(this)},Nd=function(){In(En,fc)||(Sr("Setting up fake worker."),oa(En,fc,!0)),En._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){In(this,dl).reject(new Error("Worker was destroyed"));return}const t=new IP;oa(this,xo,t);const n=`fake${lA(En,F1)._++}`,i=new Fh(n+"_worker",n,t);e.setup(i,t),oa(this,ns,new Fh(n,n+"_worker",t)),js(this,Gi,Q1).call(this)}).catch(e=>{In(this,dl).reject(new Error(`Setting up fake worker failed: "${e.message}".`))})},Ou=new WeakSet,Z1=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},zs(En,Ou),zs(En,F1,0),zs(En,fc,!1),zs(En,gc,new WeakMap),Di&&(oa(En,fc,!0),au.workerSrc||="./pdf.worker.mjs"),En._isSameOrigin=(e,t)=>{const n=URL.parse(e);if(!n?.origin||n.origin==="null")return!1;const i=new URL(t,n);return n.origin===i.origin},En._createCDNWrapper=e=>{const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},En.fromPort=e=>{if(mP("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return En.create(e)};let zh=En;class yF{#e=new Map;#t=new Map;#r=new Map;#n=new Map;#a=null;constructor(e,t,n,i,a,s){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new Cy,this.fontLoader=new kP({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=a.canvasFactory,this.filterFactory=a.filterFactory,this.cMapReaderFactory=a.cMapReaderFactory,this.standardFontDataFactory=a.standardFontDataFactory,this.wasmFactory=a.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=s,this.setupMessageHandler()}#i(e,t=null){const n=this.#e.get(e);if(n)return n;const i=this.messageHandler.sendWithPromise(e,t);return this.#e.set(e,i),i}get annotationStorage(){return jr(this,"annotationStorage",new C2)}getRenderingIntent(e,t=$o.ENABLE,n=null,i=!1,a=!1){let s=pa.DISPLAY,o=_2;switch(e){case"any":s=pa.ANY;break;case"display":break;case"print":s=pa.PRINT;break;default:Sr(`getRenderingIntent - invalid intent: ${e}`)}const l=s&pa.PRINT&&n instanceof ty?n:this.annotationStorage;switch(t){case $o.DISABLE:s+=pa.ANNOTATIONS_DISABLE;break;case $o.ENABLE:break;case $o.ENABLE_FORMS:s+=pa.ANNOTATIONS_FORMS;break;case $o.ENABLE_STORAGE:s+=pa.ANNOTATIONS_STORAGE,o=l.serializable;break;default:Sr(`getRenderingIntent - invalid annotationMode: ${t}`)}i&&(s+=pa.IS_EDITING),a&&(s+=pa.OPLIST);const{ids:c,hash:u}=l.modifiedIds,h=[s,o.hash,u];return{renderingIntent:s,cacheKey:h.join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#a?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of this.#t.values())e.push(n._destroy());this.#t.clear(),this.#r.clear(),this.#n.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),Bi.cleanup(),this._networkStream?.cancelAllRequests(new Ko("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(n,i)=>{Vn(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=a=>{this._lastProgress={loaded:a.loaded,total:a.total}},i.onPull=()=>{this._fullReader.read().then(function({value:a,done:s}){if(s){i.close();return}Vn(a instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{this._fullReader.cancel(a),i.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",async n=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:a,contentLength:s}=this._fullReader;return(!i||!a)&&(this._lastProgress&&t.onProgress?.(this._lastProgress),this._fullReader.onProgress=o=>{t.onProgress?.({loaded:o.loaded,total:o.total})}),{isStreamingSupported:i,isRangeSupported:a,contentLength:s}}),e.on("GetRangeReader",(n,i)=>{Vn(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const a=this._networkStream.getRangeReader(n.begin,n.end);if(!a){i.close();return}i.onPull=()=>{a.read().then(function({value:s,done:o}){if(o){i.close();return}Vn(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{i.error(s)})},i.onCancel=s=>{a.cancel(s),i.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:n})=>{this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,t._capability.resolve(new bF(n,this))}),e.on("DocException",n=>{t._capability.reject(Ji(n))}),e.on("PasswordRequest",n=>{this.#a=Promise.withResolvers();try{if(!t.onPassword)throw Ji(n);const i=a=>{a instanceof Error?this.#a.reject(a):this.#a.resolve({password:a})};t.onPassword(i,n.code)}catch(i){this.#a.reject(i)}return this.#a.promise}),e.on("DataLoaded",n=>{t.onProgress?.({loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),e.on("StartRenderPage",n=>{if(this.destroyed)return;this.#t.get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),e.on("commonobj",([n,i,a])=>{if(this.destroyed||this.commonObjs.has(n))return null;switch(i){case"Font":if("error"in a){const c=a.error;Sr(`Error during font loading: ${c}`),this.commonObjs.resolve(n,c);break}const s=this._params.pdfBug&&globalThis.FontInspector?.enabled?(c,u)=>globalThis.FontInspector.fontAdded(c,u):null,o=new AP(a,s);this.fontLoader.bind(o).catch(()=>e.sendWithPromise("FontFallback",{id:n})).finally(()=>{!o.fontExtraProperties&&o.data&&(o.data=null),this.commonObjs.resolve(n,o)});break;case"CopyLocalImage":const{imageRef:l}=a;Vn(l,"The imageRef must be defined.");for(const c of this.#t.values())for(const[,u]of c.objs)if(u?.ref===l)return u.dataLen?(this.commonObjs.resolve(n,structuredClone(u)),u.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,a);break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),e.on("obj",([n,i,a,s])=>{if(this.destroyed)return;const o=this.#t.get(i);if(!o.objs.has(n)){if(o._intentStates.size===0){s?.bitmap?.close();return}switch(a){case"Image":case"Pattern":o.objs.resolve(n,s);break;default:throw new Error(`Got unknown object type ${a}`)}}}),e.on("DocProgress",n=>{this.destroyed||t.onProgress?.({loaded:n.loaded,total:n.total})}),e.on("FetchBinaryData",async n=>{if(this.destroyed)throw new Error("Worker was destroyed.");const i=this[n.type];if(!i)throw new Error(`${n.type} not initialized, see the \`useWorkerFetch\` parameter.`);return i.fetch(n)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Sr("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,n=this.#r.get(t);if(n)return n;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");a.refStr&&this.#n.set(a.refStr,e);const s=new vF(t,a,this,this._params.pdfBug);return this.#t.set(t,s),s});return this.#r.set(t,i),i}getPageIndex(e){return E2(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#i("GetFieldObjects")}hasJSActions(){return this.#i("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#i("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#i("GetOptionalContentConfig").then(t=>new JP(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=this.#e.get(e);if(t)return t;const n=this.messageHandler.sendWithPromise(e,null).then(i=>({info:i[0],metadata:i[1]?new KP(i[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#t.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),Bi.cleanup()}}cachedPageNumber(e){if(!E2(e))return null;const t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#n.get(t)??null}}class wF{#e=null;onContinue=null;onError=null;constructor(e){this.#e=e}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#e;return e.form||e.canvas&&t?.size>0}}class ou{#e=null;static#t=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:i,annotationCanvasMap:a,operatorList:s,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:u=!1,pdfBug:h=!1,pageColors:d=null,enableHWA:f=!1}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=i,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=h,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=u===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new wF(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=f}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(ou.#t.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");ou.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:n,transform:i,background:a}=this.params,s=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new iu(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:i,viewport:n,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),ou.#t.delete(this._canvas),e||=new y2(`Rendering cancelled, page ${this._pageIndex+1}`,t),this.callback(e),this.task.onError?.(e)}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),ou.#t.delete(this._canvas),this.callback())))}}const xF="5.4.54",SF="295fb3ec4";class Da{#e=null;#t=null;#r;#n=null;#a=!1;#i=!1;#s=null;#o;#l=null;#c=null;static#h=null;static get _keyboardManager(){return jr(this,"_keyboardManager",new Ph([[["Escape","mac+Escape"],Da.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Da.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Da.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Da.prototype._moveToPrevious],[["Home","mac+Home"],Da.prototype._moveToBeginning],[["End","mac+End"],Da.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:t=null}){e?(this.#i=!1,this.#s=e):this.#i=!0,this.#c=e?._uiManager||t,this.#o=this.#c._eventBus,this.#r=e?.color?.toUpperCase()||this.#c?.highlightColors.values().next().value||"#FFFF98",Da.#h||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const e=this.#e=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",this.#s&&(e.ariaControls=`${this.#s.id}_colorpicker_dropdown`);const t=this.#c._signal;e.addEventListener("click",this.#f.bind(this),{signal:t}),e.addEventListener("keydown",this.#p.bind(this),{signal:t});const n=this.#t=document.createElement("span");return n.className="swatch",n.ariaHidden="true",n.style.backgroundColor=this.#r,e.append(n),e}renderMainDropdown(){const e=this.#n=this.#u();return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}#u(){const e=document.createElement("div"),t=this.#c._signal;e.addEventListener("contextmenu",Pa,{signal:t}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#s&&(e.id=`${this.#s.id}_colorpicker_dropdown`);for(const[n,i]of this.#c.highlightColors){const a=document.createElement("button");a.tabIndex="0",a.role="option",a.setAttribute("data-color",i),a.title=n,a.setAttribute("data-l10n-id",Da.#h[n]);const s=document.createElement("span");a.append(s),s.className="swatch",s.style.backgroundColor=i,a.ariaSelected=i===this.#r,a.addEventListener("click",this.#g.bind(this,i),{signal:t}),e.append(a)}return e.addEventListener("keydown",this.#p.bind(this),{signal:t}),e}#g(e,t){t.stopPropagation(),this.#o.dispatch("switchannotationeditorparams",{source:this,type:Jr.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#f(e);return}const t=e.target.getAttribute("data-color");t&&this.#g(t,e)}_moveToNext(e){if(!this.#m){this.#f(e);return}if(e.target===this.#e){this.#n.firstChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===this.#n?.firstChild||e.target===this.#e){this.#m&&this._hideDropdownFromKeyboard();return}this.#m||this.#f(e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!this.#m){this.#f(e);return}this.#n.firstChild?.focus()}_moveToEnd(e){if(!this.#m){this.#f(e);return}this.#n.lastChild?.focus()}#p(e){Da._keyboardManager.exec(this,e)}#f(e){if(this.#m){this.hideDropdown();return}if(this.#a=e.detail===0,this.#l||(this.#l=new AbortController,window.addEventListener("pointerdown",this.#d.bind(this),{signal:this.#c.combinedSignal(this.#l)})),this.#e.ariaExpanded="true",this.#n){this.#n.classList.remove("hidden");return}const t=this.#n=this.#u();this.#e.append(t)}#d(e){this.#n?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#n?.classList.add("hidden"),this.#e.ariaExpanded="false",this.#l?.abort(),this.#l=null}get#m(){return this.#n&&!this.#n.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#i){if(!this.#m){this.#s?.unselect();return}this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#a})}}updateColor(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#n)return;const t=this.#c.highlightColors.values();for(const n of this.#n.children)n.ariaSelected=t.next().value===e.toUpperCase()}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#n?.remove(),this.#n=null}}class jh{#e=null;#t=null;#r=null;static#n=null;constructor(e){this.#t=e,this.#r=e._uiManager,jh.#n||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#e)return this.#e;const{editorType:e,colorType:t,colorValue:n}=this.#t,i=this.#e=document.createElement("input");return i.type="color",i.value=n||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",jh.#n[e]),i.addEventListener("input",()=>{this.#r.updateParams(t,i.value)},{signal:this.#r._signal}),i}update(e){this.#e&&(this.#e.value=e)}destroy(){this.#e?.remove(),this.#e=null}hideDropdown(){}}function Iy(r){return Math.floor(Math.max(0,Math.min(1,r))*255).toString(16).padStart(2,"0")}function Hh(r){return Math.max(0,Math.min(255,255*r))}class My{static CMYK_G([e,t,n,i]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+i)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=Hh(e),[e,e,e]}static G_HTML([e]){const t=Iy(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return["G",.3*e+.59*t+.11*n]}static RGB_rgb(e){return e.map(Hh)}static RGB_HTML(e){return`#${e.map(Iy).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,n,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,n+i),1-Math.min(1,t+i)]}static CMYK_rgb([e,t,n,i]){return[Hh(1-Math.min(1,e+i)),Hh(1-Math.min(1,n+i)),Hh(1-Math.min(1,t+i))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){const i=1-e,a=1-t,s=1-n,o=Math.min(i,a,s);return["CMYK",i,a,s,o]}}class kF{create(e,t,n=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),n||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${t}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${t}`),i}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){pn("Abstract method `_createSVG` called.")}}class bf extends kF{_createSVG(e){return document.createElementNS(to,e)}}class Oy{static setupStorage(e,t,n,i,a){const s=i.getValue(t,{value:null});switch(n.name){case"textarea":if(s.value!==null&&(e.textContent=s.value),a==="print")break;e.addEventListener("input",o=>{i.setValue(t,{value:o.target.value})});break;case"input":if(n.attributes.type==="radio"||n.attributes.type==="checkbox"){if(s.value===n.attributes.xfaOn?e.setAttribute("checked",!0):s.value===n.attributes.xfaOff&&e.removeAttribute("checked"),a==="print")break;e.addEventListener("change",o=>{i.setValue(t,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&e.setAttribute("value",s.value),a==="print")break;e.addEventListener("input",o=>{i.setValue(t,{value:o.target.value})})}break;case"select":if(s.value!==null){e.setAttribute("value",s.value);for(const o of n.children)o.attributes.value===s.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}e.addEventListener("input",o=>{const l=o.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;i.setValue(t,{value:c})});break}}static setAttributes({html:e,element:t,storage:n=null,intent:i,linkService:a}){const{attributes:s}=t,o=e instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${i}`);for(const[l,c]of Object.entries(s))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}o&&a.addLinkAttributes(e,s.href,s.newWindow),n&&s.dataId&&this.setupStorage(e,s.dataId,t,n)}static render(e){const t=e.annotationStorage,n=e.linkService,i=e.xfaHtml,a=e.intent||"display",s=document.createElement(i.name);i.attributes&&this.setAttributes({html:s,element:i,intent:a,linkService:n});const o=a!=="richText",l=e.div;if(l.append(s),e.viewport){const h=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=h}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(i.children.length===0){if(i.value){const h=document.createTextNode(i.value);s.append(h),o&&Uh.shouldBuildText(i.name)&&c.push(h)}return{textDivs:c}}const u=[[i,-1,s]];for(;u.length>0;){const[h,d,f]=u.at(-1);if(d+1===h.children.length){u.pop();continue}const p=h.children[++u.at(-1)[1]];if(p===null)continue;const{name:m}=p;if(m==="#text"){const v=document.createTextNode(p.value);c.push(v),f.append(v);continue}const y=p?.attributes?.xmlns?document.createElementNS(p.attributes.xmlns,m):document.createElement(m);if(f.append(y),p.attributes&&this.setAttributes({html:y,element:p,storage:t,intent:a,linkService:n}),p.children?.length>0)u.push([p,-1,y]);else if(p.value){const v=document.createTextNode(p.value);o&&Uh.shouldBuildText(m)&&c.push(v),y.append(v)}}for(const h of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))h.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}const AF=9,Gl=new WeakSet,_F=new Date().getTimezoneOffset()*60*1e3;class Ny{static create(e){switch(e.data.annotationType){case Wn.LINK:return new B2(e);case Wn.TEXT:return new CF(e);case Wn.WIDGET:switch(e.data.fieldType){case"Tx":return new EF(e);case"Btn":return e.data.radioButton?new Ry(e):e.data.checkBox?new IF(e):new MF(e);case"Ch":return new OF(e);case"Sig":return new TF(e)}return new Wl(e);case Wn.POPUP:return new U2(e);case Wn.FREETEXT:return new Py(e);case Wn.LINE:return new RF(e);case Wn.SQUARE:return new PF(e);case Wn.CIRCLE:return new FF(e);case Wn.POLYLINE:return new Fy(e);case Wn.CARET:return new LF(e);case Wn.INK:return new z2(e);case Wn.POLYGON:return new DF(e);case Wn.HIGHLIGHT:return new Dy(e);case Wn.UNDERLINE:return new BF(e);case Wn.SQUIGGLY:return new UF(e);case Wn.STRIKEOUT:return new zF(e);case Wn.STAMP:return new Ly(e);case Wn.FILEATTACHMENT:return new jF(e);default:return new zn(e)}}}class zn{#e=null;#t=!1;#r=null;constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:i=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(n)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!!(e?.str||t?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return zn._hasPopupData(this.data)}updateEdited(e){if(!this.container)return;e.rect&&(this.#e||={rect:this.data.rect.slice(0)});const{rect:t,popup:n}=e;t&&this.#n(t);let i=this.#r?.popup||this.popup;!i&&n?.text&&(this._createPopup(n),i=this.#r.popup),i&&(i.updateEdited(e),n?.deleted&&(i.remove(),this.#r=null,this.popup=null))}resetEdited(){this.#e&&(this.#n(this.#e.rect),this.#r?.popup.resetEdited(),this.#e=null)}#n(e){const{container:{style:t},data:{rect:n,rotation:i},parent:{viewport:{rawDims:{pageWidth:a,pageHeight:s,pageX:o,pageY:l}}}}=this;n?.splice(0,4,...e),t.left=`${100*(e[0]-o)/a}%`,t.top=`${100*(s-e[3]+l)/s}%`,i===0?(t.width=`${100*(e[2]-e[0])/a}%`,t.height=`${100*(e[3]-e[1])/s}%`):this.setRotation(i)}_createContainer(e){const{data:t,parent:{page:n,viewport:i}}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",t.id),!(this instanceof Wl)&&!(this instanceof B2)&&(a.tabIndex=0);const{style:s}=a;if(s.zIndex=this.parent.zIndex++,t.alternativeText&&(a.title=t.alternativeText),t.noRotate&&a.classList.add("norotate"),!t.rect||this instanceof U2){const{rotation:m}=t;return!t.hasOwnCanvas&&m!==0&&this.setRotation(m,a),a}const{width:o,height:l}=this;if(!e&&t.borderStyle.width>0){s.borderWidth=`${t.borderStyle.width}px`;const m=t.borderStyle.horizontalCornerRadius,y=t.borderStyle.verticalCornerRadius;if(m>0||y>0){const x=`calc(${m}px * var(--total-scale-factor)) / calc(${y}px * var(--total-scale-factor))`;s.borderRadius=x}else if(this instanceof Ry){const x=`calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;s.borderRadius=x}switch(t.borderStyle.style){case tu.SOLID:s.borderStyle="solid";break;case tu.DASHED:s.borderStyle="dashed";break;case tu.BEVELED:Sr("Unimplemented border style: beveled");break;case tu.INSET:Sr("Unimplemented border style: inset");break;case tu.UNDERLINE:s.borderBottomStyle="solid";break}const v=t.borderColor||null;v?(this.#t=!0,s.borderColor=nr.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):s.borderWidth=0}const c=nr.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:u,pageHeight:h,pageX:d,pageY:f}=i.rawDims;s.left=`${100*(c[0]-d)/u}%`,s.top=`${100*(c[1]-f)/h}%`;const{rotation:p}=t;return t.hasOwnCanvas||p===0?(s.width=`${100*o/u}%`,s.height=`${100*l/h}%`):this.setRotation(p,a),a}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:n,pageHeight:i}=this.parent.viewport.rawDims;let{width:a,height:s}=this;e%180!==0&&([a,s]=[s,a]),t.style.width=`${100*a/n}%`,t.style.height=`${100*s/i}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(t,n,i)=>{const a=i.detail[t],s=a[0],o=a.slice(1);i.target.style[n]=My[`${s}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[n]:My[`${s}_rgb`](o)})};return jr(this,"_commonActions",{display:t=>{const{display:n}=t.detail,i=n%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:n===1||n===2})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:n}=t.detail;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:n,noView:n})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{const n=t.detail.rotation;this.setRotation(n),this.annotationStorage.setValue(this.data.id,{rotation:n})}})}_dispatchEventFromSandbox(e,t){const n=this._commonActions;for(const i of Object.keys(t.detail))(e[i]||n[i])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const n=this._commonActions;for(const[i,a]of Object.entries(t)){const s=n[i];if(s){const o={detail:{[i]:a},target:e};s(o),delete t[i]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,n,i,a]=this.data.rect.map(m=>Math.fround(m));if(e.length===8){const[m,y,v,x]=e.subarray(2,6);if(i===m&&a===y&&t===v&&n===x)return}const{style:s}=this.container;let o;if(this.#t){const{borderColor:m,borderWidth:y}=s;s.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${m}" stroke-width="${y}">`],this.container.classList.add("hasBorder")}const l=i-t,c=a-n,{svgFactory:u}=this,h=u.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0),h.role="none";const d=u.createElement("defs");h.append(d);const f=u.createElement("clipPath"),p=`clippath_${this.data.id}`;f.setAttribute("id",p),f.setAttribute("clipPathUnits","objectBoundingBox"),d.append(f);for(let m=2,y=e.length;m<y;m+=8){const v=e[m],x=e[m+1],S=e[m+2],A=e[m+3],C=u.createElement("rect"),k=(S-t)/l,I=(a-x)/c,R=(v-S)/l,U=(x-A)/c;C.setAttribute("x",k),C.setAttribute("y",I),C.setAttribute("width",R),C.setAttribute("height",U),f.append(C),o?.push(`<rect vector-effect="non-scaling-stroke" x="${k}" y="${I}" width="${R}" height="${U}"/>`)}this.#t&&(o.push("</g></svg>')"),s.backgroundImage=o.join("")),this.container.append(h),this.container.style.clipPath=`url(#${p})`}_createPopup(e=null){const{data:t}=this;let n,i;e?(n={str:e.text},i=e.date):(n=t.contentsObj,i=t.modificationDate);const a=this.#r=new U2({data:{color:t.color,titleObj:t.titleObj,modificationDate:i,contentsObj:n,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]});this.parent.div.append(a.render())}get hasPopupElement(){return!!(this.#r||this.popup||this.data.popupRef)}render(){pn("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const n=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:a,id:s,exportValues:o}of i){if(a===-1||s===t)continue;const l=typeof o=="string"?o:null,c=document.querySelector(`[data-element-id="${s}"]`);if(c&&!Gl.has(c)){Sr(`_getElementsByName - element not allowed: ${s}`);continue}n.push({id:s,exportValue:l,domElement:c})}return n}for(const i of document.getElementsByName(e)){const{exportValue:a}=i,s=i.getAttribute("data-element-id");s!==t&&Gl.has(i)&&n.push({id:s,exportValue:a,domElement:i})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class B2 extends zn{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let i=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),i=!0):e.action?(this._bindNamedAction(n,e.action,e.overlaidText),i=!0):e.attachment?(this.#t(n,e.attachment,e.overlaidText,e.attachmentDest),i=!0):e.setOCGState?(this.#r(n,e.setOCGState,e.overlaidText),i=!0):e.dest?(this._bindLink(n,e.dest,e.overlaidText),i=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),i=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(n,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&this.container.append(n),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t,n=""){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||t==="")&&this.#e(),n&&(e.title=n)}_bindNamedAction(e,t,n=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),n&&(e.title=n),this.#e()}#t(e,t,n="",i=null){e.href=this.linkService.getAnchorUrl(""),t.description?e.title=t.description:n&&(e.title=n),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,i),!1),this.#e()}#r(e,t,n=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),n&&(e.title=n),this.#e()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(t.actions)){const a=n.get(i);a&&(e[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:i}}),!1))}t.overlaidText&&(e.title=t.overlaidText),e.onclick||(e.onclick=()=>!1),this.#e()}_bindResetFormAction(e,t){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Sr('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(e.onclick=()=>!1);return}e.onclick=()=>{n?.();const{fields:i,refs:a,include:s}=t,o=[];if(i.length!==0||a.length!==0){const u=new Set(a);for(const h of i){const d=this._fieldObjects[h]||[];for(const{id:f}of d)u.add(f)}for(const h of Object.values(this._fieldObjects))for(const d of h)u.has(d.id)===s&&o.push(d)}else for(const u of Object.values(this._fieldObjects))o.push(...u);const l=this.annotationStorage,c=[];for(const u of o){const{id:h}=u;switch(c.push(h),u.type){case"text":{const f=u.defaultValue||"";l.setValue(h,{value:f});break}case"checkbox":case"radiobutton":{const f=u.defaultValue===u.exportValues;l.setValue(h,{value:f});break}case"combobox":case"listbox":{const f=u.defaultValue||"";l.setValue(h,{value:f});break}default:continue}const d=document.querySelector(`[data-element-id="${h}"]`);if(d){if(!Gl.has(d)){Sr(`_bindResetFormAction - element not allowed: ${h}`);continue}}else continue;d.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:c,name:"ResetForm"}}),!1}}}class CF extends zn{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class Wl extends zn{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return fi.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,i,a){n.includes("mouse")?e.addEventListener(n,s=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):e.addEventListener(n,s=>{if(n==="blur"){if(!t.focused||!s.relatedTarget)return;t.focused=!1}else if(n==="focus"){if(t.focused)return;t.focused=!0}a&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(s)}})})}_setEventListeners(e,t,n,i){for(const[a,s]of n)(s==="Action"||this.data.actions?.[s])&&((s==="Focus"||s==="Blur")&&(t||={focused:!1}),this._setEventListener(e,t,a,s,i),s==="Focus"&&!this.data.actions?.Blur?this._setEventListener(e,t,"blur","Blur",null):s==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(e,t,"focus","Focus",null))}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?"transparent":nr.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||AF,a=e.style;let s;const o=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o),u=Math.round(c/(f2*i))||1,h=c/u;s=Math.min(i,l(h/f2))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o);s=Math.min(i,l(c/f2))}a.fontSize=`calc(${s}px * var(--total-scale-factor))`,a.color=nr.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(a.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class EF extends Wl{constructor(e){const t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,n,i){const a=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[t]=n),a.setValue(s.id,{[i]:n})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const i=e.getValue(t,{value:this.data.fieldValue});let a=i.value||"";const s=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;s&&a.length>s&&(a=a.slice(0,s));let o=i.formattedValue||this.data.textContent?.join(`
`)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const l={userValue:a,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=o??a,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type=this.data.password?"password":"text",n.setAttribute("value",o??a),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),Gl.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;const{datetimeFormat:c,datetimeType:u,timeStep:h}=this.data,d=!!u&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),s&&(n.maxLength=s),n.addEventListener("input",p=>{e.setValue(t,{value:p.target.value}),this.setPropertyOnSiblings(n,"value",p.target.value,"value"),l.formattedValue=null}),n.addEventListener("resetform",p=>{const m=this.data.defaultFieldValue??"";n.value=l.userValue=m,l.formattedValue=null});let f=p=>{const{formattedValue:m}=l;m!=null&&(p.target.value=m),p.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",m=>{if(l.focused)return;const{target:y}=m;if(d&&(y.type=u,h&&(y.step=h)),l.userValue){const v=l.userValue;if(d)if(u==="time"){const x=new Date(v),S=[x.getHours(),x.getMinutes(),x.getSeconds()];y.value=S.map(A=>A.toString().padStart(2,"0")).join(":")}else y.value=new Date(v-_F).toISOString().split(u==="date"?"T":".",1)[0];else y.value=v}l.lastCommittedValue=y.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),n.addEventListener("updatefromsandbox",m=>{this.showElementAndHideCanvas(m.target);const y={value(v){l.userValue=v.detail.value??"",d||e.setValue(t,{value:l.userValue.toString()}),v.target.value=l.userValue},formattedValue(v){const{formattedValue:x}=v.detail;l.formattedValue=x,x!=null&&v.target!==document.activeElement&&(v.target.value=x);const S={formattedValue:x};d&&(S.value=x),e.setValue(t,S)},selRange(v){v.target.setSelectionRange(...v.detail.selRange)},charLimit:v=>{const{charLimit:x}=v.detail,{target:S}=v;if(x===0){S.removeAttribute("maxLength");return}S.setAttribute("maxLength",x);let A=l.userValue;!A||A.length<=x||(A=A.slice(0,x),S.value=l.userValue=A,e.setValue(t,{value:A}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:A,willCommit:!0,commitKey:1,selStart:S.selectionStart,selEnd:S.selectionEnd}}))}};this._dispatchEventFromSandbox(y,m)}),n.addEventListener("keydown",m=>{l.commitKey=1;let y=-1;if(m.key==="Escape"?y=0:m.key==="Enter"&&!this.data.multiLine?y=2:m.key==="Tab"&&(l.commitKey=3),y===-1)return;const{value:v}=m.target;l.lastCommittedValue!==v&&(l.lastCommittedValue=v,l.userValue=v,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:v,willCommit:!0,commitKey:y,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}))});const p=f;f=null,n.addEventListener("blur",m=>{if(!l.focused||!m.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{target:y}=m;let{value:v}=y;if(d){if(v&&u==="time"){const x=v.split(":").map(S=>parseInt(S,10));v=new Date(2e3,0,1,x[0],x[1],x[2]||0).valueOf(),y.step=""}else v=new Date(v).valueOf();y.type="text"}l.userValue=v,l.lastCommittedValue!==v&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:v,willCommit:!0,commitKey:l.commitKey,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}),p(m)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",m=>{l.lastCommittedValue=null;const{data:y,target:v}=m,{value:x,selectionStart:S,selectionEnd:A}=v;let C=S,k=A;switch(m.inputType){case"deleteWordBackward":{const I=x.substring(0,S).match(/\w*[^\w]*$/);I&&(C-=I[0].length);break}case"deleteWordForward":{const I=x.substring(S).match(/^[^\w]*\w*/);I&&(k+=I[0].length);break}case"deleteContentBackward":S===A&&(C-=1);break;case"deleteContentForward":S===A&&(k+=1);break}m.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:x,change:y||"",willCommit:!1,selStart:C,selEnd:k}})}),this._setEventListeners(n,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],m=>m.target.value)}if(f&&n.addEventListener("blur",f),this.data.comb){const m=(this.data.rect[2]-this.data.rect[0])/s;n.classList.add("comb"),n.style.letterSpacing=`calc(${m}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class TF extends Wl{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class IF extends Wl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let i=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",e.setValue(n,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const a=document.createElement("input");return Gl.add(a),a.setAttribute("data-element-id",n),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="checkbox",a.name=t.fieldName,i&&a.setAttribute("checked",!0),a.setAttribute("exportValue",t.exportValue),a.tabIndex=0,a.addEventListener("change",s=>{const{name:o,checked:l}=s.target;for(const c of this._getElementsByName(o,n)){const u=l&&c.exportValue===t.exportValue;c.domElement&&(c.domElement.checked=u),e.setValue(c.id,{value:u})}e.setValue(n,{value:l})}),a.addEventListener("resetform",s=>{const o=t.defaultFieldValue||"Off";s.target.checked=o===t.exportValue}),this.enableScripting&&this.hasJSActions&&(a.addEventListener("updatefromsandbox",s=>{const o={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(n,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,s)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class Ry extends Wl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,n=t.id;let i=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;if(typeof i=="string"&&(i=i!==t.buttonValue,e.setValue(n,{value:i})),i)for(const s of this._getElementsByName(t.fieldName,n))e.setValue(s.id,{value:!1});const a=document.createElement("input");if(Gl.add(a),a.setAttribute("data-element-id",n),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=t.fieldName,i&&a.setAttribute("checked",!0),a.tabIndex=0,a.addEventListener("change",s=>{const{name:o,checked:l}=s.target;for(const c of this._getElementsByName(o,n))e.setValue(c.id,{value:!1});e.setValue(n,{value:l})}),a.addEventListener("resetform",s=>{const o=t.defaultFieldValue;s.target.checked=o!=null&&o===t.buttonValue}),this.enableScripting&&this.hasJSActions){const s=t.buttonValue;a.addEventListener("updatefromsandbox",o=>{const l={value:c=>{const u=s===c.detail.value;for(const h of this._getElementsByName(c.target.name)){const d=u&&h.id===n;h.domElement&&(h.domElement.checked=d),e.setValue(h.id,{value:d})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class MF extends B2{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",n=>{this._dispatchEventFromSandbox({},n)})),e}}class OF extends Wl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),i=document.createElement("select");Gl.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let a=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",u=>{const h=this.data.defaultFieldValue;for(const d of i.options)d.selected=d.value===h});for(const u of this.data.options){const h=document.createElement("option");h.textContent=u.displayValue,h.value=u.exportValue,n.value.includes(u.exportValue)&&(h.setAttribute("selected",!0),a=!1),i.append(h)}let s=null;if(a){const u=document.createElement("option");u.value=" ",u.setAttribute("hidden",!0),u.setAttribute("selected",!0),i.prepend(u),s=()=>{u.remove(),i.removeEventListener("input",s),s=null},i.addEventListener("input",s)}const o=u=>{const h=u?"value":"textContent",{options:d,multiple:f}=i;return f?Array.prototype.filter.call(d,p=>p.selected).map(p=>p[h]):d.selectedIndex===-1?null:d[d.selectedIndex][h]};let l=o(!1);const c=u=>{const h=u.target.options;return Array.prototype.map.call(h,d=>({displayValue:d.textContent,exportValue:d.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",u=>{const h={value(d){s?.();const f=d.detail.value,p=new Set(Array.isArray(f)?f:[f]);for(const m of i.options)m.selected=p.has(m.value);e.setValue(t,{value:o(!0)}),l=o(!1)},multipleSelection(d){i.multiple=!0},remove(d){const f=i.options,p=d.detail.remove;f[p].selected=!1,i.remove(p),f.length>0&&Array.prototype.findIndex.call(f,y=>y.selected)===-1&&(f[0].selected=!0),e.setValue(t,{value:o(!0),items:c(d)}),l=o(!1)},clear(d){for(;i.length!==0;)i.remove(0);e.setValue(t,{value:null,items:[]}),l=o(!1)},insert(d){const{index:f,displayValue:p,exportValue:m}=d.detail.insert,y=i.children[f],v=document.createElement("option");v.textContent=p,v.value=m,y?y.before(v):i.append(v),e.setValue(t,{value:o(!0),items:c(d)}),l=o(!1)},items(d){const{items:f}=d.detail;for(;i.length!==0;)i.remove(0);for(const p of f){const{displayValue:m,exportValue:y}=p,v=document.createElement("option");v.textContent=m,v.value=y,i.append(v)}i.options.length>0&&(i.options[0].selected=!0),e.setValue(t,{value:o(!0),items:c(d)}),l=o(!1)},indices(d){const f=new Set(d.detail.indices);for(const p of d.target.options)p.selected=f.has(p.index);e.setValue(t,{value:o(!0)}),l=o(!1)},editable(d){d.target.disabled=!d.detail.editable}};this._dispatchEventFromSandbox(h,u)}),i.addEventListener("input",u=>{const h=o(!0),d=o(!1);e.setValue(t,{value:h}),u.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:l,change:d,changeEx:h,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],u=>u.target.value)):i.addEventListener("input",function(u){e.setValue(t,{value:o(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class U2 extends zn{constructor(e){const{data:t,elements:n}=e;super(e,{isRenderable:zn._hasPopupData(t)}),this.elements=n,this.popup=null}render(){const{container:e}=this;e.classList.add("popupAnnotation"),e.role="comment";const t=this.popup=new NF({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),n=[];for(const i of this.elements)i.popup=t,i.container.ariaHasPopup="dialog",n.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",n.map(i=>`${v2}${i}`).join(",")),this.container}}class NF{#e=this.#M.bind(this);#t=this.#N.bind(this);#r=this.#E.bind(this);#n=this.#T.bind(this);#a=null;#i=null;#s=null;#o=null;#l=null;#c=null;#h=null;#u=!1;#g=null;#p=null;#f=null;#d=null;#m=null;#y=null;#b=null;#w=!1;constructor({container:e,color:t,elements:n,titleObj:i,modificationDate:a,contentsObj:s,richText:o,parent:l,rect:c,parentRect:u,open:h}){this.#i=e,this.#y=i,this.#s=s,this.#m=o,this.#c=l,this.#a=t,this.#d=c,this.#h=u,this.#l=n,this.#o=x2.toDateObject(a),this.trigger=n.flatMap(d=>d.getElementsToTriggerPopup()),this.#x(),this.#i.hidden=!0,h&&this.#T()}#x(){if(this.#p)return;this.#p=new AbortController;const{signal:e}=this.#p;for(const t of this.trigger)t.addEventListener("click",this.#n,{signal:e}),t.addEventListener("mouseenter",this.#r,{signal:e}),t.addEventListener("mouseleave",this.#t,{signal:e}),t.classList.add("popupTriggerArea");for(const t of this.#l)t.container?.addEventListener("keydown",this.#e,{signal:e})}render(){if(this.#g)return;const e=this.#g=document.createElement("div");if(e.className="popup",this.#a){const i=e.style.outlineColor=nr.makeHexColor(...this.#a);e.style.backgroundColor=`color-mix(in srgb, ${i} 30%, white)`}const t=document.createElement("span");if(t.className="header",this.#y?.str){const i=document.createElement("span");i.className="title",t.append(i),{dir:i.dir,str:i.textContent}=this.#y}if(e.append(t),this.#o){const i=document.createElement("time");i.className="popupDate",i.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),i.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#o.valueOf()})),i.dateTime=this.#o.toISOString(),t.append(i)}const n=this.#v;if(n)Oy.render({xfaHtml:n,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const i=this._formatContents(this.#s);e.append(i)}this.#i.append(e)}get#v(){const e=this.#m,t=this.#s;return e?.str&&(!t?.str||t.str===e.str)&&this.#m.html||null}get#k(){return this.#v?.attributes?.style?.fontSize||0}get#C(){return this.#v?.attributes?.style?.color||null}#A(e){const t=[],n={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},i={style:{color:this.#C,fontSize:this.#k?`calc(${this.#k}px * var(--total-scale-factor))`:""}};for(const a of e.split(`
`))t.push({name:"span",value:a,attributes:i});return n}_formatContents({str:e,dir:t}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=t;const i=e.split(/(?:\r\n?|\n)/);for(let a=0,s=i.length;a<s;++a){const o=i[a];n.append(document.createTextNode(o)),a<s-1&&n.append(document.createElement("br"))}return n}#M(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#u)&&this.#T()}updateEdited({rect:e,popup:t,deleted:n}){if(n||t?.deleted){this.remove();return}this.#x(),this.#b||={contentsObj:this.#s,richText:this.#m},e&&(this.#f=null),t&&(this.#m=this.#A(t.text),this.#o=x2.toDateObject(t.date),this.#s=null),this.#g?.remove(),this.#g=null}resetEdited(){this.#b&&({contentsObj:this.#s,richText:this.#m}=this.#b,this.#b=null,this.#g?.remove(),this.#g=null,this.#f=null)}remove(){this.#p?.abort(),this.#p=null,this.#g?.remove(),this.#g=null,this.#w=!1,this.#u=!1;for(const e of this.trigger)e.classList.remove("popupTriggerArea")}#I(){if(this.#f!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:i,pageY:a}}}=this.#c;let s=!!this.#h,o=s?this.#h:this.#d;for(const p of this.#l)if(!o||nr.intersect(p.data.rect,o)!==null){o=p.data.rect,s=!0;break}const l=nr.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),u=s?o[2]-o[0]+5:0,h=l[0]+u,d=l[1];this.#f=[100*(h-i)/t,100*(d-a)/n];const{style:f}=this.#i;f.left=`${this.#f[0]}%`,f.top=`${this.#f[1]}%`}#T(){this.#u=!this.#u,this.#u?(this.#E(),this.#i.addEventListener("click",this.#n),this.#i.addEventListener("keydown",this.#e)):(this.#N(),this.#i.removeEventListener("click",this.#n),this.#i.removeEventListener("keydown",this.#e))}#E(){this.#g||this.render(),this.isVisible?this.#u&&this.#i.classList.add("focused"):(this.#I(),this.#i.hidden=!1,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)+1e3)}#N(){this.#i.classList.remove("focused"),!(this.#u||!this.isVisible)&&(this.#i.hidden=!0,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)-1e3)}forceHide(){this.#w=this.isVisible,this.#w&&(this.#i.hidden=!0)}maybeShow(){this.#x(),this.#w&&(this.#g||this.#E(),this.#w=!1,this.#i.hidden=!1)}get isVisible(){return this.#i.hidden===!1}}class Py extends zn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=xr.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const n=document.createElement("span");n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class RF extends zn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:e,width:t,height:n}=this,i=this.svgFactory.create(t,n,!0),a=this.#e=this.svgFactory.createElement("svg:line");return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class PF extends zn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:e,width:t,height:n}=this,i=this.svgFactory.create(t,n,!0),a=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",a/2),s.setAttribute("y",a/2),s.setAttribute("width",t-a),s.setAttribute("height",n-a),s.setAttribute("stroke-width",a||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class FF extends zn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:e,width:t,height:n}=this,i=this.svgFactory.create(t,n,!0),a=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",t/2),s.setAttribute("cy",n/2),s.setAttribute("rx",t/2-a/2),s.setAttribute("ry",n/2-a/2),s.setAttribute("stroke-width",a||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class Fy extends zn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:t,borderStyle:n,popupRef:i},width:a,height:s}=this;if(!t)return this.container;const o=this.svgFactory.create(a,s,!0);let l=[];for(let u=0,h=t.length;u<h;u+=2){const d=t[u]-e[0],f=e[3]-t[u+1];l.push(`${d},${f}`)}l=l.join(" ");const c=this.#e=this.svgFactory.createElement(this.svgElementName);return c.setAttribute("points",l),c.setAttribute("stroke-width",n.width||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),o.append(c),this.container.append(o),!i&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class DF extends Fy{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class LF extends zn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class z2 extends zn{#e=null;#t=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?xr.HIGHLIGHT:xr.INK}#r(e,t){switch(e){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,rotation:t,inkLists:n,borderStyle:i,popupRef:a}}=this,{transform:s,width:o,height:l}=this.#r(t,e),c=this.svgFactory.create(o,l,!0),u=this.#e=this.svgFactory.createElement("svg:g");c.append(u),u.setAttribute("stroke-width",i.width||1),u.setAttribute("stroke-linecap","round"),u.setAttribute("stroke-linejoin","round"),u.setAttribute("stroke-miterlimit",10),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),u.setAttribute("transform",s);for(let h=0,d=n.length;h<d;h++){const f=this.svgFactory.createElement(this.svgElementName);this.#t.push(f),f.setAttribute("points",n[h].join(",")),u.append(f)}return!a&&this.hasPopupData&&this._createPopup(),this.container.append(c),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);const{thickness:t,points:n,rect:i}=e,a=this.#e;if(t>=0&&a.setAttribute("stroke-width",t||1),n)for(let s=0,o=this.#t.length;s<o;s++)this.#t[s].setAttribute("points",n[s].join(","));if(i){const{transform:s,width:o,height:l}=this.#r(this.data.rotation,i);a.parentElement.setAttribute("viewBox",`0 0 ${o} ${l}`),a.setAttribute("transform",s)}}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class Dy extends zn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=xr.HIGHLIGHT}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),e){const n=document.createElement("mark");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class BF extends zn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),e){const n=document.createElement("u");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class UF extends zn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),e){const n=document.createElement("u");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class zF extends zn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),e){const n=document.createElement("s");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class Ly extends zn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=xr.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class jF extends zn{#e=null;constructor(e){super(e,{isRenderable:!0});const{file:t}=this.data;this.filename=t.filename,this.content=t.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...t})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:t}=this;let n;t.hasAppearance||t.fillAlpha===0?n=document.createElement("div"):(n=document.createElement("img"),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?"paperclip":"pushpin"}.svg`,t.fillAlpha&&t.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(t.fillAlpha*100)}%);`)),n.addEventListener("dblclick",this.#t.bind(this)),this.#e=n;const{isMac:i}=fi.platform;return e.addEventListener("keydown",a=>{a.key==="Enter"&&(i?a.metaKey:a.ctrlKey)&&this.#t()}),!t.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),e.append(n),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class j2{#e=null;#t=null;#r=new Map;#n=null;constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:i,page:a,viewport:s,structTreeLayer:o}){this.div=e,this.#e=t,this.#t=n,this.#n=o||null,this.page=a,this.viewport=s,this.zIndex=0,this._annotationEditorUIManager=i}hasEditableAnnotations(){return this.#r.size>0}async#a(e,t,n){const i=e.firstChild||e,a=i.id=`${v2}${t}`,s=await this.#n?.getAriaAttributes(a);if(s)for(const[o,l]of s)i.setAttribute(o,l);n?n.at(-1).container.after(e):(this.div.append(e),this.#e?.moveElementInDOM(this.div,e,i,!1))}async render(e){const{annotations:t}=e,n=this.div;ql(n,this.viewport);const i=new Map,a={data:null,layer:n,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new bf,annotationStorage:e.annotationStorage||new C2,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const s of t){if(s.noHTML)continue;const o=s.annotationType===Wn.POPUP;if(o){const u=i.get(s.id);if(!u)continue;a.elements=u}else if(s.rect[2]===s.rect[0]||s.rect[3]===s.rect[1])continue;a.data=s;const l=Ny.create(a);if(!l.isRenderable)continue;if(!o&&s.popupRef){const u=i.get(s.popupRef);u?u.push(l):i.set(s.popupRef,[l])}const c=l.render();s.hidden&&(c.style.visibility="hidden"),await this.#a(c,s.id,a.elements),l._isEditable&&(this.#r.set(l.data.id,l),this._annotationEditorUIManager?.renderAnnotationElement(l))}this.#i()}async addLinkAnnotations(e,t){const n={data:null,layer:this.div,linkService:t,svgFactory:new bf,parent:this};for(const i of e){i.borderStyle||=j2._defaultBorderStyle,n.data=i;const a=Ny.create(n);if(!a.isRenderable)continue;const s=a.render();await this.#a(s,i.id,null)}}update({viewport:e}){const t=this.div;this.viewport=e,ql(t,{rotation:e.rotation}),this.#i(),t.hidden=!1}#i(){if(!this.#t)return;const e=this.div;for(const[t,n]of this.#t){const i=e.querySelector(`[data-annotation-id="${t}"]`);if(!i)continue;n.className="annotationContent";const{firstChild:a}=i;a?a.nodeName==="CANVAS"?a.replaceWith(n):a.classList.contains("annotationContent")?a.after(n):a.before(n):i.append(n);const s=this.#r.get(t);s&&(s._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,i.id,n),s._hasNoCanvas=!1):s.canvas=n)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#r.values())}getEditableAnnotation(e){return this.#r.get(e)}static get _defaultBorderStyle(){return jr(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:tu.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const vf=/\r\n?|\n/g;class ei extends or{#e;#t="";#r=`${this.id}-editor`;#n=null;#a;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const e=ei.prototype,t=a=>a.isEmpty(),n=Yo.TRANSLATE_SMALL,i=Yo.TRANSLATE_BIG;return jr(this,"_keyboardManager",new Ph([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[i,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,i],checker:t}]]))}static _type="freetext";static _editorType=xr.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.#e=e.color||ei._defaultColor||or._defaultLineColor,this.#a=e.fontSize||ei._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static initialize(e,t){or.initialize(e,t);const n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case Jr.FREETEXT_SIZE:ei._defaultFontSize=t;break;case Jr.FREETEXT_COLOR:ei._defaultColor=t;break}}updateParams(e,t){switch(e){case Jr.FREETEXT_SIZE:this.#i(t);break;case Jr.FREETEXT_COLOR:this.#s(t);break}}static get defaultPropertiesToUpdate(){return[[Jr.FREETEXT_SIZE,ei._defaultFontSize],[Jr.FREETEXT_COLOR,ei._defaultColor||or._defaultLineColor]]}get propertiesToUpdate(){return[[Jr.FREETEXT_SIZE,this.#a],[Jr.FREETEXT_COLOR,this.#e]]}get toolbarButtons(){return this._colorPicker||=new jh(this),[["colorPicker",this._colorPicker]]}get colorType(){return Jr.FREETEXT_COLOR}get colorValue(){return this.#e}#i(e){const t=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--total-scale-factor))`,this.translate(0,-(i-this.#a)*this.parentScale),this.#a=i,this.#l()},n=this.#a;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Jr.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#s(e){const t=i=>{this.#e=this.editorDiv.style.color=i,this._colorPicker?.update(i)},n=this.#e;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Jr.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){const e=this.parentScale;return[-ei._internalPadding*e,-(ei._internalPadding+this.#a)*e]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#n=new AbortController;const e=this._uiManager.combinedSignal(this.#n);return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#r),this._isDraggable=!0,this.#n?.abort(),this.#n=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#o(){const e=[];this.editorDiv.normalize();let t=null;for(const n of this.editorDiv.childNodes)t?.nodeType===Node.TEXT_NODE&&n.nodeName==="BR"||(e.push(ei.#c(n)),t=n);return e.join(`
`)}#l(){const[e,t]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:i,div:a}=this,s=a.style.display,o=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",i.div.append(this.div),n=a.getBoundingClientRect(),a.remove(),a.style.display=s,a.classList.toggle("hidden",o)}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#t,t=this.#t=this.#o().trimEnd();if(e===t)return;const n=i=>{if(this.#t=i,!i){this.remove();return}this.#h(),this._uiManager.rebuild(this),this.#l()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),this.#l()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){ei._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let e,t;(this._isCopy||this.annotationElementId)&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#r),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#a}px * var(--total-scale-factor))`,n.color=this.#e,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[i,a]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this._initialData;let[o,l]=this.getInitialTranslation();[o,l]=this.pageTranslationToScreen(o,l);const[c,u]=this.pageDimensions,[h,d]=this.pageTranslation;let f,p;switch(this.rotation){case 0:f=e+(s[0]-h)/c,p=t+this.height-(s[1]-d)/u;break;case 90:f=e+(s[0]-h)/c,p=t-(s[1]-d)/u,[o,l]=[l,-o];break;case 180:f=e-this.width+(s[0]-h)/c,p=t-(s[1]-d)/u,[o,l]=[-o,-l];break;case 270:f=e+(s[0]-h-this.height*u)/c,p=t+(s[1]-d-this.width*c)/u,[o,l]=[-l,o];break}this.setAt(f*i,p*a,o,l)}else this._moveAfterPaste(e,t);this.#h(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(vf,"")}editorDivPaste(e){const t=e.clipboardData||window.clipboardData,{types:n}=t;if(n.length===1&&n[0]==="text/plain")return;e.preventDefault();const i=ei.#g(t.getData("text")||"").replaceAll(vf,`
`);if(!i)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const s=a.getRangeAt(0);if(!i.includes(`
`)){s.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:o,startOffset:l}=s,c=[],u=[];if(o.nodeType===Node.TEXT_NODE){const f=o.parentElement;if(u.push(o.nodeValue.slice(l).replaceAll(vf,"")),f!==this.editorDiv){let p=c;for(const m of this.editorDiv.childNodes){if(m===f){p=u;continue}p.push(ei.#c(m))}}c.push(o.nodeValue.slice(0,l).replaceAll(vf,""))}else if(o===this.editorDiv){let f=c,p=0;for(const m of this.editorDiv.childNodes)p++===l&&(f=u),f.push(ei.#c(m))}this.#t=`${c.join(`
`)}${i}${u.join(`
`)}`,this.#h();const h=new Range;let d=Math.sumPrecise(c.map(f=>f.length));for(const{firstChild:f}of this.editorDiv.childNodes)if(f.nodeType===Node.TEXT_NODE){const p=f.nodeValue.length;if(d<=p){h.setStart(f,d),h.setEnd(f,d);break}d-=p}a.removeAllRanges(),a.addRange(h)}#h(){if(this.editorDiv.replaceChildren(),!!this.#t)for(const e of this.#t.split(`
`)){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}#u(){return this.#t.replaceAll(" "," ")}static#g(e){return e.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static async deserialize(e,t,n){let i=null;if(e instanceof Py){const{data:{defaultAppearanceData:{fontSize:s,fontColor:o},rect:l,rotation:c,id:u,popupRef:h,contentsObj:d},textContent:f,textPosition:p,parent:{page:{pageNumber:m}}}=e;if(!f||f.length===0)return null;i=e={annotationType:xr.FREETEXT,color:Array.from(o),fontSize:s,value:f.join(`
`),position:p,pageIndex:m-1,rect:l.slice(0),rotation:c,annotationElementId:u,id:u,deleted:!1,popupRef:h,comment:d?.str||null}}const a=await super.deserialize(e,t,n);return a.#a=e.fontSize,a.#e=nr.makeHexColor(...e.color),a.#t=ei.#g(e.value),a._initialData=i,e.comment&&a.setCommentData(e.comment),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const t=ei._internalPadding*this.parentScale,n=this.getRect(t,t),i=or._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#e),a={annotationType:xr.FREETEXT,color:i,fontSize:this.#a,value:this.#u(),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(a),e?(a.isCopy=!0,a):this.annotationElementId&&!this.#p(a)?null:(a.id=this.annotationElementId,a)}#p(e){const{value:t,fontSize:n,color:i,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==t||e.fontSize!==n||e.color.some((s,o)=>s!==i[o])||e.pageIndex!==a}renderAnnotationElement(e){const t=super.renderAnnotationElement(e),{style:n}=t;n.fontSize=`calc(${this.#a}px * var(--total-scale-factor))`,n.color=this.#e,t.replaceChildren();for(const s of this.#t.split(`
`)){const o=document.createElement("div");o.append(s?document.createTextNode(s):document.createElement("br")),t.append(o)}const i=ei._internalPadding*this.parentScale,a={rect:this.getRect(i,i)};return a.popup=this.hasEditedComment?this.comment:{text:this.#t},e.updateEdited(a),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class Ht{static PRECISION=1e-4;toSVGPath(){pn("Abstract method `toSVGPath` must be implemented.")}get box(){pn("Abstract getter `box` must be implemented.")}serialize(e,t){pn("Abstract method `serialize` must be implemented.")}static _rescale(e,t,n,i,a,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=t+e[o]*i,s[o+1]=n+e[o+1]*a;return s}static _rescaleAndSwap(e,t,n,i,a,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=t+e[o+1]*i,s[o+1]=n+e[o]*a;return s}static _translate(e,t,n,i){i||=new Float32Array(e.length);for(let a=0,s=e.length;a<s;a+=2)i[a]=t+e[a],i[a+1]=n+e[a+1];return i}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,i,a){switch(a){case 90:return[1-t/n,e/i];case 180:return[1-e/n,1-t/i];case 270:return[t/n,1-e/i];default:return[e/n,t/i]}}static _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,n,i,a,s){return[(e+5*n)/6,(t+5*i)/6,(5*n+a)/6,(5*i+s)/6,(n+a)/2,(i+s)/2]}}class Vl{#e;#t=[];#r;#n;#a=[];#i=new Float32Array(18);#s;#o;#l;#c;#h;#u;#g=[];static#p=8;static#f=2;static#d=Vl.#p+Vl.#f;constructor({x:e,y:t},n,i,a,s,o=0){this.#e=n,this.#u=a*i,this.#n=s,this.#i.set([NaN,NaN,NaN,NaN,e,t],6),this.#r=o,this.#c=Vl.#p*i,this.#l=Vl.#d*i,this.#h=i,this.#g.push(e,t)}isEmpty(){return isNaN(this.#i[8])}#m(){const e=this.#i.subarray(4,6),t=this.#i.subarray(16,18),[n,i,a,s]=this.#e;return[(this.#s+(e[0]-t[0])/2-n)/a,(this.#o+(e[1]-t[1])/2-i)/s,(this.#s+(t[0]-e[0])/2-n)/a,(this.#o+(t[1]-e[1])/2-i)/s]}add({x:e,y:t}){this.#s=e,this.#o=t;const[n,i,a,s]=this.#e;let[o,l,c,u]=this.#i.subarray(8,12);const h=e-c,d=t-u,f=Math.hypot(h,d);if(f<this.#l)return!1;const p=f-this.#c,m=p/f,y=m*h,v=m*d;let x=o,S=l;o=c,l=u,c+=y,u+=v,this.#g?.push(e,t);const A=-v/p,C=y/p,k=A*this.#u,I=C*this.#u;return this.#i.set(this.#i.subarray(2,8),0),this.#i.set([c+k,u+I],4),this.#i.set(this.#i.subarray(14,18),12),this.#i.set([c-k,u-I],16),isNaN(this.#i[6])?(this.#a.length===0&&(this.#i.set([o+k,l+I],2),this.#a.push(NaN,NaN,NaN,NaN,(o+k-n)/a,(l+I-i)/s),this.#i.set([o-k,l-I],14),this.#t.push(NaN,NaN,NaN,NaN,(o-k-n)/a,(l-I-i)/s)),this.#i.set([x,S,o,l,c,u],6),!this.isEmpty()):(this.#i.set([x,S,o,l,c,u],6),Math.abs(Math.atan2(S-l,x-o)-Math.atan2(v,y))<Math.PI/2?([o,l,c,u]=this.#i.subarray(2,6),this.#a.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/a,((l+u)/2-i)/s),[o,l,x,S]=this.#i.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((x+o)/2-n)/a,((S+l)/2-i)/s),!0):([x,S,o,l,c,u]=this.#i.subarray(0,6),this.#a.push(((x+5*o)/6-n)/a,((S+5*l)/6-i)/s,((5*o+c)/6-n)/a,((5*l+u)/6-i)/s,((o+c)/2-n)/a,((l+u)/2-i)/s),[c,u,o,l,x,S]=this.#i.subarray(12,18),this.#t.push(((x+5*o)/6-n)/a,((S+5*l)/6-i)/s,((5*o+c)/6-n)/a,((5*l+u)/6-i)/s,((o+c)/2-n)/a,((l+u)/2-i)/s),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#a,t=this.#t;if(isNaN(this.#i[6])&&!this.isEmpty())return this.#y();const n=[];n.push(`M${e[4]} ${e[5]}`);for(let i=6;i<e.length;i+=6)isNaN(e[i])?n.push(`L${e[i+4]} ${e[i+5]}`):n.push(`C${e[i]} ${e[i+1]} ${e[i+2]} ${e[i+3]} ${e[i+4]} ${e[i+5]}`);this.#w(n);for(let i=t.length-6;i>=6;i-=6)isNaN(t[i])?n.push(`L${t[i+4]} ${t[i+5]}`):n.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);return this.#b(n),n.join(" ")}#y(){const[e,t,n,i]=this.#e,[a,s,o,l]=this.#m();return`M${(this.#i[2]-e)/n} ${(this.#i[3]-t)/i} L${(this.#i[4]-e)/n} ${(this.#i[5]-t)/i} L${a} ${s} L${o} ${l} L${(this.#i[16]-e)/n} ${(this.#i[17]-t)/i} L${(this.#i[14]-e)/n} ${(this.#i[15]-t)/i} Z`}#b(e){const t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#w(e){const[t,n,i,a]=this.#e,s=this.#i.subarray(4,6),o=this.#i.subarray(16,18),[l,c,u,h]=this.#m();e.push(`L${(s[0]-t)/i} ${(s[1]-n)/a} L${l} ${c} L${u} ${h} L${(o[0]-t)/i} ${(o[1]-n)/a}`)}newFreeDrawOutline(e,t,n,i,a,s){return new By(e,t,n,i,a,s)}getOutlines(){const e=this.#a,t=this.#t,n=this.#i,[i,a,s,o]=this.#e,l=new Float32Array((this.#g?.length??0)+2);for(let h=0,d=l.length-2;h<d;h+=2)l[h]=(this.#g[h]-i)/s,l[h+1]=(this.#g[h+1]-a)/o;if(l[l.length-2]=(this.#s-i)/s,l[l.length-1]=(this.#o-a)/o,isNaN(n[6])&&!this.isEmpty())return this.#x(l);const c=new Float32Array(this.#a.length+24+this.#t.length);let u=e.length;for(let h=0;h<u;h+=2){if(isNaN(e[h])){c[h]=c[h+1]=NaN;continue}c[h]=e[h],c[h+1]=e[h+1]}u=this.#k(c,u);for(let h=t.length-6;h>=6;h-=6)for(let d=0;d<6;d+=2){if(isNaN(t[h+d])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=t[h+d],c[u+1]=t[h+d+1],u+=2}return this.#v(c,u),this.newFreeDrawOutline(c,l,this.#e,this.#h,this.#r,this.#n)}#x(e){const t=this.#i,[n,i,a,s]=this.#e,[o,l,c,u]=this.#m(),h=new Float32Array(36);return h.set([NaN,NaN,NaN,NaN,(t[2]-n)/a,(t[3]-i)/s,NaN,NaN,NaN,NaN,(t[4]-n)/a,(t[5]-i)/s,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,(t[16]-n)/a,(t[17]-i)/s,NaN,NaN,NaN,NaN,(t[14]-n)/a,(t[15]-i)/s],0),this.newFreeDrawOutline(h,e,this.#e,this.#h,this.#r,this.#n)}#v(e,t){const n=this.#t;return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+=6}#k(e,t){const n=this.#i.subarray(4,6),i=this.#i.subarray(16,18),[a,s,o,l]=this.#e,[c,u,h,d]=this.#m();return e.set([NaN,NaN,NaN,NaN,(n[0]-a)/o,(n[1]-s)/l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,(i[0]-a)/o,(i[1]-s)/l],t),t+=24}}class By extends Ht{#e;#t=new Float32Array(4);#r;#n;#a;#i;#s;constructor(e,t,n,i,a,s){super(),this.#s=e,this.#a=t,this.#e=n,this.#i=i,this.#r=a,this.#n=s,this.lastPoint=[NaN,NaN],this.#o(s);const[o,l,c,u]=this.#t;for(let h=0,d=e.length;h<d;h+=2)e[h]=(e[h]-o)/c,e[h+1]=(e[h+1]-l)/u;for(let h=0,d=t.length;h<d;h+=2)t[h]=(t[h]-o)/c,t[h+1]=(t[h+1]-l)/u}toSVGPath(){const e=[`M${this.#s[4]} ${this.#s[5]}`];for(let t=6,n=this.#s.length;t<n;t+=6){if(isNaN(this.#s[t])){e.push(`L${this.#s[t+4]} ${this.#s[t+5]}`);continue}e.push(`C${this.#s[t]} ${this.#s[t+1]} ${this.#s[t+2]} ${this.#s[t+3]} ${this.#s[t+4]} ${this.#s[t+5]}`)}return e.push("Z"),e.join(" ")}serialize([e,t,n,i],a){const s=n-e,o=i-t;let l,c;switch(a){case 0:l=Ht._rescale(this.#s,e,i,s,-o),c=Ht._rescale(this.#a,e,i,s,-o);break;case 90:l=Ht._rescaleAndSwap(this.#s,e,t,s,o),c=Ht._rescaleAndSwap(this.#a,e,t,s,o);break;case 180:l=Ht._rescale(this.#s,n,t,-s,o),c=Ht._rescale(this.#a,n,t,-s,o);break;case 270:l=Ht._rescaleAndSwap(this.#s,n,i,-s,-o),c=Ht._rescaleAndSwap(this.#a,n,i,-s,-o);break}return{outline:Array.from(l),points:[Array.from(c)]}}#o(e){const t=this.#s;let n=t[4],i=t[5];const a=[n,i,n,i];let s=n,o=i;const l=e?Math.max:Math.min;for(let u=6,h=t.length;u<h;u+=6){const d=t[u+4],f=t[u+5];if(isNaN(t[u]))nr.pointBoundingBox(d,f,a),o<f?(s=d,o=f):o===f&&(s=l(s,d));else{const p=[1/0,1/0,-1/0,-1/0];nr.bezierBoundingBox(n,i,...t.slice(u,u+6),p),nr.rectBoundingBox(...p,a),o<p[3]?(s=p[2],o=p[3]):o===p[3]&&(s=l(s,p[2]))}n=d,i=f}const c=this.#t;c[0]=a[0]-this.#r,c[1]=a[1]-this.#r,c[2]=a[2]-a[0]+2*this.#r,c[3]=a[3]-a[1]+2*this.#r,this.lastPoint=[s,o]}get box(){return this.#t}newOutliner(e,t,n,i,a,s=0){return new Vl(e,t,n,i,a,s)}getNewOutline(e,t){const[n,i,a,s]=this.#t,[o,l,c,u]=this.#e,h=a*c,d=s*u,f=n*c+o,p=i*u+l,m=this.newOutliner({x:this.#a[0]*h+f,y:this.#a[1]*d+p},this.#e,this.#i,e,this.#n,t??this.#r);for(let y=2;y<this.#a.length;y+=2)m.add({x:this.#a[y]*h+f,y:this.#a[y+1]*d+p});return m.getOutlines()}}class H2{#e;#t;#r=[];#n=[];constructor(e,t=0,n=0,i=!0){const a=[1/0,1/0,-1/0,-1/0],s=10**-4;for(const{x:f,y:p,width:m,height:y}of e){const v=Math.floor((f-t)/s)*s,x=Math.ceil((f+m+t)/s)*s,S=Math.floor((p-t)/s)*s,A=Math.ceil((p+y+t)/s)*s,C=[v,S,A,!0],k=[x,S,A,!1];this.#r.push(C,k),nr.rectBoundingBox(v,S,x,A,a)}const o=a[2]-a[0]+2*n,l=a[3]-a[1]+2*n,c=a[0]-n,u=a[1]-n,h=this.#r.at(i?-1:-2),d=[h[0],h[2]];for(const f of this.#r){const[p,m,y]=f;f[0]=(p-c)/o,f[1]=(m-u)/l,f[2]=(y-u)/l}this.#e=new Float32Array([c,u,o,l]),this.#t=d}getOutlines(){this.#r.sort((t,n)=>t[0]-n[0]||t[1]-n[1]||t[2]-n[2]);const e=[];for(const t of this.#r)t[3]?(e.push(...this.#l(t)),this.#s(t)):(this.#o(t),e.push(...this.#l(t)));return this.#a(e)}#a(e){const t=[],n=new Set;for(const s of e){const[o,l,c]=s;t.push([o,l,s],[o,c,s])}t.sort((s,o)=>s[1]-o[1]||s[0]-o[0]);for(let s=0,o=t.length;s<o;s+=2){const l=t[s][2],c=t[s+1][2];l.push(c),c.push(l),n.add(l),n.add(c)}const i=[];let a;for(;n.size>0;){const s=n.values().next().value;let[o,l,c,u,h]=s;n.delete(s);let d=o,f=l;for(a=[o,c],i.push(a);;){let p;if(n.has(u))p=u;else if(n.has(h))p=h;else break;n.delete(p),[o,l,c,u,h]=p,d!==o&&(a.push(d,f,o,f===l?l:c),d=o),f=f===l?c:l}a.push(d,f)}return new HF(i,this.#e,this.#t)}#i(e){const t=this.#n;let n=0,i=t.length-1;for(;n<=i;){const a=n+i>>1,s=t[a][0];if(s===e)return a;s<e?n=a+1:i=a-1}return i+1}#s([,e,t]){const n=this.#i(e);this.#n.splice(n,0,[e,t])}#o([,e,t]){const n=this.#i(e);for(let i=n;i<this.#n.length;i++){const[a,s]=this.#n[i];if(a!==e)break;if(a===e&&s===t){this.#n.splice(i,1);return}}for(let i=n-1;i>=0;i--){const[a,s]=this.#n[i];if(a!==e)break;if(a===e&&s===t){this.#n.splice(i,1);return}}}#l(e){const[t,n,i]=e,a=[[t,n,i]],s=this.#i(i);for(let o=0;o<s;o++){const[l,c]=this.#n[o];for(let u=0,h=a.length;u<h;u++){const[,d,f]=a[u];if(!(c<=d||f<=l)){if(d>=l){if(f>c)a[u][1]=c;else{if(h===1)return[];a.splice(u,1),u--,h--}continue}a[u][2]=l,f>c&&a.push([t,c,f])}}}return a}}class HF extends Ht{#e;#t;constructor(e,t,n){super(),this.#t=e,this.#e=t,this.lastPoint=n}toSVGPath(){const e=[];for(const t of this.#t){let[n,i]=t;e.push(`M${n} ${i}`);for(let a=2;a<t.length;a+=2){const s=t[a],o=t[a+1];s===n?(e.push(`V${o}`),i=o):o===i&&(e.push(`H${s}`),n=s)}e.push("Z")}return e.join(" ")}serialize([e,t,n,i],a){const s=[],o=n-e,l=i-t;for(const c of this.#t){const u=new Array(c.length);for(let h=0;h<c.length;h+=2)u[h]=e+c[h]*o,u[h+1]=i-c[h+1]*l;s.push(u)}return s}get box(){return this.#e}get classNamesForOutlining(){return["highlightOutline"]}}class q2 extends Vl{newFreeDrawOutline(e,t,n,i,a,s){return new qF(e,t,n,i,a,s)}}class qF extends By{newOutliner(e,t,n,i,a,s=0){return new q2(e,t,n,i,a,s)}}class jn extends or{#e=null;#t=0;#r;#n=null;#a=null;#i=null;#s=null;#o=0;#l=null;#c=null;#h=null;#u=!1;#g=null;#p;#f=null;#d="";#m;#y="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=xr.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const e=jn.prototype;return jr(this,"_keyboardManager",new Ph([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:"highlightEditor"}),this.color=e.color||jn._defaultColor,this.#m=e.thickness||jn._defaultThickness,this.#p=e.opacity||jn._defaultOpacity,this.#r=e.boxes||null,this.#y=e.methodOfCreation||"",this.#d=e.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(this.#u=!0,this.#w(e),this.#A()):this.#r&&(this.#e=e.anchorNode,this.#t=e.anchorOffset,this.#s=e.focusNode,this.#o=e.focusOffset,this.#b(),this.#A(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:this.#u?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#m,methodOfCreation:this.#y}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}get commentColor(){return this.color}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}#b(){const e=new H2(this.#r,.001);this.#c=e.getOutlines(),[this.x,this.y,this.width,this.height]=this.#c.box;const t=new H2(this.#r,.0025,.001,this._uiManager.direction==="ltr");this.#i=t.getOutlines();const{lastPoint:n}=this.#i;this.#g=[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height]}#w({highlightOutlines:e,highlightId:t,clipPathId:n}){this.#c=e;const i=1.5;if(this.#i=e.getNewOutline(this.#m/2+i,.0025),t>=0)this.#h=t,this.#n=n,this.parent.drawLayer.finalizeDraw(t,{bbox:e.box,path:{d:e.toSVGPath()}}),this.#f=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#i.box,path:{d:this.#i.toSVGPath()}},!0);else if(this.parent){const u=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#h,{bbox:jn.#M(this.#c.box,(u-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#f,{bbox:jn.#M(this.#i.box,u),path:{d:this.#i.toSVGPath()}})}const[a,s,o,l]=e.box;switch(this.rotation){case 0:this.x=a,this.y=s,this.width=o,this.height=l;break;case 90:{const[u,h]=this.parentDimensions;this.x=s,this.y=1-a,this.width=o*h/u,this.height=l*u/h;break}case 180:this.x=1-a,this.y=1-s,this.width=o,this.height=l;break;case 270:{const[u,h]=this.parentDimensions;this.x=1-s,this.y=a,this.width=o*h/u,this.height=l*u/h;break}}const{lastPoint:c}=this.#i;this.#g=[(c[0]-a)/o,(c[1]-s)/l]}static initialize(e,t){or.initialize(e,t),jn._defaultColor||=t.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,t){switch(e){case Jr.HIGHLIGHT_COLOR:jn._defaultColor=t;break;case Jr.HIGHLIGHT_THICKNESS:jn._defaultThickness=t;break}}translateInPage(e,t){}get toolbarPosition(){return this.#g}updateParams(e,t){switch(e){case Jr.HIGHLIGHT_COLOR:this.#x(t);break;case Jr.HIGHLIGHT_THICKNESS:this.#v(t);break}}static get defaultPropertiesToUpdate(){return[[Jr.HIGHLIGHT_COLOR,jn._defaultColor],[Jr.HIGHLIGHT_THICKNESS,jn._defaultThickness]]}get propertiesToUpdate(){return[[Jr.HIGHLIGHT_COLOR,this.color||jn._defaultColor],[Jr.HIGHLIGHT_THICKNESS,this.#m||jn._defaultThickness],[Jr.HIGHLIGHT_FREE,this.#u]]}#x(e){const t=(a,s)=>{this.color=a,this.#p=s,this.parent?.drawLayer.updateProperties(this.#h,{root:{fill:a,"fill-opacity":s}}),this.#a?.updateColor(a)},n=this.color,i=this.#p;this.addCommands({cmd:t.bind(this,e,jn._defaultOpacity),undo:t.bind(this,n,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Jr.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(e)},!0)}#v(e){const t=this.#m,n=i=>{this.#m=i,this.#k(i)};this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Jr.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",this.#a=new Da({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#E())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#E())}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this.#C(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#A(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#C():e&&(this.#A(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),t&&this.select()}#k(e){if(!this.#u)return;this.#w({highlightOutlines:this.#c.getNewOutline(e/2)}),this.fixAndSetPosition();const[t,n]=this.parentDimensions;this.setDims(this.width*t,this.height*n)}#C(){this.#h===null||!this.parent||(this.parent.drawLayer.remove(this.#h),this.#h=null,this.parent.drawLayer.remove(this.#f),this.#f=null)}#A(e=this.parent){this.#h===null&&({id:this.#h,clipPathId:this.#n}=e.drawLayer.draw({bbox:this.#c.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.#p},rootClass:{highlight:!0,free:this.#u},path:{d:this.#c.toSVGPath()}},!1,!0),this.#f=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#u},bbox:this.#i.box,path:{d:this.#i.toSVGPath()}},this.#u),this.#l&&(this.#l.style.clipPath=this.#n))}static#M([e,t,n,i],a){switch(a){case 90:return[1-t-i,e,i,n];case 180:return[1-e-n,1-t-i,n,i];case 270:return[t,1-e-n,i,n]}return[e,t,n,i]}rotate(e){const{drawLayer:t}=this.parent;let n;this.#u?(e=(e-this.rotation+360)%360,n=jn.#M(this.#c.box,e)):n=jn.#M([this.x,this.y,this.width,this.height],e),t.updateProperties(this.#h,{bbox:n,root:{"data-main-rotation":e}}),t.updateProperties(this.#f,{bbox:jn.#M(this.#i.box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;const e=super.render();this.#d&&(e.setAttribute("aria-label",this.#d),e.setAttribute("role","mark")),this.#u?e.classList.add("free"):this.div.addEventListener("keydown",this.#I.bind(this),{signal:this._uiManager._signal});const t=this.#l=document.createElement("div");e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal",t.style.clipPath=this.#n;const[n,i]=this.parentDimensions;return this.setDims(this.width*n,this.height*i),Q6(this,this.#l,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#f,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#f,{rootClass:{hovered:!1}})}#I(e){jn._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#T(!0);break;case 1:case 3:this.#T(!1);break}}#T(e){if(!this.#e)return;const t=window.getSelection();e?t.setPosition(this.#e,this.#t):t.setPosition(this.#s,this.#o)}select(){super.select(),this.#f&&this.parent?.drawLayer.updateProperties(this.#f,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#f&&(this.parent?.drawLayer.updateProperties(this.#f,{rootClass:{selected:!1}}),this.#u||this.#T(!1))}get _mustFixPosition(){return!this.#u}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#h,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#f,{rootClass:{hidden:!e}}))}#E(){return this.#u?this.rotation:0}#N(){if(this.#u)return null;const[e,t]=this.pageDimensions,[n,i]=this.pageTranslation,a=this.#r,s=new Float32Array(a.length*8);let o=0;for(const{x:l,y:c,width:u,height:h}of a){const d=l*e+n,f=(1-c)*t+i;s[o]=s[o+4]=d,s[o+1]=s[o+3]=f,s[o+2]=s[o+6]=d+u*e,s[o+5]=s[o+7]=f-h*t,o+=8}return s}#L(e){return this.#c.serialize(e,this.#E())}static startHighlighting(e,t,{target:n,x:i,y:a}){const{x:s,y:o,width:l,height:c}=n.getBoundingClientRect(),u=new AbortController,h=e.combinedSignal(u),d=f=>{u.abort(),this.#j(e,f)};window.addEventListener("blur",d,{signal:h}),window.addEventListener("pointerup",d,{signal:h}),window.addEventListener("pointerdown",Xn,{capture:!0,passive:!1,signal:h}),window.addEventListener("contextmenu",Pa,{signal:h}),n.addEventListener("pointermove",this.#R.bind(this,e),{signal:h}),this._freeHighlight=new q2({x:i,y:a},[s,o,l,c],e.scale,this._defaultThickness/2,t,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static#R(e,t){this._freeHighlight.add(t)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#j(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(e,t,n){let i=null;if(e instanceof Dy){const{data:{quadPoints:p,rect:m,rotation:y,id:v,color:x,opacity:S,popupRef:A,contentsObj:C},parent:{page:{pageNumber:k}}}=e;i=e={annotationType:xr.HIGHLIGHT,color:Array.from(x),opacity:S,quadPoints:p,boxes:null,pageIndex:k-1,rect:m.slice(0),rotation:y,annotationElementId:v,id:v,deleted:!1,popupRef:A,comment:C?.str||null}}else if(e instanceof z2){const{data:{inkLists:p,rect:m,rotation:y,id:v,color:x,borderStyle:{rawWidth:S},popupRef:A,contentsObj:C},parent:{page:{pageNumber:k}}}=e;i=e={annotationType:xr.HIGHLIGHT,color:Array.from(x),thickness:S,inkLists:p,boxes:null,pageIndex:k-1,rect:m.slice(0),rotation:y,annotationElementId:v,id:v,deleted:!1,popupRef:A,comment:C?.str||null}}const{color:a,quadPoints:s,inkLists:o,opacity:l}=e,c=await super.deserialize(e,t,n);c.color=nr.makeHexColor(...a),c.#p=l||1,o&&(c.#m=e.thickness),c._initialData=i,e.comment&&c.setCommentData(e.comment);const[u,h]=c.pageDimensions,[d,f]=c.pageTranslation;if(s){const p=c.#r=[];for(let m=0;m<s.length;m+=8)p.push({x:(s[m]-d)/u,y:1-(s[m+1]-f)/h,width:(s[m+2]-s[m])/u,height:(s[m+1]-s[m+5])/h});c.#b(),c.#A(),c.rotate(c.rotation)}else if(o){c.#u=!0;const p=o[0],m={x:p[0]-d,y:h-(p[1]-f)},y=new q2(m,[0,0,u,h],1,c.#m/2,!0,.001);for(let S=0,A=p.length;S<A;S+=2)m.x=p[S]-d,m.y=h-(p[S+1]-f),y.add(m);const{id:v,clipPathId:x}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:c.color,"fill-opacity":c._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:y.toSVGPath()}},!0,!0);c.#w({highlightOutlines:y.getOutlines(),highlightId:v,clipPathId:x}),c.#A(),c.rotate(c.parentRotation)}return c}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const t=this.getRect(0,0),n=or._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i={annotationType:xr.HIGHLIGHT,color:n,opacity:this.#p,thickness:this.#m,quadPoints:this.#N(),outlines:this.#L(t),pageIndex:this.pageIndex,rect:t,rotation:this.#E(),structTreeParentId:this._structTreeParentId};return this.addComment(i),this.annotationElementId&&!this.#_(i)?null:(i.id=this.annotationElementId,i)}#_(e){const{color:t}=this._initialData;return this.hasEditedComment||e.color.some((n,i)=>n!==t[i])}renderAnnotationElement(e){const t={rect:this.getRect(0,0)};return this.hasEditedComment&&(t.popup=this.comment),e.updateEdited(t),null}static canCreateNewEmptyEditor(){return!1}}class Uy{#e=Object.create(null);updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(const[t,n]of Object.entries(e))t.startsWith("_")||this.updateProperty(t,n)}updateSVGProperty(e,t){this.#e[e]=t}toSVGProperties(){const e=this.#e;return this.#e=Object.create(null),{root:e}}reset(){this.#e=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){pn("Not implemented")}}class dr extends or{#e=null;#t;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#r=null;static#n=null;static#a=null;static#i=NaN;static#s=null;static#o=null;static#l=NaN;static _INNER_MARGIN=3;constructor(e){super(e),this.#t=e.mustBeCommitted||!1,this._addOutlines(e)}_addOutlines(e){e.drawOutlines&&(this.#c(e),this.#g())}#c({drawOutlines:e,drawId:t,drawingOptions:n}){this.#e=e,this._drawingOptions||=n,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),t>=0?(this._drawId=t,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties)):this._drawId=this.#h(e,this.parent),this.#d(e.box)}#h(e,t){const{id:n}=t.drawLayer.draw(dr._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return n}static _mergeSVGProperties(e,t){const n=new Set(Object.keys(e));for(const[i,a]of Object.entries(t))n.has(i)?Object.assign(e[i],a):e[i]=a;return e}static getDefaultDrawingOptions(e){pn("Not implemented")}static get typesMap(){pn("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,t){const n=this.typesMap.get(e);n&&this._defaultDrawingOptions.updateProperty(n,t),this._currentParent&&(dr.#r.updateProperty(n,t),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,t){const n=this.constructor.typesMap.get(e);n&&this._updateProperty(e,n,t)}static get defaultPropertiesToUpdate(){const e=[],t=this._defaultDrawingOptions;for(const[n,i]of this.typesMap)e.push([n,t[i]]);return e}get propertiesToUpdate(){const e=[],{_drawingOptions:t}=this;for(const[n,i]of this.constructor.typesMap)e.push([n,t[i]]);return e}_updateProperty(e,t,n){const i=this._drawingOptions,a=i[t],s=o=>{i.updateProperty(t,o);const l=this.#e.updateProperty(t,o);l&&this.#d(l),this.parent?.drawLayer.updateProperties(this._drawId,i.toSVGProperties()),e===this.colorType&&this._colorPicker?.update(o)};this.addCommands({cmd:s.bind(this,n),undo:s.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,dr._mergeSVGProperties(this.#e.getPathResizingSVGProperties(this.#f()),{bbox:this.#m()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,dr._mergeSVGProperties(this.#e.getPathResizedSVGProperties(this.#f()),{bbox:this.#m()}))}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#m()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,dr._mergeSVGProperties(this.#e.getPathTranslatedSVGProperties(this.#f(),this.parentDimensions),{bbox:this.#m()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#t&&(this.#t=!1,this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){this.#u(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#g(),this.#d(this.#e.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#u()):e&&(this._uiManager.addShouldRescale(this),this.#g(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),t&&this.select()}#u(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#g(e=this.parent){if(!(this._drawId!==null&&this.parent===e)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,e.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=this.#h(this.#e,e)}}#p([e,t,n,i]){const{parentDimensions:[a,s],rotation:o}=this;switch(o){case 90:return[t,1-e,n*(s/a),i*(a/s)];case 180:return[1-e,1-t,n,i];case 270:return[1-t,e,n*(s/a),i*(a/s)];default:return[e,t,n,i]}}#f(){const{x:e,y:t,width:n,height:i,parentDimensions:[a,s],rotation:o}=this;switch(o){case 90:return[1-t,e,n*(a/s),i*(s/a)];case 180:return[1-e,1-t,n,i];case 270:return[t,1-e,n*(a/s),i*(s/a)];default:return[e,t,n,i]}}#d(e){if([this.x,this.y,this.width,this.height]=this.#p(e),this.div){this.fixAndSetPosition();const[t,n]=this.parentDimensions;this.setDims(this.width*t,this.height*n)}this._onResized()}#m(){const{x:e,y:t,width:n,height:i,rotation:a,parentRotation:s,parentDimensions:[o,l]}=this;switch((a*4+s)/90){case 1:return[1-t-i,e,i,n];case 2:return[1-e-n,1-t-i,n,i];case 3:return[t,1-e-n,i,n];case 4:return[e,t-n*(o/l),i*(l/o),n*(o/l)];case 5:return[1-t,e,n*(o/l),i*(l/o)];case 6:return[1-e-i*(l/o),1-t,i*(l/o),n*(o/l)];case 7:return[t-n*(o/l),1-e-i*(l/o),n*(o/l),i*(l/o)];case 8:return[e-n,t-i,n,i];case 9:return[1-t,e-n,i,n];case 10:return[1-e,1-t,n,i];case 11:return[t-i,1-e,i,n];case 12:return[e-i*(l/o),t,i*(l/o),n*(o/l)];case 13:return[1-t-n*(o/l),e-i*(l/o),n*(o/l),i*(l/o)];case 14:return[1-e,1-t-n*(o/l),i*(l/o),n*(o/l)];case 15:return[t,1-e,n*(o/l),i*(l/o)];default:return[e,t,n,i]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,dr._mergeSVGProperties({bbox:this.#m()},this.#e.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#d(this.#e.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,t;this._isCopy&&(e=this.x,t=this.y);const n=super.render();n.classList.add("draw");const i=document.createElement("div");n.append(i),i.setAttribute("aria-hidden","true"),i.className="internal";const[a,s]=this.parentDimensions;return this.setDims(this.width*a,this.height*s),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,t),n}static createDrawerInstance(e,t,n,i,a){pn("Not implemented")}static startDrawing(e,t,n,i){const{target:a,offsetX:s,offsetY:o,pointerId:l,pointerType:c}=i;if(dr.#s&&dr.#s!==c)return;const{viewport:{rotation:u}}=e,{width:h,height:d}=a.getBoundingClientRect(),f=dr.#n=new AbortController,p=e.combinedSignal(f);if(dr.#i||=l,dr.#s??=c,window.addEventListener("pointerup",m=>{dr.#i===m.pointerId?this._endDraw(m):dr.#o?.delete(m.pointerId)},{signal:p}),window.addEventListener("pointercancel",m=>{dr.#i===m.pointerId?this._currentParent.endDrawingSession():dr.#o?.delete(m.pointerId)},{signal:p}),window.addEventListener("pointerdown",m=>{dr.#s===m.pointerType&&((dr.#o||=new Set).add(m.pointerId),dr.#r.isCancellable()&&(dr.#r.removeLastElement(),dr.#r.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:p}),window.addEventListener("contextmenu",Pa,{signal:p}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:p}),a.addEventListener("touchmove",m=>{m.timeStamp===dr.#l&&Xn(m)},{signal:p}),e.toggleDrawing(),t._editorUndoBar?.hide(),dr.#r){e.drawLayer.updateProperties(this._currentDrawId,dr.#r.startNew(s,o,h,d,u));return}t.updateUIForDefaultProperties(this),dr.#r=this.createDrawerInstance(s,o,h,d,u),dr.#a=this.getDefaultDrawingOptions(),this._currentParent=e,{id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(dr.#a.toSVGProperties(),dr.#r.defaultSVGProperties),!0,!1)}static _drawMove(e){if(dr.#l=-1,!dr.#r)return;const{offsetX:t,offsetY:n,pointerId:i}=e;if(dr.#i===i){if(dr.#o?.size>=1){this._endDraw(e);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,dr.#r.add(t,n)),dr.#l=e.timeStamp,Xn(e)}}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,dr.#r=null,dr.#a=null,dr.#s=null,dr.#l=NaN),dr.#n&&(dr.#n.abort(),dr.#n=null,dr.#i=NaN,dr.#o=null)}static _endDraw(e){const t=this._currentParent;if(t){if(t.toggleDrawing(!0),this._cleanup(!1),e?.target===t.div&&t.drawLayer.updateProperties(this._currentDrawId,dr.#r.end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){const n=dr.#r,i=this._currentDrawId,a=n.getLastElement();t.addCommands({cmd:()=>{t.drawLayer.updateProperties(i,n.setLastElement(a))},undo:()=>{t.drawLayer.updateProperties(i,n.removeLastElement())},mustExec:!1,type:Jr.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(e){const t=this._currentParent;if(!t)return null;if(t.toggleDrawing(!0),t.cleanUndoStack(Jr.DRAW_STEP),!dr.#r.isEmpty()){const{pageDimensions:[n,i],scale:a}=t,s=t.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:dr.#r.getOutlines(n*a,i*a,a,this._INNER_MARGIN),drawingOptions:dr.#a,mustBeCommitted:!e});return this._cleanup(!0),s}return t.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,t,n,i,a,s){pn("Not implemented")}static async deserialize(e,t,n){const{rawDims:{pageWidth:i,pageHeight:a,pageX:s,pageY:o}}=t.viewport,l=this.deserializeDraw(s,o,i,a,this._INNER_MARGIN,e),c=await super.deserialize(e,t,n);return c.createDrawingOptions(e),c.#c({drawOutlines:l}),c.#g(),c.onScaleChanging(),c.rotate(),c}serializeDraw(e){const[t,n]=this.pageTranslation,[i,a]=this.pageDimensions;return this.#e.serialize([t,n,i,a],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class GF{#e=new Float64Array(6);#t;#r;#n;#a;#i;#s="";#o=0;#l=new qh;#c;#h;constructor(e,t,n,i,a,s){this.#c=n,this.#h=i,this.#n=a,this.#a=s,[e,t]=this.#u(e,t);const o=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#i=[e,t],this.#r=[{line:o,points:this.#i}],this.#e.set(o,0)}updateProperty(e,t){e==="stroke-width"&&(this.#a=t)}#u(e,t){return Ht._normalizePoint(e,t,this.#c,this.#h,this.#n)}isEmpty(){return!this.#r||this.#r.length===0}isCancellable(){return this.#i.length<=10}add(e,t){[e,t]=this.#u(e,t);const[n,i,a,s]=this.#e.subarray(2,6),o=e-a,l=t-s;return Math.hypot(this.#c*o,this.#h*l)<=2?null:(this.#i.push(e,t),isNaN(n)?(this.#e.set([a,s,e,t],2),this.#t.push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(this.#e[0])&&this.#t.splice(6,6),this.#e.set([n,i,a,s,e,t],0),this.#t.push(...Ht.createBezierPoints(n,i,a,s,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){const n=this.add(e,t);return n||(this.#i.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,n,i,a){this.#c=n,this.#h=i,this.#n=a,[e,t]=this.#u(e,t);const s=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#i=[e,t];const o=this.#r.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#r.push({line:s,points:this.#i}),this.#e.set(s,0),this.#o=0,this.toSVGPath(),null}getLastElement(){return this.#r.at(-1)}setLastElement(e){return this.#r?(this.#r.push(e),this.#t=e.line,this.#i=e.points,this.#o=0,{path:{d:this.toSVGPath()}}):this.#l.setLastElement(e)}removeLastElement(){if(!this.#r)return this.#l.removeLastElement();this.#r.pop(),this.#s="";for(let e=0,t=this.#r.length;e<t;e++){const{line:n,points:i}=this.#r[e];this.#t=n,this.#i=i,this.#o=0,this.toSVGPath()}return{path:{d:this.#s}}}toSVGPath(){const e=Ht.svgRound(this.#t[4]),t=Ht.svgRound(this.#t[5]);if(this.#i.length===2)return this.#s=`${this.#s} M ${e} ${t} Z`,this.#s;if(this.#i.length<=6){const i=this.#s.lastIndexOf("M");this.#s=`${this.#s.slice(0,i)} M ${e} ${t}`,this.#o=6}if(this.#i.length===4){const i=Ht.svgRound(this.#t[10]),a=Ht.svgRound(this.#t[11]);return this.#s=`${this.#s} L ${i} ${a}`,this.#o=12,this.#s}const n=[];this.#o===0&&(n.push(`M ${e} ${t}`),this.#o=6);for(let i=this.#o,a=this.#t.length;i<a;i+=6){const[s,o,l,c,u,h]=this.#t.slice(i,i+6).map(Ht.svgRound);n.push(`C${s} ${o} ${l} ${c} ${u} ${h}`)}return this.#s+=n.join(" "),this.#o=this.#t.length,this.#s}getOutlines(e,t,n,i){const a=this.#r.at(-1);return a.line=new Float32Array(a.line),a.points=new Float32Array(a.points),this.#l.build(this.#r,e,t,n,this.#n,this.#a,i),this.#e=null,this.#t=null,this.#r=null,this.#s=null,this.#l}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class qh extends Ht{#e;#t=0;#r;#n;#a;#i;#s;#o;#l;build(e,t,n,i,a,s,o){this.#a=t,this.#i=n,this.#s=i,this.#o=a,this.#l=s,this.#r=o??0,this.#n=e,this.#u()}get thickness(){return this.#l}setLastElement(e){return this.#n.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#n.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const e=[];for(const{line:t}of this.#n){if(e.push(`M${Ht.svgRound(t[4])} ${Ht.svgRound(t[5])}`),t.length===6){e.push("Z");continue}if(t.length===12&&isNaN(t[6])){e.push(`L${Ht.svgRound(t[10])} ${Ht.svgRound(t[11])}`);continue}for(let n=6,i=t.length;n<i;n+=6){const[a,s,o,l,c,u]=t.subarray(n,n+6).map(Ht.svgRound);e.push(`C${a} ${s} ${o} ${l} ${c} ${u}`)}}return e.join("")}serialize([e,t,n,i],a){const s=[],o=[],[l,c,u,h]=this.#h();let d,f,p,m,y,v,x,S,A;switch(this.#o){case 0:A=Ht._rescale,d=e,f=t+i,p=n,m=-i,y=e+l*n,v=t+(1-c-h)*i,x=e+(l+u)*n,S=t+(1-c)*i;break;case 90:A=Ht._rescaleAndSwap,d=e,f=t,p=n,m=i,y=e+c*n,v=t+l*i,x=e+(c+h)*n,S=t+(l+u)*i;break;case 180:A=Ht._rescale,d=e+n,f=t,p=-n,m=i,y=e+(1-l-u)*n,v=t+c*i,x=e+(1-l)*n,S=t+(c+h)*i;break;case 270:A=Ht._rescaleAndSwap,d=e+n,f=t+i,p=-n,m=-i,y=e+(1-c-h)*n,v=t+(1-l-u)*i,x=e+(1-c)*n,S=t+(1-l)*i;break}for(const{line:C,points:k}of this.#n)s.push(A(C,d,f,p,m,a?new Array(C.length):null)),o.push(A(k,d,f,p,m,a?new Array(k.length):null));return{lines:s,points:o,rect:[y,v,x,S]}}static deserialize(e,t,n,i,a,{paths:{lines:s,points:o},rotation:l,thickness:c}){const u=[];let h,d,f,p,m;switch(l){case 0:m=Ht._rescale,h=-e/n,d=t/i+1,f=1/n,p=-1/i;break;case 90:m=Ht._rescaleAndSwap,h=-t/i,d=-e/n,f=1/i,p=1/n;break;case 180:m=Ht._rescale,h=e/n+1,d=-t/i,f=-1/n,p=1/i;break;case 270:m=Ht._rescaleAndSwap,h=t/i+1,d=e/n+1,f=-1/i,p=-1/n;break}if(!s){s=[];for(const v of o){const x=v.length;if(x===2){s.push(new Float32Array([NaN,NaN,NaN,NaN,v[0],v[1]]));continue}if(x===4){s.push(new Float32Array([NaN,NaN,NaN,NaN,v[0],v[1],NaN,NaN,NaN,NaN,v[2],v[3]]));continue}const S=new Float32Array(3*(x-2));s.push(S);let[A,C,k,I]=v.subarray(0,4);S.set([NaN,NaN,NaN,NaN,A,C],0);for(let R=4;R<x;R+=2){const U=v[R],D=v[R+1];S.set(Ht.createBezierPoints(A,C,k,I,U,D),(R-2)*3),[A,C,k,I]=[k,I,U,D]}}}for(let v=0,x=s.length;v<x;v++)u.push({line:m(s[v].map(S=>S??NaN),h,d,f,p),points:m(o[v].map(S=>S??NaN),h,d,f,p)});const y=new this.prototype.constructor;return y.build(u,n,i,1,l,c,a),y}#c(e=this.#l){const t=this.#r+e/2*this.#s;return this.#o%180===0?[t/this.#a,t/this.#i]:[t/this.#i,t/this.#a]}#h(){const[e,t,n,i]=this.#e,[a,s]=this.#c(0);return[e+a,t+s,n-2*a,i-2*s]}#u(){const e=this.#e=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:i}of this.#n){if(i.length<=12){for(let o=4,l=i.length;o<l;o+=6)nr.pointBoundingBox(i[o],i[o+1],e);continue}let a=i[4],s=i[5];for(let o=6,l=i.length;o<l;o+=6){const[c,u,h,d,f,p]=i.subarray(o,o+6);nr.bezierBoundingBox(a,s,c,u,h,d,f,p,e),a=f,s=p}}const[t,n]=this.#c();e[0]=Li(e[0]-t,0,1),e[1]=Li(e[1]-n,0,1),e[2]=Li(e[2]+t,0,1),e[3]=Li(e[3]+n,0,1),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#e}updateProperty(e,t){return e==="stroke-width"?this.#g(t):null}#g(e){const[t,n]=this.#c();this.#l=e;const[i,a]=this.#c(),[s,o]=[i-t,a-n],l=this.#e;return l[0]-=s,l[1]-=o,l[2]+=2*s,l[3]+=2*o,l}updateParentDimensions([e,t],n){const[i,a]=this.#c();this.#a=e,this.#i=t,this.#s=n;const[s,o]=this.#c(),l=s-i,c=o-a,u=this.#e;return u[0]-=l,u[1]-=c,u[2]+=2*l,u[3]+=2*c,u}updateRotation(e){return this.#t=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#e.map(Ht.svgRound).join(" ")}get defaultProperties(){const[e,t]=this.#e;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Ht.svgRound(e)} ${Ht.svgRound(t)}`}}}get rotationTransform(){const[,,e,t]=this.#e;let n=0,i=0,a=0,s=0,o=0,l=0;switch(this.#t){case 90:i=t/e,a=-e/t,o=e;break;case 180:n=-1,s=-1,o=e,l=t;break;case 270:i=-t/e,a=e/t,l=t;break;default:return""}return`matrix(${n} ${i} ${a} ${s} ${Ht.svgRound(o)} ${Ht.svgRound(l)})`}getPathResizingSVGProperties([e,t,n,i]){const[a,s]=this.#c(),[o,l,c,u]=this.#e;if(Math.abs(c-a)<=Ht.PRECISION||Math.abs(u-s)<=Ht.PRECISION){const m=e+n/2-(o+c/2),y=t+i/2-(l+u/2);return{path:{"transform-origin":`${Ht.svgRound(e)} ${Ht.svgRound(t)}`,transform:`${this.rotationTransform} translate(${m} ${y})`}}}const h=(n-2*a)/(c-2*a),d=(i-2*s)/(u-2*s),f=c/n,p=u/i;return{path:{"transform-origin":`${Ht.svgRound(o)} ${Ht.svgRound(l)}`,transform:`${this.rotationTransform} scale(${f} ${p}) translate(${Ht.svgRound(a)} ${Ht.svgRound(s)}) scale(${h} ${d}) translate(${Ht.svgRound(-a)} ${Ht.svgRound(-s)})`}}}getPathResizedSVGProperties([e,t,n,i]){const[a,s]=this.#c(),o=this.#e,[l,c,u,h]=o;if(o[0]=e,o[1]=t,o[2]=n,o[3]=i,Math.abs(u-a)<=Ht.PRECISION||Math.abs(h-s)<=Ht.PRECISION){const y=e+n/2-(l+u/2),v=t+i/2-(c+h/2);for(const{line:x,points:S}of this.#n)Ht._translate(x,y,v,x),Ht._translate(S,y,v,S);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Ht.svgRound(e)} ${Ht.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const d=(n-2*a)/(u-2*a),f=(i-2*s)/(h-2*s),p=-d*(l+a)+e+a,m=-f*(c+s)+t+s;if(d!==1||f!==1||p!==0||m!==0)for(const{line:y,points:v}of this.#n)Ht._rescale(y,p,m,d,f,y),Ht._rescale(v,p,m,d,f,v);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Ht.svgRound(e)} ${Ht.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],n){const[i,a]=n,s=this.#e,o=e-s[0],l=t-s[1];if(this.#a===i&&this.#i===a)for(const{line:c,points:u}of this.#n)Ht._translate(c,o,l,c),Ht._translate(u,o,l,u);else{const c=this.#a/i,u=this.#i/a;this.#a=i,this.#i=a;for(const{line:h,points:d}of this.#n)Ht._rescale(h,o,l,c,u,h),Ht._rescale(d,o,l,c,u,d);s[2]*=c,s[3]*=u}return s[0]=e,s[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${Ht.svgRound(e)} ${Ht.svgRound(t)}`}}}get defaultSVGProperties(){const e=this.#e;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${Ht.svgRound(e[0])} ${Ht.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}}class yf extends Uy{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:or._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,t){e==="stroke-width"&&(t??=this["stroke-width"],t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){const e=new yf(this._viewParameters);return e.updateAll(this),e}}class G2 extends dr{static _type="ink";static _editorType=xr.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,t){or.initialize(e,t),this._defaultDrawingOptions=new yf(t.viewParameters)}static getDefaultDrawingOptions(e){const t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return jr(this,"typesMap",new Map([[Jr.INK_THICKNESS,"stroke-width"],[Jr.INK_COLOR,"stroke"],[Jr.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,t,n,i,a){return new GF(e,t,n,i,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,t,n,i,a,s){return qh.deserialize(e,t,n,i,a,s)}static async deserialize(e,t,n){let i=null;if(e instanceof z2){const{data:{inkLists:s,rect:o,rotation:l,id:c,color:u,opacity:h,borderStyle:{rawWidth:d},popupRef:f,contentsObj:p},parent:{page:{pageNumber:m}}}=e;i=e={annotationType:xr.INK,color:Array.from(u),thickness:d,opacity:h,paths:{points:s},boxes:null,pageIndex:m-1,rect:o.slice(0),rotation:l,annotationElementId:c,id:c,deleted:!1,popupRef:f,comment:p?.str||null}}const a=await super.deserialize(e,t,n);return a._initialData=i,e.comment&&a.setCommentData(e.comment),a}get toolbarButtons(){return this._colorPicker||=new jh(this),[["colorPicker",this._colorPicker]]}get colorType(){return Jr.INK_COLOR}get colorValue(){return this._drawingOptions.stroke}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:e,_drawingOptions:t,parent:n}=this;t.updateSVGProperty("stroke-width"),n.drawLayer.updateProperties(e,t.toSVGProperties())}static onScaleChangingWhenDrawing(){const e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:t,opacity:n}){this._drawingOptions=G2.getDefaultDrawingOptions({stroke:nr.makeHexColor(...e),"stroke-width":t,"stroke-opacity":n})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:t,points:n,rect:i}=this.serializeDraw(e),{_drawingOptions:{stroke:a,"stroke-opacity":s,"stroke-width":o}}=this,l={annotationType:xr.INK,color:or._colorManager.convert(a),opacity:s,thickness:o,paths:{lines:t,points:n},pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(l),e?(l.isCopy=!0,l):this.annotationElementId&&!this.#e(l)?null:(l.id=this.annotationElementId,l)}#e(e){const{color:t,thickness:n,opacity:i,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((s,o)=>s!==t[o])||e.thickness!==n||e.opacity!==i||e.pageIndex!==a}renderAnnotationElement(e){const{points:t,rect:n}=this.serializeDraw(!1),i={rect:n,thickness:this._drawingOptions["stroke-width"],points:t};return this.hasEditedComment&&(i.popup=this.comment),e.updateEdited(i),null}}class W2 extends qh{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}}const wf=8,Gh=3;class lu{static#e={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#t(e,t,n,i){return n-=e,i-=t,n===0?i>0?0:4:n===1?i+6:2-i}static#r=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#n(e,t,n,i,a,s,o){const l=this.#t(n,i,a,s);for(let c=0;c<8;c++){const u=(-c+l-o+16)%8,h=this.#r[2*u],d=this.#r[2*u+1];if(e[(n+h)*t+(i+d)]!==0)return u}return-1}static#a(e,t,n,i,a,s,o){const l=this.#t(n,i,a,s);for(let c=0;c<8;c++){const u=(c+l+o+16)%8,h=this.#r[2*u],d=this.#r[2*u+1];if(e[(n+h)*t+(i+d)]!==0)return u}return-1}static#i(e,t,n,i){const a=e.length,s=new Int32Array(a);for(let u=0;u<a;u++)s[u]=e[u]<=i?1:0;for(let u=1;u<n-1;u++)s[u*t]=s[u*t+t-1]=0;for(let u=0;u<t;u++)s[u]=s[t*n-1-u]=0;let o=1,l;const c=[];for(let u=1;u<n-1;u++){l=1;for(let h=1;h<t-1;h++){const d=u*t+h,f=s[d];if(f===0)continue;let p=u,m=h;if(f===1&&s[d-1]===0)o+=1,m-=1;else if(f>=1&&s[d+1]===0)o+=1,m+=1,f>1&&(l=f);else{f!==1&&(l=Math.abs(f));continue}const y=[h,u],v=m===h+1,x={isHole:v,points:y,id:o,parent:0};c.push(x);let S;for(const $ of c)if($.id===l){S=$;break}S?S.isHole?x.parent=v?S.parent:l:x.parent=v?l:S.parent:x.parent=v?l:0;const A=this.#n(s,t,u,h,p,m,0);if(A===-1){s[d]=-o,s[d]!==1&&(l=Math.abs(s[d]));continue}let C=this.#r[2*A],k=this.#r[2*A+1];const I=u+C,R=h+k;p=I,m=R;let U=u,D=h;for(;;){const $=this.#a(s,t,U,D,p,m,1);C=this.#r[2*$],k=this.#r[2*$+1];const H=U+C,V=D+k;y.push(V,H);const z=U*t+D;if(s[z+1]===0?s[z]=-o:s[z]===1&&(s[z]=o),H===u&&V===h&&U===I&&D===R){s[d]!==1&&(l=Math.abs(s[d]));break}else p=U,m=D,U=H,D=V}}}return c}static#s(e,t,n,i){if(n-t<=4){for(let I=t;I<n-2;I+=2)i.push(e[I],e[I+1]);return}const a=e[t],s=e[t+1],o=e[n-4]-a,l=e[n-3]-s,c=Math.hypot(o,l),u=o/c,h=l/c,d=u*s-h*a,f=l/o,p=1/c,m=Math.atan(f),y=Math.cos(m),v=Math.sin(m),x=p*(Math.abs(y)+Math.abs(v)),S=p*(1-x+x**2),A=Math.max(Math.atan(Math.abs(v+y)*S),Math.atan(Math.abs(v-y)*S));let C=0,k=t;for(let I=t+2;I<n-2;I+=2){const R=Math.abs(d-u*e[I+1]+h*e[I]);R>C&&(k=I,C=R)}C>(c*A)**2?(this.#s(e,t,k+2,i),this.#s(e,k,n,i)):i.push(a,s)}static#o(e){const t=[],n=e.length;return this.#s(e,0,n,t),t.push(e[n-2],e[n-1]),t.length<=4?null:t}static#l(e,t,n,i,a,s){const o=new Float32Array(s**2),l=-2*i**2,c=s>>1;for(let m=0;m<s;m++){const y=(m-c)**2;for(let v=0;v<s;v++)o[m*s+v]=Math.exp((y+(v-c)**2)/l)}const u=new Float32Array(256),h=-2*a**2;for(let m=0;m<256;m++)u[m]=Math.exp(m**2/h);const d=e.length,f=new Uint8Array(d),p=new Uint32Array(256);for(let m=0;m<n;m++)for(let y=0;y<t;y++){const v=m*t+y,x=e[v];let S=0,A=0;for(let k=0;k<s;k++){const I=m+k-c;if(!(I<0||I>=n))for(let R=0;R<s;R++){const U=y+R-c;if(U<0||U>=t)continue;const D=e[I*t+U],$=o[k*s+R]*u[Math.abs(D-x)];S+=D*$,A+=$}}const C=f[v]=Math.round(S/A);p[C]++}return[f,p]}static#c(e){const t=new Uint32Array(256);for(const n of e)t[n]++;return t}static#h(e){const t=e.length,n=new Uint8ClampedArray(t>>2);let i=-1/0,a=1/0;for(let o=0,l=n.length;o<l;o++){const c=n[o]=e[o<<2];i=Math.max(i,c),a=Math.min(a,c)}const s=255/(i-a);for(let o=0,l=n.length;o<l;o++)n[o]=(n[o]-a)*s;return n}static#u(e){let t,n=-1/0,i=-1/0;const a=e.findIndex(l=>l!==0);let s=a,o=a;for(t=a;t<256;t++){const l=e[t];l>n&&(t-s>i&&(i=t-s,o=t-1),n=l,s=t)}for(t=o-1;t>=0&&!(e[t]>e[t+1]);t--);return t}static#g(e){const t=e,{width:n,height:i}=e,{maxDim:a}=this.#e;let s=n,o=i;if(n>a||i>a){let d=n,f=i,p=Math.log2(Math.max(n,i)/a);const m=Math.floor(p);p=p===m?m-1:m;for(let v=0;v<p;v++){s=Math.ceil(d/2),o=Math.ceil(f/2);const x=new OffscreenCanvas(s,o);x.getContext("2d").drawImage(e,0,0,d,f,0,0,s,o),d=s,f=o,e!==t&&e.close(),e=x.transferToImageBitmap()}const y=Math.min(a/s,a/o);s=Math.round(s*y),o=Math.round(o*y)}const c=new OffscreenCanvas(s,o).getContext("2d",{willReadFrequently:!0});c.fillStyle="white",c.fillRect(0,0,s,o),c.filter="grayscale(1)",c.drawImage(e,0,0,e.width,e.height,0,0,s,o);const u=c.getImageData(0,0,s,o).data;return[this.#h(u),s,o]}static extractContoursFromText(e,{fontFamily:t,fontStyle:n,fontWeight:i},a,s,o,l){let c=new OffscreenCanvas(1,1),u=c.getContext("2d",{alpha:!1});const h=200,d=u.font=`${n} ${i} ${h}px ${t}`,{actualBoundingBoxLeft:f,actualBoundingBoxRight:p,actualBoundingBoxAscent:m,actualBoundingBoxDescent:y,fontBoundingBoxAscent:v,fontBoundingBoxDescent:x,width:S}=u.measureText(e),A=1.5,C=Math.ceil(Math.max(Math.abs(f)+Math.abs(p)||0,S)*A),k=Math.ceil(Math.max(Math.abs(m)+Math.abs(y)||h,Math.abs(v)+Math.abs(x)||h)*A);c=new OffscreenCanvas(C,k),u=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),u.font=d,u.filter="grayscale(1)",u.fillStyle="white",u.fillRect(0,0,C,k),u.fillStyle="black",u.fillText(e,C*(A-1)/2,k*(3-A)/2);const I=this.#h(u.getImageData(0,0,C,k).data),R=this.#c(I),U=this.#u(R),D=this.#i(I,C,k,U);return this.processDrawnLines({lines:{curves:D,width:C,height:k},pageWidth:a,pageHeight:s,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(e,t,n,i,a){const[s,o,l]=this.#g(e),[c,u]=this.#l(s,o,l,Math.hypot(o,l)*this.#e.sigmaSFactor,this.#e.sigmaR,this.#e.kernelSize),h=this.#u(u),d=this.#i(c,o,l,h);return this.processDrawnLines({lines:{curves:d,width:o,height:l},pageWidth:t,pageHeight:n,rotation:i,innerMargin:a,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:n,rotation:i,innerMargin:a,mustSmooth:s,areContours:o}){i%180!==0&&([t,n]=[n,t]);const{curves:l,width:c,height:u}=e,h=e.thickness??0,d=[],f=Math.min(t/c,n/u),p=f/t,m=f/n,y=[];for(const{points:x}of l){const S=s?this.#o(x):x;if(!S)continue;y.push(S);const A=S.length,C=new Float32Array(A),k=new Float32Array(3*(A===2?2:A-2));if(d.push({line:k,points:C}),A===2){C[0]=S[0]*p,C[1]=S[1]*m,k.set([NaN,NaN,NaN,NaN,C[0],C[1]],0);continue}let[I,R,U,D]=S;I*=p,R*=m,U*=p,D*=m,C.set([I,R,U,D],0),k.set([NaN,NaN,NaN,NaN,I,R],0);for(let $=4;$<A;$+=2){const H=C[$]=S[$]*p,V=C[$+1]=S[$+1]*m;k.set(Ht.createBezierPoints(I,R,U,D,H,V),($-2)*3),[I,R,U,D]=[U,D,H,V]}}if(d.length===0)return null;const v=o?new W2:new qh;return v.build(d,t,n,1,i,o?0:h,a),{outline:v,newCurves:y,areContours:o,thickness:h,width:c,height:u}}static async compressSignature({outlines:e,areContours:t,thickness:n,width:i,height:a}){let s=1/0,o=-1/0,l=0;for(const S of e){l+=S.length;for(let A=2,C=S.length;A<C;A++){const k=S[A]-S[A-2];s=Math.min(s,k),o=Math.max(o,k)}}let c;s>=-128&&o<=127?c=Int8Array:s>=-32768&&o<=32767?c=Int16Array:c=Int32Array;const u=e.length,h=wf+Gh*u,d=new Uint32Array(h);let f=0;d[f++]=h*Uint32Array.BYTES_PER_ELEMENT+(l-2*u)*c.BYTES_PER_ELEMENT,d[f++]=0,d[f++]=i,d[f++]=a,d[f++]=t?0:1,d[f++]=Math.max(0,Math.floor(n??0)),d[f++]=u,d[f++]=c.BYTES_PER_ELEMENT;for(const S of e)d[f++]=S.length-2,d[f++]=S[0],d[f++]=S[1];const p=new CompressionStream("deflate-raw"),m=p.writable.getWriter();await m.ready,m.write(d);const y=c.prototype.constructor;for(const S of e){const A=new y(S.length-2);for(let C=2,k=S.length;C<k;C++)A[C-2]=S[C]-S[C-2];m.write(A)}m.close();const v=await new Response(p.readable).arrayBuffer(),x=new Uint8Array(v);return Y6(x)}static async decompressSignature(e){try{const t=fP(e),{readable:n,writable:i}=new DecompressionStream("deflate-raw"),a=i.getWriter();await a.ready,a.write(t).then(async()=>{await a.ready,await a.close()}).catch(()=>{});let s=null,o=0;for await(const S of n)s||=new Uint8Array(new Uint32Array(S.buffer,0,4)[0]),s.set(S,o),o+=S.length;const l=new Uint32Array(s.buffer,0,s.length>>2),c=l[1];if(c!==0)throw new Error(`Invalid version: ${c}`);const u=l[2],h=l[3],d=l[4]===0,f=l[5],p=l[6],m=l[7],y=[],v=(wf+Gh*p)*Uint32Array.BYTES_PER_ELEMENT;let x;switch(m){case Int8Array.BYTES_PER_ELEMENT:x=new Int8Array(s.buffer,v);break;case Int16Array.BYTES_PER_ELEMENT:x=new Int16Array(s.buffer,v);break;case Int32Array.BYTES_PER_ELEMENT:x=new Int32Array(s.buffer,v);break}o=0;for(let S=0;S<p;S++){const A=l[Gh*S+wf],C=new Float32Array(A+2);y.push(C);for(let k=0;k<Gh-1;k++)C[k]=l[Gh*S+wf+k+1];for(let k=0;k<A;k++)C[k+2]=C[k]+x[o++]}return{areContours:d,thickness:f,outlines:y,width:u,height:h}}catch(t){return Sr(`decompressSignature: ${t}`),null}}}class V2 extends Uy{constructor(){super(),super.updateProperties({fill:or._defaultLineColor,"stroke-width":0})}clone(){const e=new V2;return e.updateAll(this),e}}class X2 extends yf{constructor(e){super(e),super.updateProperties({stroke:or._defaultLineColor,"stroke-width":1})}clone(){const e=new X2(this._viewParameters);return e.updateAll(this),e}}class ks extends dr{#e=!1;#t=null;#r=null;#n=null;static _type="signature";static _editorType=xr.SIGNATURE;static _defaultDrawingOptions=null;constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#r=e.signatureData||null,this.#t=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,t){or.initialize(e,t),this._defaultDrawingOptions=new V2,this._defaultDrawnSignatureOptions=new X2(t.viewParameters)}static getDefaultDrawingOptions(e){const t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!1}static get typesMap(){return jr(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#t}}static computeTelemetryFinalData(e){const t=e.get("hasDescription");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let e,t;const{_isCopy:n}=this;if(n&&(this._isCopy=!1,e=this.x,t=this.y),super.render(),this._drawId===null)if(this.#r){const{lines:i,mustSmooth:a,areContours:s,description:o,uuid:l,heightInPage:c}=this.#r,{rawDims:{pageWidth:u,pageHeight:h},rotation:d}=this.parent.viewport,f=lu.processDrawnLines({lines:i,pageWidth:u,pageHeight:h,rotation:d,innerMargin:ks._INNER_MARGIN,mustSmooth:a,areContours:s});this.addSignature(f,c,o,l)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:this.#t||""}));return n&&(this._isCopy=!0,this._moveAfterPaste(e,t)),this.div}setUuid(e){this.#n=e,this.addEditToolbar()}getUuid(){return this.#n}get description(){return this.#t}set description(e){this.#t=e,this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),super.addEditToolbar().then(t=>{t?.updateEditSignatureButton(e)}))}getSignaturePreview(){const{newCurves:e,areContours:t,thickness:n,width:i,height:a}=this.#r,s=Math.max(i,a),o=lu.processDrawnLines({lines:{curves:e.map(l=>({points:l})),thickness:n,width:i,height:a},pageWidth:s,pageHeight:s,rotation:0,innerMargin:0,mustSmooth:!1,areContours:t});return{areContours:t,outline:o.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(e,t,n,i){const{x:a,y:s}=this,{outline:o}=this.#r=e;this.#e=o instanceof W2,this.description=n;let l;this.#e?l=ks.getDefaultDrawingOptions():(l=ks._defaultDrawnSignatureOptions.clone(),l.updateProperties({"stroke-width":o.thickness})),this._addOutlines({drawOutlines:o,drawingOptions:l});const[c,u]=this.parentDimensions,[,h]=this.pageDimensions;let d=t/h;d=d>=1?.5:d,this.width*=d/this.height,this.width>=1&&(d*=.9/this.width,this.width=.9),this.height=d,this.setDims(c*this.width,u*this.height),this.x=a,this.y=s,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(i),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!i,hasDescription:!!n}}),this.div.hidden=!1}getFromImage(e){const{rawDims:{pageWidth:t,pageHeight:n},rotation:i}=this.parent.viewport;return lu.process(e,t,n,i,ks._INNER_MARGIN)}getFromText(e,t){const{rawDims:{pageWidth:n,pageHeight:i},rotation:a}=this.parent.viewport;return lu.extractContoursFromText(e,t,n,i,a,ks._INNER_MARGIN)}getDrawnSignature(e){const{rawDims:{pageWidth:t,pageHeight:n},rotation:i}=this.parent.viewport;return lu.processDrawnLines({lines:e,pageWidth:t,pageHeight:n,rotation:i,innerMargin:ks._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:t}){e?this._drawingOptions=ks.getDefaultDrawingOptions():(this._drawingOptions=ks._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":t}))}serialize(e=!1){if(this.isEmpty())return null;const{lines:t,points:n,rect:i}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":a}}=this,s={annotationType:xr.SIGNATURE,isSignature:!0,areContours:this.#e,color:[0,0,0],thickness:this.#e?0:a,pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(s),e?(s.paths={lines:t,points:n},s.uuid=this.#n,s.isCopy=!0):s.lines=t,this.#t&&(s.accessibilityData={type:"Figure",alt:this.#t}),s}static deserializeDraw(e,t,n,i,a,s){return s.areContours?W2.deserialize(e,t,n,i,a,s):qh.deserialize(e,t,n,i,a,s)}static async deserialize(e,t,n){const i=await super.deserialize(e,t,n);return i.#e=e.areContours,i.description=e.accessibilityData?.alt||"",i.#n=e.uuid,i}}class WF extends or{#e=null;#t=null;#r=null;#n=null;#a=null;#i="";#s=null;#o=!1;#l=null;#c=!1;#h=!1;static _type="stamp";static _editorType=xr.STAMP;constructor(e){super({...e,name:"stampEditor"}),this.#n=e.bitmapUrl,this.#a=e.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(e,t){or.initialize(e,t)}static isHandlingMimeForPasting(e){return S2.includes(e)}static paste(e,t){t.pasteEditor({mode:xr.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){const t=e.get("hasAltText");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#u(e,t=!1){if(!e){this.remove();return}this.#e=e.bitmap,t||(this.#t=e.id,this.#c=e.isSvg),e.file&&(this.#i=e.file.name),this.#f()}#g(){if(this.#r=null,this._uiManager.enableWaiting(!1),!!this.#s){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(e=null,t=!0){if(this.hasAltTextData())return null;const{mlManager:n}=this._uiManager;if(!n)throw new Error("No ML.");if(!await n.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:i,width:a,height:s}=e||this.copyCanvas(null,null,!0).imageData,o=await n.guess({name:"altText",request:{data:i,width:a,height:s,channels:i.length/(a*s)}});if(!o)throw new Error("No response from the AI service.");if(o.error)throw new Error("Error from the AI service.");if(o.cancel)return null;if(!o.output)throw new Error("No valid response from the AI service.");const l=o.output;return await this.setGuessedAltText(l),t&&!this.hasAltTextData()&&(this.altTextData={alt:l,decorative:!1}),l}#p(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(n=>this.#u(n,!0)).finally(()=>this.#g());return}if(this.#n){const n=this.#n;this.#n=null,this._uiManager.enableWaiting(!0),this.#r=this._uiManager.imageManager.getFromUrl(n).then(i=>this.#u(i)).finally(()=>this.#g());return}if(this.#a){const n=this.#a;this.#a=null,this._uiManager.enableWaiting(!0),this.#r=this._uiManager.imageManager.getFromFile(n).then(i=>this.#u(i)).finally(()=>this.#g());return}const e=document.createElement("input");e.type="file",e.accept=S2.join(",");const t=this._uiManager._signal;this.#r=new Promise(n=>{e.addEventListener("change",async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#u(i)}n()},{signal:t}),e.addEventListener("cancel",()=>{this.remove(),n()},{signal:t})}).finally(()=>this.#g()),e.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#s?.remove(),this.#s=null,this.#l&&(clearTimeout(this.#l),this.#l=null)),super.remove()}rebuild(){if(!this.parent){this.#t&&this.#p();return}super.rebuild(),this.div!==null&&(this.#t&&this.#s===null&&this.#p(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#r||this.#e||this.#n||this.#a||this.#t||this.#o)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;return this._isCopy&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#o||(this.#e?this.#f():this.#p()),this._isCopy&&this._moveAfterPaste(e,t),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,t){const{id:n,bitmap:i}=this._uiManager.imageManager.getFromCanvas(e,t);t.remove(),n&&this._uiManager.imageManager.isValidId(n)&&(this.#t=n,i&&(this.#e=i),this.#o=!1,this.#f())}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;this.#l!==null&&clearTimeout(this.#l);const e=200;this.#l=setTimeout(()=>{this.#l=null,this.#m()},e)}#f(){const{div:e}=this;let{width:t,height:n}=this.#e;const[i,a]=this.pageDimensions,s=.75;if(this.width)t=this.width*i,n=this.height*a;else if(t>s*i||n>s*a){const u=Math.min(s*i/t,s*a/n);t*=u,n*=u}const[o,l]=this.parentDimensions;this.setDims(t*o/i,n*l/a),this._uiManager.enableWaiting(!1);const c=this.#s=document.createElement("canvas");c.setAttribute("role","img"),this.addContainer(c),this.width=t/i,this.height=n/a,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),this.#m(),this.#h||(this.parent.addUndoableEditor(this),this.#h=!0),this._reportTelemetry({action:"inserted_image"}),this.#i&&this.div.setAttribute("aria-description",this.#i),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}copyCanvas(e,t,n=!1){e||(e=224);const{width:i,height:a}=this.#e,s=new ws;let o=this.#e,l=i,c=a,u=null;if(t){if(i>t||a>t){const k=Math.min(t/i,t/a);l=Math.floor(i*k),c=Math.floor(a*k)}u=document.createElement("canvas");const d=u.width=Math.ceil(l*s.sx),f=u.height=Math.ceil(c*s.sy);this.#c||(o=this.#d(d,f));const p=u.getContext("2d");p.filter=this._uiManager.hcmFilter;let m="white",y="#cfcfd8";this._uiManager.hcmFilter!=="none"?y="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(m="#8f8f9d",y="#42414d");const v=15,x=v*s.sx,S=v*s.sy,A=new OffscreenCanvas(x*2,S*2),C=A.getContext("2d");C.fillStyle=m,C.fillRect(0,0,x*2,S*2),C.fillStyle=y,C.fillRect(0,0,x,S),C.fillRect(x,S,x,S),p.fillStyle=p.createPattern(A,"repeat"),p.fillRect(0,0,d,f),p.drawImage(o,0,0,o.width,o.height,0,0,d,f)}let h=null;if(n){let d,f;if(s.symmetric&&o.width<e&&o.height<e)d=o.width,f=o.height;else if(o=this.#e,i>e||a>e){const y=Math.min(e/i,e/a);d=Math.floor(i*y),f=Math.floor(a*y),this.#c||(o=this.#d(d,f))}const m=new OffscreenCanvas(d,f).getContext("2d",{willReadFrequently:!0});m.drawImage(o,0,0,o.width,o.height,0,0,d,f),h={width:d,height:f,data:m.getImageData(0,0,d,f).data}}return{canvas:u,width:l,height:c,imageData:h}}#d(e,t){const{width:n,height:i}=this.#e;let a=n,s=i,o=this.#e;for(;a>2*e||s>2*t;){const l=a,c=s;a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2));const u=new OffscreenCanvas(a,s);u.getContext("2d").drawImage(o,0,0,l,c,0,0,a,s),o=u.transferToImageBitmap()}return o}#m(){const[e,t]=this.parentDimensions,{width:n,height:i}=this,a=new ws,s=Math.ceil(n*e*a.sx),o=Math.ceil(i*t*a.sy),l=this.#s;if(!l||l.width===s&&l.height===o)return;l.width=s,l.height=o;const c=this.#c?this.#e:this.#d(s,o),u=l.getContext("2d");u.filter=this._uiManager.hcmFilter,u.drawImage(c,0,0,c.width,c.height,0,0,s,o)}#y(e){if(e){if(this.#c){const i=this._uiManager.imageManager.getSvgUrl(this.#t);if(i)return i}const t=document.createElement("canvas");return{width:t.width,height:t.height}=this.#e,t.getContext("2d").drawImage(this.#e,0,0),t.toDataURL()}if(this.#c){const[t,n]=this.pageDimensions,i=Math.round(this.width*t*ru.PDF_TO_CSS_UNITS),a=Math.round(this.height*n*ru.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,a);return s.getContext("2d").drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,i,a),s.transferToImageBitmap()}return structuredClone(this.#e)}static async deserialize(e,t,n){let i=null,a=!1;if(e instanceof Ly){const{data:{rect:m,rotation:y,id:v,structParent:x,popupRef:S,contentsObj:A},container:C,parent:{page:{pageNumber:k}},canvas:I}=e;let R,U;I?(delete e.canvas,{id:R,bitmap:U}=n.imageManager.getFromCanvas(C.id,I),I.remove()):(a=!0,e._hasNoCanvas=!0);const D=(await t._structTree.getAriaAttributes(`${v2}${v}`))?.get("aria-label")||"";i=e={annotationType:xr.STAMP,bitmapId:R,bitmap:U,pageIndex:k-1,rect:m.slice(0),rotation:y,annotationElementId:v,id:v,deleted:!1,accessibilityData:{decorative:!1,altText:D},isSvg:!1,structParent:x,popupRef:S,comment:A?.str||null}}const s=await super.deserialize(e,t,n),{rect:o,bitmap:l,bitmapUrl:c,bitmapId:u,isSvg:h,accessibilityData:d}=e;a?(n.addMissingCanvas(e.id,s),s.#o=!0):u&&n.imageManager.isValidId(u)?(s.#t=u,l&&(s.#e=l)):s.#n=c,s.#c=h;const[f,p]=s.pageDimensions;return s.width=(o[2]-o[0])/f,s.height=(o[3]-o[1])/p,d&&(s.altTextData=d),s._initialData=i,e.comment&&s.setCommentData(e.comment),s.#h=!!i,s}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const n={annotationType:xr.STAMP,bitmapId:this.#t,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#c,structTreeParentId:this._structTreeParentId};if(this.addComment(n),e)return n.bitmapUrl=this.#y(!0),n.accessibilityData=this.serializeAltText(!0),n.isCopy=!0,n;const{decorative:i,altText:a}=this.serializeAltText(!1);if(!i&&a&&(n.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const o=this.#b(n);if(o.isSame)return null;o.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1}if(n.id=this.annotationElementId,t===null)return n;t.stamps||=new Map;const s=this.#c?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(!t.stamps.has(this.#t))t.stamps.set(this.#t,{area:s,serialized:n}),n.bitmap=this.#y(!1);else if(this.#c){const o=t.stamps.get(this.#t);s>o.area&&(o.area=s,o.serialized.bitmap.close(),o.serialized.bitmap=this.#y(!1))}return n}#b(e){const{pageIndex:t,accessibilityData:{altText:n}}=this._initialData,i=e.pageIndex===t,a=(e.accessibilityData?.alt||"")===n;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&i&&a,isSameAltText:a}}renderAnnotationElement(e){const t={rect:this.getRect(0,0)};return this.hasEditedComment&&(t.popup=this.comment),e.updateEdited(t),null}}class ro{#e;#t=!1;#r=null;#n=null;#a=null;#i=new Map;#s=!1;#o=!1;#l=!1;#c=null;#h=null;#u=null;#g=null;#p=null;#f=-1;#d;static _initialized=!1;static#m=new Map([ei,G2,WF,jn,ks].map(e=>[e._editorType,e]));constructor({uiManager:e,pageIndex:t,div:n,structTreeLayer:i,accessibilityManager:a,annotationLayer:s,drawLayer:o,textLayer:l,viewport:c,l10n:u}){const h=[...ro.#m.values()];if(!ro._initialized){ro._initialized=!0;for(const d of h)d.initialize(u,e)}e.registerEditorTypes(h),this.#d=e,this.pageIndex=t,this.div=n,this.#e=a,this.#r=s,this.viewport=c,this.#u=l,this.drawLayer=o,this._structTree=i,this.#d.addLayer(this)}get isEmpty(){return this.#i.size===0}get isInvisible(){return this.isEmpty&&this.#d.getMode()===xr.NONE}updateToolbar(e){this.#d.updateToolbar(e)}updateMode(e=this.#d.getMode()){switch(this.#v(),e){case xr.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case xr.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case xr.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;for(const n of ro.#m.values())t.toggle(`${n._type}Editing`,e===n._editorType);this.div.hidden=!1}hasTextLayer(e){return e===this.#u?.div}setEditingState(e){this.#d.setEditingState(e)}addCommands(e){this.#d.addCommands(e)}cleanUndoStack(e){this.#d.cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#r?.div.classList.toggle("disabled",!e)}async enable(){this.#l=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.#p?.abort(),this.#p=null;const e=new Set;for(const n of this.#i.values())n.enableEditing(),n.show(!0),n.annotationElementId&&(this.#d.removeChangedExistingAnnotation(n),e.add(n.annotationElementId));if(!this.#r){this.#l=!1;return}const t=this.#r.getEditableAnnotations();for(const n of t){if(n.hide(),this.#d.isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;const i=await this.deserialize(n);i&&(this.addOrRebuild(i),i.enableEditing())}this.#l=!1}disable(){if(this.#o=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.#u&&!this.#p){this.#p=new AbortController;const i=this.#d.combinedSignal(this.#p);this.#u.div.addEventListener("pointerdown",a=>{const{clientX:o,clientY:l,timeStamp:c}=a,u=this.#f;if(c-u>500){this.#f=c;return}this.#f=-1;const{classList:h}=this.div;h.toggle("getElements",!0);const d=document.elementsFromPoint(o,l);if(h.toggle("getElements",!1),!this.div.contains(d[0]))return;let f;const p=new RegExp(`^${q6}[0-9]+$`);for(const y of d)if(p.test(y.id)){f=y.id;break}if(!f)return;const m=this.#i.get(f);m?.annotationElementId===null&&(a.stopPropagation(),a.preventDefault(),m.dblclick())},{signal:i,capture:!0})}const e=new Map,t=new Map;for(const i of this.#i.values())if(i.disableEditing(),!!i.annotationElementId){if(i.serialize()!==null){e.set(i.annotationElementId,i);continue}else t.set(i.annotationElementId,i);this.getEditableAnnotation(i.annotationElementId)?.show(),i.remove()}if(this.#r){const i=this.#r.getEditableAnnotations();for(const a of i){const{id:s}=a.data;if(this.#d.isDeletedAnnotationElement(s)){a.updateEdited({deleted:!0});continue}let o=t.get(s);if(o){o.resetAnnotationElement(a),o.show(!1),a.show();continue}o=e.get(s),o&&(this.#d.addChangedExistingAnnotation(o),o.renderAnnotationElement(a)&&o.show(!1)),a.show()}}this.#v(),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const i of ro.#m.values())n.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#o=!1}getEditableAnnotation(e){return this.#r?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#d.getActive()!==e&&this.#d.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#u?.div&&!this.#g){this.#g=new AbortController;const e=this.#d.combinedSignal(this.#g);this.#u.div.addEventListener("pointerdown",this.#y.bind(this),{signal:e}),this.#u.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#u?.div&&this.#g&&(this.#g.abort(),this.#g=null,this.#u.div.classList.remove("highlighting"))}#y(e){this.#d.unselectAll();const{target:t}=e;if(t===this.#u.div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent"))&&this.#u.div.contains(t)){const{isMac:n}=fi.platform;if(e.button!==0||e.ctrlKey&&n)return;this.#d.showAllEditors("highlight",!0,!0),this.#u.div.classList.add("free"),this.toggleDrawing(),jn.startHighlighting(this,this.#d.direction==="ltr",{target:this.#u.div,x:e.x,y:e.y}),this.#u.div.addEventListener("pointerup",()=>{this.#u.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#d._signal}),e.preventDefault()}}enableClick(){if(this.#n)return;this.#n=new AbortController;const e=this.#d.combinedSignal(this.#n);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});const t=this.pointerup.bind(this);this.div.addEventListener("pointerup",t,{signal:e}),this.div.addEventListener("pointercancel",t,{signal:e})}disableClick(){this.#n?.abort(),this.#n=null}attach(e){this.#i.set(e.id,e);const{annotationElementId:t}=e;t&&this.#d.isDeletedAnnotationElement(t)&&this.#d.removeDeletedAnnotationElement(e)}detach(e){this.#i.delete(e.id),this.#e?.removePointerInTextLayer(e.contentDiv),!this.#o&&e.annotationElementId&&this.#d.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#d.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#d.addDeletedAnnotationElement(e.annotationElementId),or.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),this.#d.addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!this.#l),this.#d.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!this.#a&&(e._focusEventsAllowed=!1,this.#a=setTimeout(()=>{this.#a=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#d._signal}),t.focus())},0)),e._structTreeParentId=this.#e?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){const t=()=>e._uiManager.rebuild(e),n=()=>{e.remove()};this.addCommands({cmd:t,undo:n,mustExec:!1})}getNextId(){return this.#d.getId()}get#b(){return ro.#m.get(this.#d.getMode())}combinedSignal(e){return this.#d.combinedSignal(e)}#w(e){const t=this.#b;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#b?.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await this.#d.updateMode(e.mode);const{offsetX:n,offsetY:i}=this.#x(),a=this.getNextId(),s=this.#w({parent:this,id:a,x:n,y:i,uiManager:this.#d,isCentered:!0,...t});s&&this.add(s)}async deserialize(e){return await ro.#m.get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,this.#d)||null}createAndAddNewEditor(e,t,n={}){const i=this.getNextId(),a=this.#w({parent:this,id:i,x:e.offsetX,y:e.offsetY,uiManager:this.#d,isCentered:t,...n});return a&&this.add(a),a}#x(){const{x:e,y:t,width:n,height:i}=this.div.getBoundingClientRect(),a=Math.max(0,e),s=Math.max(0,t),o=Math.min(window.innerWidth,e+n),l=Math.min(window.innerHeight,t+i),c=(a+o)/2-e,u=(s+l)/2-t,[h,d]=this.viewport.rotation%180===0?[c,u]:[u,c];return{offsetX:h,offsetY:d}}addNewEditor(e={}){this.createAndAddNewEditor(this.#x(),!0,e)}setSelected(e){this.#d.setSelected(e)}toggleSelected(e){this.#d.toggleSelected(e)}unselect(e){this.#d.unselect(e)}pointerup(e){const{isMac:t}=fi.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!this.#s||(this.#s=!1,this.#b?.isDrawer&&this.#b.supportMultipleDrawings))return;if(!this.#t){this.#t=!0;return}const n=this.#d.getMode();if(n===xr.STAMP||n===xr.SIGNATURE){this.#d.unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){if(this.#d.getMode()===xr.HIGHLIGHT&&this.enableTextSelection(),this.#s){this.#s=!1;return}const{isMac:t}=fi.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(this.#s=!0,this.#b?.isDrawer){this.startDrawingSession(e);return}const n=this.#d.getActive();this.#t=!n||n.isEmpty()}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),this.#c){this.#b.startDrawing(this,this.#d,!1,e);return}this.#d.setCurrentDrawingSession(this),this.#c=new AbortController;const t=this.#d.combinedSignal(this.#c);this.div.addEventListener("blur",({relatedTarget:n})=>{n&&!this.div.contains(n)&&(this.#h=null,this.commitOrRemove())},{signal:t}),this.#b.startDrawing(this,this.#d,!1,e)}pause(e){if(e){const{activeElement:t}=document;this.div.contains(t)&&(this.#h=t);return}this.#h&&setTimeout(()=>{this.#h?.focus(),this.#h=null},0)}endDrawingSession(e=!1){return this.#c?(this.#d.setCurrentDrawingSession(null),this.#c.abort(),this.#c=null,this.#h=null,this.#b.endDrawing(e)):null}findNewParent(e,t,n){const i=this.#d.findParent(t,n);return i===null||i===this?!1:(i.changeParent(e),!0)}commitOrRemove(){return this.#c?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#c&&this.#b.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#d.getActive()?.parent===this&&(this.#d.commitOrRemove(),this.#d.setActiveEditor(null)),this.#a&&(clearTimeout(this.#a),this.#a=null);for(const e of this.#i.values())this.#e?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#i.clear(),this.#d.removeLayer(this)}#v(){for(const e of this.#i.values())e.isEmpty()&&e.remove()}render({viewport:e}){this.viewport=e,ql(this.div,e);for(const t of this.#d.getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){this.#d.commitOrRemove(),this.#v();const t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,ql(this.div,{rotation:n}),t!==n)for(const i of this.#i.values())i.rotate(n)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#d.viewParameters.realScale}}class pi{#e=null;#t=new Map;#r=new Map;static#n=0;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(!this.#e){this.#e=e;return}if(this.#e!==e){if(this.#t.size>0)for(const t of this.#t.values())t.remove(),e.append(t);this.#e=e}}static get _svgFactory(){return jr(this,"_svgFactory",new bf)}static#a(e,[t,n,i,a]){const{style:s}=e;s.top=`${100*n}%`,s.left=`${100*t}%`,s.width=`${100*i}%`,s.height=`${100*a}%`}#i(){const e=pi._svgFactory.create(1,1,!0);return this.#e.append(e),e.setAttribute("aria-hidden",!0),e}#s(e,t){const n=pi._svgFactory.createElement("clipPath");e.append(n);const i=`clip_${t}`;n.setAttribute("id",i),n.setAttribute("clipPathUnits","objectBoundingBox");const a=pi._svgFactory.createElement("use");return n.append(a),a.setAttribute("href",`#${t}`),a.classList.add("clip"),i}#o(e,t){for(const[n,i]of Object.entries(t))i===null?e.removeAttribute(n):e.setAttribute(n,i)}draw(e,t=!1,n=!1){const i=pi.#n++,a=this.#i(),s=pi._svgFactory.createElement("defs");a.append(s);const o=pi._svgFactory.createElement("path");s.append(o);const l=`path_p${this.pageIndex}_${i}`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),t&&this.#r.set(i,o);const c=n?this.#s(s,l):null,u=pi._svgFactory.createElement("use");return a.append(u),u.setAttribute("href",`#${l}`),this.updateProperties(a,e),this.#t.set(i,a),{id:i,clipPathId:`url(#${c})`}}drawOutline(e,t){const n=pi.#n++,i=this.#i(),a=pi._svgFactory.createElement("defs");i.append(a);const s=pi._svgFactory.createElement("path");a.append(s);const o=`path_p${this.pageIndex}_${n}`;s.setAttribute("id",o),s.setAttribute("vector-effect","non-scaling-stroke");let l;if(t){const h=pi._svgFactory.createElement("mask");a.append(h),l=`mask_p${this.pageIndex}_${n}`,h.setAttribute("id",l),h.setAttribute("maskUnits","objectBoundingBox");const d=pi._svgFactory.createElement("rect");h.append(d),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("fill","white");const f=pi._svgFactory.createElement("use");h.append(f),f.setAttribute("href",`#${o}`),f.setAttribute("stroke","none"),f.setAttribute("fill","black"),f.setAttribute("fill-rule","nonzero"),f.classList.add("mask")}const c=pi._svgFactory.createElement("use");i.append(c),c.setAttribute("href",`#${o}`),l&&c.setAttribute("mask",`url(#${l})`);const u=c.cloneNode();return i.append(u),c.classList.add("mainOutline"),u.classList.add("secondaryOutline"),this.updateProperties(i,e),this.#t.set(n,i),n}finalizeDraw(e,t){this.#r.delete(e),this.updateProperties(e,t)}updateProperties(e,t){if(!t)return;const{root:n,bbox:i,rootClass:a,path:s}=t,o=typeof e=="number"?this.#t.get(e):e;if(o){if(n&&this.#o(o,n),i&&pi.#a(o,i),a){const{classList:l}=o;for(const[c,u]of Object.entries(a))l.toggle(c,u)}if(s){const c=o.firstChild.firstChild;this.#o(c,s)}}}updateParent(e,t){if(t===this)return;const n=this.#t.get(e);n&&(t.#e.append(n),this.#t.delete(e),t.#t.set(e,n))}remove(e){this.#r.delete(e),this.#e!==null&&(this.#t.get(e).remove(),this.#t.delete(e))}destroy(){this.#e=null;for(const e of this.#t.values())e.remove();this.#t.clear(),this.#r.clear()}}globalThis._pdfjsTestingUtils={HighlightOutliner:H2},globalThis.pdfjsLib={AbortException:Ko,AnnotationEditorLayer:ro,AnnotationEditorParamsType:Jr,AnnotationEditorType:xr,AnnotationEditorUIManager:Yo,AnnotationLayer:j2,AnnotationMode:$o,AnnotationType:Wn,build:SF,ColorPicker:Da,createValidAbsoluteUrl:G6,DOMSVGFactory:bf,DrawLayer:pi,FeatureTest:fi,fetchData:Mh,getDocument:D2,getFilenameFromUrl:gP,getPdfFilenameFromUrl:pP,getRGB:cf,getUuid:K6,getXfaPageViewport:bP,GlobalWorkerOptions:au,ImageKind:ef,InvalidPDFException:p2,isDataScheme:lf,isPdfFile:w2,isValidExplicitDest:TP,MathClamp:Li,noContextMenu:Pa,normalizeUnicode:hP,OPS:rf,OutputScale:ws,PasswordResponses:rP,PDFDataRangeTransport:Ty,PDFDateString:x2,PDFWorker:zh,PermissionFlag:tP,PixelsPerInch:ru,RenderingCancelledException:y2,ResponseException:of,setLayerDimensions:ql,shadow:jr,SignatureExtractor:lu,stopEvent:Xn,SupportedImageMimeTypes:S2,TextLayer:Bi,TouchManager:hf,updateUrlHash:W6,Util:nr,VerbosityLevel:tf,version:xF,XfaLayer:Oy},zc(()=>Promise.resolve().then(()=>Ene),void 0,Fr&&Fr.tagName.toUpperCase()==="SCRIPT"&&Fr.src||new URL("_app/immutable/bundle.DkfpbWnE.js",document.baseURI).href).then(r=>{const e=new Blob([r.default],{type:"application/javascript"});au.workerSrc=URL.createObjectURL(e)}).catch(()=>{console.warn("Failed to load PDF.js worker, PDF processing may not work")});async function zy(r){return new Promise((e,t)=>{const n=new FileReader;n.onload=i=>{i.target?.result?e(i.target.result):t(new Error("Failed to read file."))},n.onerror=()=>{t(new Error("Failed to read file."))},n.readAsArrayBuffer(r)})}async function jy(r){try{const e=await zy(r),t=await D2(e).promise,n=t.numPages,i=[];for(let o=1;o<=n;o++)i.push(t.getPage(o).then(l=>l.getTextContent()));return(await Promise.all(i)).flatMap(o=>o.items.map(l=>l.str??"")).join(`
`)}catch(e){throw console.error("Error converting PDF to text:",e),new Error(`Failed to convert PDF to text: ${e instanceof Error?e.message:"Unknown error"}`)}}async function Hy(r,e=1.5){try{const t=await zy(r),n=await D2(t).promise,i=[];for(let a=1;a<=n.numPages;a++){const s=await n.getPage(a),o=s.getViewport({scale:e}),l=document.createElement("canvas"),c=l.getContext("2d");if(l.width=o.width,l.height=o.height,!c)throw new Error("Failed to get 2D context from canvas");const u=s.render({canvasContext:c,viewport:o,canvas:l});i.push(u.promise.then(()=>l.toDataURL(ha.PNG)))}return await Promise.all(i)}catch(t){throw console.error("Error converting PDF to images:",t),new Error(`Failed to convert PDF to images: ${t instanceof Error?t.message:"Unknown error"}`)}}var qy=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,Zi=r=>!r||typeof r!="object"||Object.keys(r).length===0,VF=(r,e)=>JSON.stringify(r)===JSON.stringify(e);function Gy(r,e){r.forEach(function(t){Array.isArray(t)?Gy(t,e):e.push(t)})}function Wy(r){let e=[];return Gy(r,e),e}var Vy=(...r)=>Wy(r).filter(Boolean),Xy=(r,e)=>{let t={},n=Object.keys(r),i=Object.keys(e);for(let a of n)if(i.includes(a)){let s=r[a],o=e[a];Array.isArray(s)||Array.isArray(o)?t[a]=Vy(o,s):typeof s=="object"&&typeof o=="object"?t[a]=Xy(s,o):t[a]=o+" "+s}else t[a]=r[a];for(let a of i)n.includes(a)||(t[a]=e[a]);return t},$y=r=>!r||typeof r!="string"?r:r.replace(/\s+/g," ").trim();const $2="-",XF=r=>{const e=KF(r),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=r;return{getClassGroupId:s=>{const o=s.split($2);return o[0]===""&&o.length!==1&&o.shift(),Ky(o,e)||$F(s)},getConflictingClassGroupIds:(s,o)=>{const l=t[s]||[];return o&&n[s]?[...l,...n[s]]:l}}},Ky=(r,e)=>{if(r.length===0)return e.classGroupId;const t=r[0],n=e.nextPart.get(t),i=n?Ky(r.slice(1),n):void 0;if(i)return i;if(e.validators.length===0)return;const a=r.join($2);return e.validators.find(({validator:s})=>s(a))?.classGroupId},Yy=/^\[(.+)\]$/,$F=r=>{if(Yy.test(r)){const e=Yy.exec(r)[1],t=e?.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},KF=r=>{const{theme:e,classGroups:t}=r,n={nextPart:new Map,validators:[]};for(const i in t)K2(t[i],n,i,e);return n},K2=(r,e,t,n)=>{r.forEach(i=>{if(typeof i=="string"){const a=i===""?e:Jy(e,i);a.classGroupId=t;return}if(typeof i=="function"){if(YF(i)){K2(i(n),e,t,n);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([a,s])=>{K2(s,Jy(e,a),t,n)})})},Jy=(r,e)=>{let t=r;return e.split($2).forEach(n=>{t.nextPart.has(n)||t.nextPart.set(n,{nextPart:new Map,validators:[]}),t=t.nextPart.get(n)}),t},YF=r=>r.isThemeGetter,JF=r=>{if(r<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,n=new Map;const i=(a,s)=>{t.set(a,s),e++,e>r&&(e=0,n=t,t=new Map)};return{get(a){let s=t.get(a);if(s!==void 0)return s;if((s=n.get(a))!==void 0)return i(a,s),s},set(a,s){t.has(a)?t.set(a,s):i(a,s)}}},Y2="!",J2=":",QF=J2.length,ZF=r=>{const{prefix:e,experimentalParseClassName:t}=r;let n=i=>{const a=[];let s=0,o=0,l=0,c;for(let p=0;p<i.length;p++){let m=i[p];if(s===0&&o===0){if(m===J2){a.push(i.slice(l,p)),l=p+QF;continue}if(m==="/"){c=p;continue}}m==="["?s++:m==="]"?s--:m==="("?o++:m===")"&&o--}const u=a.length===0?i:i.substring(l),h=eD(u),d=h!==u,f=c&&c>l?c-l:void 0;return{modifiers:a,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}};if(e){const i=e+J2,a=n;n=s=>s.startsWith(i)?a(s.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(t){const i=n;n=a=>t({className:a,parseClassName:i})}return n},eD=r=>r.endsWith(Y2)?r.substring(0,r.length-1):r.startsWith(Y2)?r.substring(1):r,tD=r=>{const e=Object.fromEntries(r.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const i=[];let a=[];return n.forEach(s=>{s[0]==="["||e[s]?(i.push(...a.sort(),s),a=[]):a.push(s)}),i.push(...a.sort()),i}},rD=r=>({cache:JF(r.cacheSize),parseClassName:ZF(r),sortModifiers:tD(r),...XF(r)}),nD=/\s+/,iD=(r,e)=>{const{parseClassName:t,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a}=e,s=[],o=r.trim().split(nD);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{isExternal:h,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=t(u);if(h){l=u+(l.length>0?" "+l:l);continue}let y=!!m,v=n(y?p.substring(0,m):p);if(!v){if(!y){l=u+(l.length>0?" "+l:l);continue}if(v=n(p),!v){l=u+(l.length>0?" "+l:l);continue}y=!1}const x=a(d).join(":"),S=f?x+Y2:x,A=S+v;if(s.includes(A))continue;s.push(A);const C=i(v,y);for(let k=0;k<C.length;++k){const I=C[k];s.push(S+I)}l=u+(l.length>0?" "+l:l)}return l};function aD(){let r=0,e,t,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=Qy(e))&&(n&&(n+=" "),n+=t);return n}const Qy=r=>{if(typeof r=="string")return r;let e,t="";for(let n=0;n<r.length;n++)r[n]&&(e=Qy(r[n]))&&(t&&(t+=" "),t+=e);return t};function Q2(r,...e){let t,n,i,a=s;function s(l){const c=e.reduce((u,h)=>h(u),r());return t=rD(c),n=t.cache.get,i=t.cache.set,a=o,o(l)}function o(l){const c=n(l);if(c)return c;const u=iD(l,t);return i(l,u),u}return function(){return a(aD.apply(null,arguments))}}const oi=r=>{const e=t=>t[r]||[];return e.isThemeGetter=!0,e},Zy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,e7=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sD=/^\d+\/\d+$/,oD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,uD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cu=r=>sD.test(r),Kr=r=>!!r&&!Number.isNaN(Number(r)),Xl=r=>!!r&&Number.isInteger(Number(r)),t7=r=>r.endsWith("%")&&Kr(r.slice(0,-1)),Jo=r=>oD.test(r),dD=()=>!0,fD=r=>lD.test(r)&&!cD.test(r),Z2=()=>!1,gD=r=>uD.test(r),pD=r=>hD.test(r),mD=r=>!Wt(r)&&!Vt(r),bD=r=>uu(r,i7,Z2),Wt=r=>Zy.test(r),$l=r=>uu(r,a7,fD),eb=r=>uu(r,TD,Kr),vD=r=>uu(r,r7,Z2),yD=r=>uu(r,n7,pD),wD=r=>uu(r,Z2,gD),Vt=r=>e7.test(r),xf=r=>hu(r,a7),xD=r=>hu(r,ID),SD=r=>hu(r,r7),kD=r=>hu(r,i7),AD=r=>hu(r,n7),_D=r=>hu(r,MD,!0),uu=(r,e,t)=>{const n=Zy.exec(r);return n?n[1]?e(n[1]):t(n[2]):!1},hu=(r,e,t=!1)=>{const n=e7.exec(r);return n?n[1]?e(n[1]):t:!1},r7=r=>r==="position",CD=new Set(["image","url"]),n7=r=>CD.has(r),ED=new Set(["length","size","percentage"]),i7=r=>ED.has(r),a7=r=>r==="length",TD=r=>r==="number",ID=r=>r==="family-name",MD=r=>r==="shadow",tb=()=>{const r=oi("color"),e=oi("font"),t=oi("text"),n=oi("font-weight"),i=oi("tracking"),a=oi("leading"),s=oi("breakpoint"),o=oi("container"),l=oi("spacing"),c=oi("radius"),u=oi("shadow"),h=oi("inset-shadow"),d=oi("drop-shadow"),f=oi("blur"),p=oi("perspective"),m=oi("aspect"),y=oi("ease"),v=oi("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],k=()=>[Vt,Wt,l],I=()=>[cu,"full","auto",...k()],R=()=>[Xl,"none","subgrid",Vt,Wt],U=()=>["auto",{span:["full",Xl,Vt,Wt]},Vt,Wt],D=()=>[Xl,"auto",Vt,Wt],$=()=>["auto","min","max","fr",Vt,Wt],H=()=>["start","end","center","between","around","evenly","stretch","baseline"],V=()=>["start","end","center","stretch"],z=()=>["auto",...k()],Z=()=>[cu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],q=()=>[r,Vt,Wt],re=()=>[t7,$l],X=()=>["","none","full",c,Vt,Wt],ie=()=>["",Kr,xf,$l],P=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_e=()=>["","none",f,Vt,Wt],W=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Vt,Wt],me=()=>["none",Kr,Vt,Wt],He=()=>["none",Kr,Vt,Wt],Xe=()=>[Kr,Vt,Wt],Le=()=>[cu,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jo],breakpoint:[Jo],color:[dD],container:[Jo],"drop-shadow":[Jo],ease:["in","out","in-out"],font:[mD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jo],shadow:[Jo],spacing:["px",Kr],text:[Jo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cu,Wt,Vt,m]}],container:["container"],columns:[{columns:[Kr,Wt,Vt,o]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...S(),Wt,Vt]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Xl,"auto",Vt,Wt]}],basis:[{basis:[cu,"full","auto",o,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Kr,cu,"auto","initial","none",Wt]}],grow:[{grow:["",Kr,Vt,Wt]}],shrink:[{shrink:["",Kr,Vt,Wt]}],order:[{order:[Xl,"first","last","none",Vt,Wt]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...V(),"baseline"]}],"align-self":[{self:["auto",...V(),"baseline"]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],w:[{w:[o,"screen",...Z()]}],"min-w":[{"min-w":[o,"screen","none",...Z()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...Z()]}],h:[{h:["screen",...Z()]}],"min-h":[{"min-h":["screen","none",...Z()]}],"max-h":[{"max-h":["screen",...Z()]}],"font-size":[{text:["base",t,xf,$l]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Vt,eb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",t7,Wt]}],"font-family":[{font:[xD,Wt,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Vt,Wt]}],"line-clamp":[{"line-clamp":[Kr,"none",Vt,eb]}],leading:[{leading:[a,...k()]}],"list-image":[{"list-image":["none",Vt,Wt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Vt,Wt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:[Kr,"from-font","auto",Vt,$l]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[Kr,"auto",Vt,Wt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Vt,Wt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Vt,Wt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...S(),SD,vD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",kD,bD]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xl,Vt,Wt],radial:["",Vt,Wt],conic:[Xl,Vt,Wt]},AD,yD]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...P(),"hidden","none"]}],"divide-style":[{divide:[...P(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...P(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Kr,Vt,Wt]}],"outline-w":[{outline:["",Kr,xf,$l]}],"outline-color":[{outline:[r]}],shadow:[{shadow:["","none",u,_D,wD]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",Vt,Wt,h]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[Kr,$l]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":q()}],opacity:[{opacity:[Kr,Vt,Wt]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],filter:[{filter:["","none",Vt,Wt]}],blur:[{blur:_e()}],brightness:[{brightness:[Kr,Vt,Wt]}],contrast:[{contrast:[Kr,Vt,Wt]}],"drop-shadow":[{"drop-shadow":["","none",d,Vt,Wt]}],grayscale:[{grayscale:["",Kr,Vt,Wt]}],"hue-rotate":[{"hue-rotate":[Kr,Vt,Wt]}],invert:[{invert:["",Kr,Vt,Wt]}],saturate:[{saturate:[Kr,Vt,Wt]}],sepia:[{sepia:["",Kr,Vt,Wt]}],"backdrop-filter":[{"backdrop-filter":["","none",Vt,Wt]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[Kr,Vt,Wt]}],"backdrop-contrast":[{"backdrop-contrast":[Kr,Vt,Wt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Kr,Vt,Wt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Kr,Vt,Wt]}],"backdrop-invert":[{"backdrop-invert":["",Kr,Vt,Wt]}],"backdrop-opacity":[{"backdrop-opacity":[Kr,Vt,Wt]}],"backdrop-saturate":[{"backdrop-saturate":[Kr,Vt,Wt]}],"backdrop-sepia":[{"backdrop-sepia":["",Kr,Vt,Wt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Vt,Wt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Kr,"initial",Vt,Wt]}],ease:[{ease:["linear","initial",y,Vt,Wt]}],delay:[{delay:[Kr,Vt,Wt]}],animate:[{animate:["none",v,Vt,Wt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,Vt,Wt]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:He()}],"scale-x":[{"scale-x":He()}],"scale-y":[{"scale-y":He()}],"scale-z":[{"scale-z":He()}],"scale-3d":["scale-3d"],skew:[{skew:Xe()}],"skew-x":[{"skew-x":Xe()}],"skew-y":[{"skew-y":Xe()}],transform:[{transform:[Vt,Wt,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Vt,Wt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Vt,Wt]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[Kr,xf,$l,eb]}],stroke:[{stroke:["none",...q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},OD=(r,{cacheSize:e,prefix:t,experimentalParseClassName:n,extend:i={},override:a={}})=>(Wh(r,"cacheSize",e),Wh(r,"prefix",t),Wh(r,"experimentalParseClassName",n),Sf(r.theme,a.theme),Sf(r.classGroups,a.classGroups),Sf(r.conflictingClassGroups,a.conflictingClassGroups),Sf(r.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Wh(r,"orderSensitiveModifiers",a.orderSensitiveModifiers),kf(r.theme,i.theme),kf(r.classGroups,i.classGroups),kf(r.conflictingClassGroups,i.conflictingClassGroups),kf(r.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),s7(r,i,"orderSensitiveModifiers"),r),Wh=(r,e,t)=>{t!==void 0&&(r[e]=t)},Sf=(r,e)=>{if(e)for(const t in e)Wh(r,t,e[t])},kf=(r,e)=>{if(e)for(const t in e)s7(r,e,t)},s7=(r,e,t)=>{const n=e[t];n!==void 0&&(r[t]=r[t]?r[t].concat(n):n)},ND=(r,...e)=>typeof r=="function"?Q2(tb,r,...e):Q2(()=>OD(tb(),r),...e),RD=Q2(tb);var PD={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},o7=r=>r||void 0,Vh=(...r)=>o7(Wy(r).filter(Boolean).join(" ")),rb=null,no={},nb=!1,Xh=(...r)=>e=>e.twMerge?((!rb||nb)&&(nb=!1,rb=Zi(no)?RD:ND({...no,extend:{theme:no.theme,classGroups:no.classGroups,conflictingClassGroupModifiers:no.conflictingClassGroupModifiers,conflictingClassGroups:no.conflictingClassGroups,...no.extend}})),o7(rb(Vh(r)))):Vh(r),l7=(r,e)=>{for(let t in e)r.hasOwnProperty(t)?r[t]=Vh(r[t],e[t]):r[t]=e[t];return r},Af=(r,e)=>{let{extend:t=null,slots:n={},variants:i={},compoundVariants:a=[],compoundSlots:s=[],defaultVariants:o={}}=r,l={...PD,...e},c=t!=null&&t.base?Vh(t.base,r?.base):r?.base,u=t!=null&&t.variants&&!Zi(t.variants)?Xy(i,t.variants):i,h=t!=null&&t.defaultVariants&&!Zi(t.defaultVariants)?{...t.defaultVariants,...o}:o;!Zi(l.twMergeConfig)&&!VF(l.twMergeConfig,no)&&(nb=!0,no=l.twMergeConfig);let d=Zi(t?.slots),f=Zi(n)?{}:{base:Vh(r?.base,d&&t?.base),...n},p=d?f:l7({...t?.slots},Zi(f)?{base:r?.base}:f),m=Zi(t?.compoundVariants)?a:Vy(t?.compoundVariants,a),y=x=>{if(Zi(u)&&Zi(n)&&d)return Xh(c,x?.class,x?.className)(l);if(m&&!Array.isArray(m))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof m}`);if(s&&!Array.isArray(s))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof s}`);let S=(H,V,z=[],Z)=>{let q=z;if(typeof V=="string")q=q.concat($y(V).split(" ").map(re=>`${H}:${re}`));else if(Array.isArray(V))q=q.concat(V.reduce((re,X)=>re.concat(`${H}:${X}`),[]));else if(typeof V=="object"&&typeof Z=="string"){for(let re in V)if(V.hasOwnProperty(re)&&re===Z){let X=V[re];if(X&&typeof X=="string"){let ie=$y(X);q[Z]?q[Z]=q[Z].concat(ie.split(" ").map(P=>`${H}:${P}`)):q[Z]=ie.split(" ").map(P=>`${H}:${P}`)}else Array.isArray(X)&&X.length>0&&(q[Z]=X.reduce((ie,P)=>ie.concat(`${H}:${P}`),[]))}}return q},A=(H,V=u,z=null,Z=null)=>{var q;let re=V[H];if(!re||Zi(re))return null;let X=(q=Z?.[H])!=null?q:x?.[H];if(X===null)return null;let ie=qy(X),P=Array.isArray(l.responsiveVariants)&&l.responsiveVariants.length>0||l.responsiveVariants===!0,be=h?.[H],_e=[];if(typeof ie=="object"&&P)for(let[He,Xe]of Object.entries(ie)){let Le=re[Xe];if(He==="initial"){be=Xe;continue}Array.isArray(l.responsiveVariants)&&!l.responsiveVariants.includes(He)||(_e=S(He,Le,_e,z))}let W=ie!=null&&typeof ie!="object"?ie:qy(be),me=re[W||"false"];return typeof _e=="object"&&typeof z=="string"&&_e[z]?l7(_e,me):_e.length>0?(_e.push(me),z==="base"?_e.join(" "):_e):me},C=()=>u?Object.keys(u).map(H=>A(H,u)):null,k=(H,V)=>{if(!u||typeof u!="object")return null;let z=new Array;for(let Z in u){let q=A(Z,u,H,V),re=H==="base"&&typeof q=="string"?q:q&&q[H];re&&(z[z.length]=re)}return z},I={};for(let H in x)x[H]!==void 0&&(I[H]=x[H]);let R=(H,V)=>{var z;let Z=typeof x?.[H]=="object"?{[H]:(z=x[H])==null?void 0:z.initial}:{};return{...h,...I,...Z,...V}},U=(H=[],V)=>{let z=[];for(let{class:Z,className:q,...re}of H){let X=!0;for(let[ie,P]of Object.entries(re)){let be=R(ie,V)[ie];if(Array.isArray(P)){if(!P.includes(be)){X=!1;break}}else{let _e=W=>W==null||W===!1;if(_e(P)&&_e(be))continue;if(be!==P){X=!1;break}}}X&&(Z&&z.push(Z),q&&z.push(q))}return z},D=H=>{let V=U(m,H);if(!Array.isArray(V))return V;let z={};for(let Z of V)if(typeof Z=="string"&&(z.base=Xh(z.base,Z)(l)),typeof Z=="object")for(let[q,re]of Object.entries(Z))z[q]=Xh(z[q],re)(l);return z},$=H=>{if(s.length<1)return null;let V={};for(let{slots:z=[],class:Z,className:q,...re}of s){if(!Zi(re)){let X=!0;for(let ie of Object.keys(re)){let P=R(ie,H)[ie];if(P===void 0||(Array.isArray(re[ie])?!re[ie].includes(P):re[ie]!==P)){X=!1;break}}if(!X)continue}for(let X of z)V[X]=V[X]||[],V[X].push([Z,q])}return V};if(!Zi(n)||!d){let H={};if(typeof p=="object"&&!Zi(p))for(let V of Object.keys(p))H[V]=z=>{var Z,q;return Xh(p[V],k(V,z),((Z=D(z))!=null?Z:[])[V],((q=$(z))!=null?q:[])[V],z?.class,z?.className)(l)};return H}return Xh(c,C(),U(m),x?.class,x?.className)(l)},v=()=>{if(!(!u||typeof u!="object"))return Object.keys(u)};return y.variantKeys=v(),y.extend=t,y.base=c,y.slots=p,y.variants=u,y.defaultVariants=h,y.compoundSlots=s,y.compoundVariants=m,y};const $h=Af({base:"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",outline:"bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});var FD=ee("<a><!></a>"),DD=ee("<button><!></button>");function Qr(r,e){ge(e,!0);let t=L(e,"variant",3,"default"),n=L(e,"size",3,"default"),i=L(e,"ref",15,null),a=L(e,"href",3,void 0),s=L(e,"type",3,"button"),o=De(e,["$$slots","$$events","$$legacy","class","variant","size","ref","href","type","disabled","children"]);var l=J(),c=F(l);{var u=d=>{var f=FD();Lt(f,m=>({"data-slot":"button",class:m,href:e.disabled?void 0:a(),"aria-disabled":e.disabled,role:e.disabled?"link":void 0,tabindex:e.disabled?-1:void 0,...o}),[()=>Qt($h({variant:t(),size:n()}),e.class)],void 0,"svelte-1fk696n");var p=te(f);Te(p,()=>e.children??Re),Q(f),Tr(f,m=>i(m),()=>i()),_(d,f)},h=d=>{var f=DD();Lt(f,m=>({"data-slot":"button",class:m,type:s(),disabled:e.disabled,...o}),[()=>Qt($h({variant:t(),size:n()}),e.class)],void 0,"svelte-1fk696n");var p=te(f);Te(p,()=>e.children??Re),Q(f),Tr(f,m=>i(m),()=>i()),_(d,f)};ce(c,d=>{a()?d(u):d(h,!1)})}_(r,l),pe()}function ib(r){if(r===0)return"0 Bytes";const e=1024,t=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(r)/Math.log(e));return parseFloat((r/Math.pow(e,n)).toFixed(2))+" "+t[n]}function LD(r){return r.split("/").pop()?.toUpperCase()||"FILE"}function c7(r){return r.length>150?r.substring(0,150)+"...":r}var BD=ee("<span>•</span> <span> </span>",1),UD=ee("<!> Text",1),zD=ee('<div class="mr-1 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"></div>'),jD=ee("<!> Pages",1),HD=ee('<div class="flex items-center gap-2"><!> <!></div>'),qD=ee('<div class="flex items-center justify-between"><div class="flex items-center gap-3"><!> <div><!> <div class="flex items-center gap-2 text-sm text-muted-foreground"><span> </span> <!></div></div></div> <!></div>'),GD=ee('<div class="flex items-center justify-center"><img class="max-h-full rounded-lg object-contain shadow-lg"/></div>'),WD=ee('<div class="flex items-center justify-center p-8"><div class="text-center"><div class="mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"></div> <p class="text-muted-foreground">Converting PDF to images...</p></div></div>'),VD=ee('<div class="flex items-center justify-center p-8"><div class="text-center"><!> <p class="mb-4 text-muted-foreground">Failed to load PDF images</p> <p class="text-sm text-muted-foreground"> </p> <!></div></div>'),XD=ee('<div class="text-center"><p class="mb-2 text-sm text-muted-foreground"> </p> <img class="mx-auto max-w-full rounded-lg shadow-lg"/></div>'),$D=ee('<div class="max-h-[70vh] space-y-4 overflow-auto"></div>'),KD=ee('<div class="flex items-center justify-center p-8"><div class="text-center"><!> <p class="mb-4 text-muted-foreground">No PDF pages available</p></div></div>'),YD=ee('<div class="max-h-[60vh] overflow-auto rounded-lg bg-muted p-4 font-mono text-sm break-words whitespace-pre-wrap"> </div>'),JD=ee('<audio controls class="mb-4 w-full">Your browser does not support the audio element.</audio>'),QD=ee('<audio controls class="mb-4 w-full">Your browser does not support the audio element.</audio>'),ZD=ee('<p class="mb-4 text-muted-foreground">Audio preview not available</p>'),eL=ee('<div class="flex items-center justify-center p-8"><div class="w-full max-w-md text-center"><!> <!> <p class="text-sm text-muted-foreground"> </p></div></div>'),tL=ee('<div class="flex items-center justify-center p-8"><div class="text-center"><!> <p class="mb-4 text-muted-foreground">Preview not available for this file type</p></div></div>'),rL=ee('<!> <div class="flex-1 overflow-auto"><!></div>',1);function nL(r,e){ge(e,!0);let t=L(e,"open",15),n=j(()=>e.uploadedFile?.name||e.attachment?.name||e.name||"Unknown File"),i=j(()=>e.uploadedFile?.preview||(e.attachment?.type==="imageFile"?e.attachment.base64Url:e.preview)),a=j(()=>e.uploadedFile?.type||(e.attachment?.type==="imageFile"?"image":e.attachment?.type==="textFile"?"text":e.attachment?.type==="audioFile"?e.attachment.mimeType||"audio":e.attachment?.type==="pdfFile"?Dl.PDF:e.type||"unknown")),s=j(()=>e.uploadedFile?.size||e.size),o=j(()=>e.uploadedFile?.textContent||(e.attachment?.type==="textFile"||e.attachment?.type==="pdfFile"?e.attachment.content:e.textContent)),l=j(()=>da(g(a))===tn.AUDIO||g(a)==="audio"),c=j(()=>da(g(a))===tn.IMAGE||g(a)==="image"),u=j(()=>g(a)===Dl.PDF),h=j(()=>da(g(a))===tn.TEXT||g(a)==="text"),d=j(()=>()=>g(c)?L6:g(h)||g(u)?Ch:g(l)?U6:D6),f=oe("pages"),p=oe(Mr([])),m=oe(!1),y=oe(null);async function v(){if(!(!g(u)||g(p).length>0||g(m))){O(m,!0),O(y,null);try{let A=null;if(e.uploadedFile?.file)A=e.uploadedFile.file;else if(e.attachment?.type==="pdfFile"){if(e.attachment.images&&Array.isArray(e.attachment.images)){O(p,e.attachment.images,!0);return}if(e.attachment.base64Data){const C=e.attachment.base64Data,k=atob(C),I=new Array(k.length);for(let U=0;U<k.length;U++)I[U]=k.charCodeAt(U);const R=new Uint8Array(I);A=new File([R],g(n),{type:Dl.PDF})}}if(A)O(p,await Hy(A),!0);else throw new Error("No PDF file available for conversion")}catch(A){O(y,A instanceof Error?A.message:"Failed to load PDF images",!0)}finally{O(m,!1)}}}Ft(()=>{t()&&g(u)&&g(f)==="pages"&&v()});var x=J(),S=F(x);ve(S,()=>s2,(A,C)=>{C(A,{get open(){return t()},set open(k){t(k)},children:(k,I)=>{var R=J(),U=F(R);ve(U,()=>a2,(D,$)=>{$(D,{class:"grid max-h-[90vh] max-w-5xl overflow-hidden !p-10 sm:w-auto sm:max-w-6xl",children:(H,V)=>{var z=rL(),Z=F(z);ve(Z,()=>E6,(P,be)=>{be(P,{class:"flex-shrink-0",children:(_e,W)=>{var me=qD(),He=te(me),Xe=te(He);{var Le=ot=>{var lt=J(),ct=F(lt);ve(ct,()=>g(d),(Ct,St)=>{St(Ct,{class:"h-5 w-5 text-muted-foreground"})}),_(ot,lt)};ce(Xe,ot=>{g(d)&&ot(Le)})}var bt=ae(Xe,2),Ie=te(bt);ve(Ie,()=>Q0,(ot,lt)=>{lt(ot,{class:"text-left",children:(ct,Ct)=>{Rt();var St=sr();qe(()=>at(St,g(n))),_(ct,St)},$$slots:{default:!0}})});var Ve=ae(Ie,2),We=te(Ve),Qe=te(We,!0);Q(We);var mt=ae(We,2);{var Ke=ot=>{var lt=BD(),ct=ae(F(lt),2),Ct=te(ct,!0);Q(ct),qe(St=>at(Ct,St),[()=>ib(g(s))]),_(ot,lt)};ce(mt,ot=>{g(s)&&ot(Ke)})}Q(Ve),Q(bt),Q(He);var ze=ae(He,2);{var Ge=ot=>{var lt=HD(),ct=te(lt);{let St=j(()=>g(f)==="text"?"default":"outline");Qr(ct,{get variant(){return g(St)},size:"sm",onclick:()=>O(f,"text"),get disabled(){return g(m)},children:(Ze,nt)=>{var ht=UD(),kt=F(ht);Ch(kt,{class:"mr-1 h-4 w-4"}),Rt(),_(Ze,ht)},$$slots:{default:!0}})}var Ct=ae(ct,2);{let St=j(()=>g(f)==="pages"?"default":"outline");Qr(Ct,{get variant(){return g(St)},size:"sm",onclick:()=>{O(f,"pages"),v()},get disabled(){return g(m)},children:(Ze,nt)=>{var ht=jD(),kt=F(ht);{var Se=it=>{var yt=zD();_(it,yt)},Fe=it=>{F6(it,{class:"mr-1 h-4 w-4"})};ce(kt,it=>{g(m)?it(Se):it(Fe,!1)})}Rt(),_(Ze,ht)},$$slots:{default:!0}})}Q(lt),_(ot,lt)};ce(ze,ot=>{g(u)&&ot(Ge)})}Q(me),qe(()=>at(Qe,g(a))),_(_e,me)},$$slots:{default:!0}})});var q=ae(Z,2),re=te(q);{var X=P=>{var be=GD(),_e=te(be);Q(be),qe(()=>{Jt(_e,"src",g(i)),Jt(_e,"alt",g(n))}),_(P,be)},ie=P=>{var be=J(),_e=F(be);{var W=He=>{var Xe=J(),Le=F(Xe);{var bt=Ve=>{var We=WD();_(Ve,We)},Ie=Ve=>{var We=J(),Qe=F(We);{var mt=ze=>{var Ge=VD(),ot=te(Ge),lt=te(ot);Ch(lt,{class:"mx-auto mb-4 h-16 w-16 text-muted-foreground"});var ct=ae(lt,4),Ct=te(ct,!0);Q(ct);var St=ae(ct,2);Qr(St,{class:"mt-4",onclick:()=>O(f,"text"),children:(Ze,nt)=>{Rt();var ht=sr("View as Text");_(Ze,ht)},$$slots:{default:!0}}),Q(ot),Q(Ge),qe(()=>at(Ct,g(y))),_(ze,Ge)},Ke=ze=>{var Ge=J(),ot=F(Ge);{var lt=Ct=>{var St=$D();_n(St,22,()=>g(p),Ze=>Ze,(Ze,nt,ht)=>{var kt=XD(),Se=te(kt),Fe=te(Se);Q(Se);var it=ae(Se,2);Q(kt),qe(()=>{at(Fe,`Page ${g(ht)+1}`),Jt(it,"src",nt),Jt(it,"alt",`PDF Page ${g(ht)+1}`)}),_(Ze,kt)}),Q(St),_(Ct,St)},ct=Ct=>{var St=KD(),Ze=te(St),nt=te(Ze);Ch(nt,{class:"mx-auto mb-4 h-16 w-16 text-muted-foreground"}),Rt(2),Q(Ze),Q(St),_(Ct,St)};ce(ot,Ct=>{g(p).length>0?Ct(lt):Ct(ct,!1)},!0)}_(ze,Ge)};ce(Qe,ze=>{g(y)?ze(mt):ze(Ke,!1)},!0)}_(Ve,We)};ce(Le,Ve=>{g(m)?Ve(bt):Ve(Ie,!1)})}_(He,Xe)},me=He=>{var Xe=J(),Le=F(Xe);{var bt=Ve=>{var We=YD(),Qe=te(We,!0);Q(We),qe(()=>at(Qe,g(o))),_(Ve,We)},Ie=Ve=>{var We=J(),Qe=F(We);{var mt=ze=>{var Ge=eL(),ot=te(Ge),lt=te(ot);U6(lt,{class:"mx-auto mb-4 h-16 w-16 text-muted-foreground"});var ct=ae(lt,2);{var Ct=ht=>{var kt=JD();qe(()=>Jt(kt,"src",`data:${e.attachment.mimeType??""};base64,${e.attachment.base64Data??""}`)),_(ht,kt)},St=ht=>{var kt=J(),Se=F(kt);{var Fe=yt=>{var $t=QD();qe(()=>Jt($t,"src",e.uploadedFile.preview)),_(yt,$t)},it=yt=>{var $t=ZD();_(yt,$t)};ce(Se,yt=>{e.uploadedFile?.preview?yt(Fe):yt(it,!1)},!0)}_(ht,kt)};ce(ct,ht=>{e.attachment?.type==="audioFile"?ht(Ct):ht(St,!1)})}var Ze=ae(ct,2),nt=te(Ze,!0);Q(Ze),Q(ot),Q(Ge),qe(()=>at(nt,g(n))),_(ze,Ge)},Ke=ze=>{var Ge=tL(),ot=te(Ge),lt=te(ot);{var ct=Ct=>{var St=J(),Ze=F(St);ve(Ze,()=>g(d),(nt,ht)=>{ht(nt,{class:"mx-auto mb-4 h-16 w-16 text-muted-foreground"})}),_(Ct,St)};ce(lt,Ct=>{g(d)&&Ct(ct)})}Rt(2),Q(ot),Q(Ge),_(ze,Ge)};ce(Qe,ze=>{g(l)?ze(mt):ze(Ke,!1)},!0)}_(Ve,We)};ce(Le,Ve=>{(g(h)||g(u)&&g(f)==="text")&&g(o)?Ve(bt):Ve(Ie,!1)},!0)}_(He,Xe)};ce(_e,He=>{g(u)&&g(f)==="pages"?He(W):He(me,!1)},!0)}_(P,be)};ce(re,P=>{g(c)&&g(i)?P(X):P(ie,!1)})}Q(q),_(H,z)},$$slots:{default:!0}})}),_(k,R)},$$slots:{default:!0}})}),_(r,x),pe()}var iL=ee("<div></div>"),aL=ee("<!> <!>",1);function u7(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"attachments",19,()=>[]),i=L(e,"readonly",3,!1),a=L(e,"uploadedFiles",27,()=>Mr([])),s=L(e,"imageClass",3,""),o=L(e,"imageHeight",3,"h-24"),l=L(e,"imageWidth",3,"w-auto"),c=j(d),u=oe(!1),h=oe(null);function d(){const S=[];for(const A of a())S.push({id:A.id,name:A.name,size:A.size,preview:A.preview,type:A.type,isImage:da(A.type)===tn.IMAGE,uploadedFile:A,textContent:A.textContent});for(const[A,C]of n().entries())C.type==="imageFile"?S.push({id:`attachment-${A}`,name:C.name,preview:C.base64Url,type:"image",isImage:!0,attachment:C,attachmentIndex:A}):C.type==="textFile"?S.push({id:`attachment-${A}`,name:C.name,type:"text",isImage:!1,attachment:C,attachmentIndex:A,textContent:C.content}):C.type==="context"?S.push({id:`attachment-${A}`,name:C.name,type:"text",isImage:!1,attachment:C,attachmentIndex:A,textContent:C.content}):C.type==="audioFile"?S.push({id:`attachment-${A}`,name:C.name,type:C.mimeType||"audio",isImage:!1,attachment:C,attachmentIndex:A}):C.type==="pdfFile"&&S.push({id:`attachment-${A}`,name:C.name,type:"application/pdf",isImage:!1,attachment:C,attachmentIndex:A,textContent:C.content});return S}function f(S,A){A&&(A.preventDefault(),A.stopPropagation()),O(h,{uploadedFile:S.uploadedFile,attachment:S.attachment,preview:S.preview,name:S.name,type:S.type,size:S.size,textContent:S.textContent},!0),O(u,!0)}var p=aL(),m=F(p);{var y=S=>{var A=iL();_n(A,21,()=>g(c),C=>C.id,(C,k)=>{var I=J(),R=F(I);{var U=$=>{wL($,{class:"cursor-pointer",get id(){return g(k).id},get name(){return g(k).name},get preview(){return g(k).preview},get readonly(){return i()},get onRemove(){return e.onFileRemove},get height(){return o()},get width(){return l()},get imageClass(){return s()},onClick:H=>f(g(k),H)})},D=$=>{pL($,{class:"cursor-pointer",get id(){return g(k).id},get name(){return g(k).name},get type(){return g(k).type},get size(){return g(k).size},get readonly(){return i()},get onRemove(){return e.onFileRemove},get textContent(){return g(k).textContent},onClick:H=>f(g(k),H)})};ce(R,$=>{g(k).isImage&&g(k).preview?$(U):$(D,!1)})}_(C,I)}),Q(A),qe(()=>tr(A,1,`flex flex-wrap items-start ${i()?"justify-end":""} gap-3 ${t()??""}`)),_(S,A)};ce(m,S=>{g(c).length>0&&S(y)})}var v=ae(m,2);{var x=S=>{nL(S,{get uploadedFile(){return g(h).uploadedFile},get attachment(){return g(h).attachment},get preview(){return g(h).preview},get name(){return g(h).name},get type(){return g(h).type},get size(){return g(h).size},get textContent(){return g(h).textContent},get open(){return g(u)},set open(A){O(u,A,!0)}})};ce(v,S=>{g(h)&&S(x)})}_(r,p),pe()}var sL=ee('<span class="text-xs text-muted-foreground"> </span>'),oL=ee('<div class="pointer-events-none absolute right-0 bottom-0 left-0 h-6 bg-gradient-to-t from-muted to-transparent"></div>'),lL=ee('<div class="relative mt-2 w-full"><div class="overflow-hidden font-mono text-xs leading-relaxed break-words whitespace-pre-wrap text-muted-foreground"> </div> <!></div>'),cL=ee('<button type="button"><div class="flex items-start gap-3"><div class="flex min-w-0 flex-1 flex-col items-start text-left"><span class="w-full truncate text-sm font-medium text-foreground"> </span> <!> <!></div></div></button>'),uL=ee('<div class="pointer-events-none absolute right-0 bottom-0 left-0 h-4 bg-gradient-to-t from-muted to-transparent"></div>'),hL=ee('<div class="relative"><div class="overflow-hidden font-mono text-xs leading-relaxed break-words whitespace-pre-wrap text-muted-foreground" style="max-height: 3.6em; line-height: 1.2em;"> </div> <!></div>'),dL=ee('<div><!> <div class="pr-8"><span class="mb-3 block truncate text-sm font-medium text-foreground"> </span> <!></div></div>'),fL=ee('<span class="text-left text-xs text-muted-foreground"> </span>'),gL=ee('<button><div class="flex h-8 w-8 items-center justify-center rounded bg-primary/10 text-xs font-medium text-primary"> </div> <div class="flex flex-col gap-1"><span class="max-w-36 truncate text-sm font-medium text-foreground md:max-w-72"> </span> <!></div> <!></button>');function pL(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"readonly",3,!1);var i=J(),a=F(i);{var s=l=>{var c=J(),u=F(c);{var h=f=>{var p=cL();p.__click=function(...I){e.onClick?.apply(this,I)};var m=te(p),y=te(m),v=te(y),x=te(v,!0);Q(v);var S=ae(v,2);{var A=I=>{var R=sL(),U=te(R,!0);Q(R),qe(D=>at(U,D),[()=>ib(e.size)]),_(I,R)};ce(S,I=>{e.size&&I(A)})}var C=ae(S,2);{var k=I=>{var R=lL(),U=te(R),D=te(U,!0);Q(U);var $=ae(U,2);{var H=V=>{var z=oL();_(V,z)};ce($,V=>{e.textContent.length>150&&V(H)})}Q(R),qe(V=>at(D,V),[()=>c7(e.textContent)]),_(I,R)};ce(C,I=>{e.textContent&&e.type==="text"&&I(k)})}Q(y),Q(m),Q(p),qe(()=>{tr(p,1,`cursor-pointer rounded-lg border border-border bg-muted p-3 transition-shadow hover:shadow-md ${t()??""} w-full max-w-2xl`),Jt(p,"aria-label",`Preview ${e.name}`),at(x,e.name)}),_(f,p)},d=f=>{var p=dL(),m=te(p);Qr(m,{type:"button",variant:"ghost",size:"sm",class:"absolute top-2 right-2 h-6 w-6 bg-white/20 p-0 hover:bg-white/30",onclick:()=>e.onRemove?.(e.id),"aria-label":"Remove file",children:(C,k)=>{eo(C,{class:"h-3 w-3"})},$$slots:{default:!0}});var y=ae(m,2),v=te(y),x=te(v,!0);Q(v);var S=ae(v,2);{var A=C=>{var k=hL(),I=te(k),R=te(I,!0);Q(I);var U=ae(I,2);{var D=$=>{var H=uL();_($,H)};ce(U,$=>{e.textContent.length>150&&$(D)})}Q(k),qe($=>at(R,$),[()=>c7(e.textContent)]),_(C,k)};ce(S,C=>{e.textContent&&C(A)})}Q(y),Q(p),qe(()=>{tr(p,1,`relative rounded-lg border border-border bg-muted p-3 ${t()??""} w-64`),at(x,e.name)}),_(f,p)};ce(u,f=>{n()?f(h):f(d,!1)})}_(l,c)},o=l=>{var c=gL();c.__click=function(...S){e.onClick?.apply(this,S)};var u=te(c),h=te(u,!0);Q(u);var d=ae(u,2),f=te(d),p=te(f,!0);Q(f);var m=ae(f,2);{var y=S=>{var A=fL(),C=te(A,!0);Q(A),qe(k=>at(C,k),[()=>ib(e.size)]),_(S,A)};ce(m,S=>{e.size&&S(y)})}Q(d);var v=ae(d,2);{var x=S=>{Qr(S,{type:"button",variant:"ghost",size:"sm",class:"h-6 w-6 p-0",onclick:A=>{A.stopPropagation(),e.onRemove?.(e.id)},children:(A,C)=>{eo(A,{class:"h-3 w-3"})},$$slots:{default:!0}})};ce(v,S=>{n()||S(x)})}Q(c),qe(S=>{tr(c,1,`flex items-center gap-2 gap-3 rounded-lg border border-border bg-muted p-3 ${t()??""}`),at(h,S),at(p,e.name)},[()=>LD(e.type)]),_(l,c)};ce(a,l=>{e.type===_r.PLAIN||e.type===tn.TEXT?l(s):l(o,!1)})}_(r,i),pe()}wi(["click"]);var mL=ee('<button type="button" class="block h-full w-full rounded-lg focus:ring-2 focus:ring-primary focus:ring-offset-2 focus:outline-none"><img/></button>'),bL=ee("<img/>"),vL=ee('<div class="absolute top-1 right-1 flex items-center justify-center opacity-0 transition-opacity hover:opacity-100"><!></div>'),yL=ee("<div><!> <!></div>");function wL(r,e){ge(e,!0);let t=L(e,"readonly",3,!1),n=L(e,"class",3,""),i=L(e,"width",3,"w-auto"),a=L(e,"height",3,"h-24"),s=L(e,"imageClass",3,"");var o=yL(),l=te(o);{var c=f=>{var p=mL();p.__click=function(...y){e.onClick?.apply(this,y)};var m=te(p);Q(p),qe(()=>{Jt(p,"aria-label",`Preview ${e.name??""}`),Jt(m,"src",e.preview),Jt(m,"alt",e.name),tr(m,1,`${a()??""} ${i()??""} cursor-pointer object-cover ${s()??""}`)}),_(f,p)},u=f=>{var p=bL();qe(()=>{Jt(p,"src",e.preview),Jt(p,"alt",e.name),tr(p,1,`${a()??""} ${i()??""} cursor-pointer object-cover ${s()??""}`)}),_(f,p)};ce(l,f=>{e.onClick?f(c):f(u,!1)})}var h=ae(l,2);{var d=f=>{var p=vL(),m=te(p);Qr(m,{type:"button",variant:"ghost",size:"sm",class:"h-6 w-6 bg-white/20 p-0 text-white hover:bg-white/30",onclick:()=>e.onRemove?.(e.id),children:(y,v)=>{eo(y,{class:"h-3 w-3"})},$$slots:{default:!0}}),Q(p),_(f,p)};ce(h,f=>{t()||f(d)})}Q(o),qe(()=>tr(o,1,`relative overflow-hidden rounded-lg border border-border bg-muted ${n()??""}`)),_(r,o),pe()}wi(["click"]);const ab=`
bg-muted/70 dark:bg-muted/85
border border-border/30 focus-within:border-border dark:border-border/20 dark:focus-within:border-border
outline-none
text-foreground
`,La={apiKey:"",systemMessage:"",theme:"system",showTokensPerSecond:!1,showThoughtInProgress:!1,disableReasoningFormat:!1,keepStatsVisible:!1,askForTitleConfirmation:!1,pasteLongTextToFileLen:2500,pdfAsImage:!1,showModelInfo:!1,renderUserContentAsMarkdown:!1,modelSelectorEnabled:!1,samplers:"top_k;typ_p;top_p;min_p;temperature",temperature:.8,dynatemp_range:0,dynatemp_exponent:1,top_k:40,top_p:.95,min_p:.05,xtc_probability:0,xtc_threshold:.1,typ_p:1,repeat_last_n:64,repeat_penalty:1,presence_penalty:0,frequency_penalty:0,dry_multiplier:0,dry_base:1.75,dry_allowed_length:2,dry_penalty_last_n:-1,max_tokens:-1,custom:"",pyInterpreterEnabled:!1},Qo={apiKey:"Set the API Key if you are using --api-key option for the server.",systemMessage:"The starting message that defines how model should behave.",theme:"Choose the color theme for the interface. You can choose between System (follows your device settings), Light, or Dark.",pasteLongTextToFileLen:"On pasting long text, it will be converted to a file. You can control the file length by setting the value of this parameter. Value 0 means disable.",samplers:'The order at which samplers are applied, in simplified way. Default is "top_k;typ_p;top_p;min_p;temperature": top_k->typ_p->top_p->min_p->temperature',temperature:"Controls the randomness of the generated text by affecting the probability distribution of the output tokens. Higher = more random, lower = more focused.",dynatemp_range:"Addon for the temperature sampler. The added value to the range of dynamic temperature, which adjusts probabilities by entropy of tokens.",dynatemp_exponent:"Addon for the temperature sampler. Smoothes out the probability redistribution based on the most probable token.",top_k:"Keeps only k top tokens.",top_p:"Limits tokens to those that together have a cumulative probability of at least p",min_p:"Limits tokens based on the minimum probability for a token to be considered, relative to the probability of the most likely token.",xtc_probability:"XTC sampler cuts out top tokens; this parameter controls the chance of cutting tokens at all. 0 disables XTC.",xtc_threshold:"XTC sampler cuts out top tokens; this parameter controls the token probability that is required to cut that token.",typ_p:"Sorts and limits tokens based on the difference between log-probability and entropy.",repeat_last_n:"Last n tokens to consider for penalizing repetition",repeat_penalty:"Controls the repetition of token sequences in the generated text",presence_penalty:"Limits tokens based on whether they appear in the output or not.",frequency_penalty:"Limits tokens based on how often they appear in the output.",dry_multiplier:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling multiplier.",dry_base:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling base value.",dry_allowed_length:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the allowed length for DRY sampling.",dry_penalty_last_n:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets DRY penalty for the last n tokens.",max_tokens:"The maximum number of token per output. Use -1 for infinite (no limit).",custom:"Custom JSON parameters to send to the API. Must be valid JSON format.",showTokensPerSecond:"Display generation speed in tokens per second during streaming.",showThoughtInProgress:"Expand thought process by default when generating messages.",disableReasoningFormat:"Show raw LLM output without backend parsing and frontend Markdown rendering to inspect streaming across different models.",keepStatsVisible:"Keep processing statistics visible after generation finishes.",askForTitleConfirmation:"Ask for confirmation before automatically changing conversation title when editing the first message.",pdfAsImage:"Parse PDF as image instead of text (requires vision-capable model).",showModelInfo:"Display the model name used to generate each message below the message content.",renderUserContentAsMarkdown:"Render user messages using markdown formatting in the chat.",modelSelectorEnabled:"Enable the model selector in the chat input to choose the inference model. Sends the associated model field in API requests.",pyInterpreterEnabled:"Enable Python interpreter using Pyodide. Allows running Python code in markdown code blocks."},h7=1e6;function io(r){return typeof r=="number"?Math.round(r*h7)/h7:r}const _f=[{key:"temperature",serverKey:"temperature",type:"number",canSync:!0},{key:"top_k",serverKey:"top_k",type:"number",canSync:!0},{key:"top_p",serverKey:"top_p",type:"number",canSync:!0},{key:"min_p",serverKey:"min_p",type:"number",canSync:!0},{key:"dynatemp_range",serverKey:"dynatemp_range",type:"number",canSync:!0},{key:"dynatemp_exponent",serverKey:"dynatemp_exponent",type:"number",canSync:!0},{key:"xtc_probability",serverKey:"xtc_probability",type:"number",canSync:!0},{key:"xtc_threshold",serverKey:"xtc_threshold",type:"number",canSync:!0},{key:"typ_p",serverKey:"typ_p",type:"number",canSync:!0},{key:"repeat_last_n",serverKey:"repeat_last_n",type:"number",canSync:!0},{key:"repeat_penalty",serverKey:"repeat_penalty",type:"number",canSync:!0},{key:"presence_penalty",serverKey:"presence_penalty",type:"number",canSync:!0},{key:"frequency_penalty",serverKey:"frequency_penalty",type:"number",canSync:!0},{key:"dry_multiplier",serverKey:"dry_multiplier",type:"number",canSync:!0},{key:"dry_base",serverKey:"dry_base",type:"number",canSync:!0},{key:"dry_allowed_length",serverKey:"dry_allowed_length",type:"number",canSync:!0},{key:"dry_penalty_last_n",serverKey:"dry_penalty_last_n",type:"number",canSync:!0},{key:"max_tokens",serverKey:"max_tokens",type:"number",canSync:!0},{key:"samplers",serverKey:"samplers",type:"string",canSync:!0}];class Zo{static roundFloatingPoint(e){return io(e)}static extractServerDefaults(e){if(!e)return{};const t={};for(const n of _f)if(n.canSync&&n.serverKey in e){const i=e[n.serverKey];i!==void 0&&(t[n.key]=this.roundFloatingPoint(i))}return e.samplers&&Array.isArray(e.samplers)&&(t.samplers=e.samplers.join(";")),t}static mergeWithServerDefaults(e,t,n=new Set){const i={...e};for(const[a,s]of Object.entries(t))n.has(a)||(i[a]=this.roundFloatingPoint(s));return i}static getParameterInfo(e,t,n,i){const a=n[e]!==void 0,s=i.has(e);return{value:t,source:s?"custom":"default",serverDefault:a?n[e]:void 0,userOverride:s?t:void 0}}static canSyncParameter(e){return _f.some(t=>t.key===e&&t.canSync)}static getSyncableParameterKeys(){return _f.filter(e=>e.canSync).map(e=>e.key)}static validateServerParameter(e,t){const n=_f.find(i=>i.key===e);if(!n)return!1;switch(n.type){case"number":return typeof t=="number"&&!isNaN(t);case"string":return typeof t=="string";case"boolean":return typeof t=="boolean";default:return!1}}static createParameterDiff(e,t){const n={};for(const i of this.getSyncableParameterKeys()){const a=e[i],s=t[i];s!==void 0&&(n[i]={current:a,server:s,differs:a!==s})}return n}}const sb="LlamaCppWebui.serverProps",xL="LlamaCppWebui.selectedModel";class SL{static async list(){const t=fn().apiKey?.toString().trim(),n=await fetch(`${ua}/v1/models`,{headers:{...t?{Authorization:`Bearer ${t}`}:{}}});if(!n.ok)throw new Error(`Failed to fetch model list (status ${n.status})`);return n.json()}}function kL(r,e){let t=e;try{const i=localStorage.getItem(r);i!==null&&(t=JSON.parse(i))}catch(i){console.warn(`Failed to load ${r}:`,i)}const n=i=>{try{if(i==null){localStorage.removeItem(r);return}localStorage.setItem(r,JSON.stringify(i))}catch(a){console.warn(`Failed to persist ${r}:`,a)}};return{get value(){return t},set value(i){t=i,n(i)}}}class AL{#e=oe(Mr([]));get _models(){return g(this.#e)}set _models(e){O(this.#e,e,!0)}#t=oe(!1);get _loading(){return g(this.#t)}set _loading(e){O(this.#t,e,!0)}#r=oe(!1);get _updating(){return g(this.#r)}set _updating(e){O(this.#r,e,!0)}#n=oe(null);get _error(){return g(this.#n)}set _error(e){O(this.#n,e,!0)}#a=oe(null);get _selectedModelId(){return g(this.#a)}set _selectedModelId(e){O(this.#a,e,!0)}#i=oe(null);get _selectedModelName(){return g(this.#i)}set _selectedModelName(e){O(this.#i,e,!0)}_persistedSelection=kL(xL,null);constructor(){const e=this._persistedSelection.value;e&&(this._selectedModelId=e.id,this._selectedModelName=e.model)}get models(){return this._models}get loading(){return this._loading}get updating(){return this._updating}get error(){return this._error}get selectedModelId(){return this._selectedModelId}get selectedModelName(){return this._selectedModelName}get selectedModel(){return this._selectedModelId?this._models.find(e=>e.id===this._selectedModelId)??null:null}async fetch(e=!1){if(!this._loading&&!(this._models.length>0&&!e)){this._loading=!0,this._error=null;try{const t=await SL.list(),n=t.data.map((a,s)=>{const o=t.models?.[s],l=Array.isArray(o?.capabilities)?o?.capabilities:[],c=o?.name&&o.name.trim().length>0?o.name:a.id,u=this.toDisplayName(c);return{id:a.id,name:u,model:o?.model||a.id,description:o?.description,capabilities:l.filter(h=>!!h),details:o?.details,meta:a.meta??null}});this._models=n;const i=this.determineInitialSelection(n);this._selectedModelId=i.id,this._selectedModelName=i.model,this._persistedSelection.value=i.id&&i.model?{id:i.id,model:i.model}:null}catch(t){throw this._models=[],this._error=t instanceof Error?t.message:"Failed to load models",t}finally{this._loading=!1}}}async select(e){if(!e||this._updating||this._selectedModelId===e)return;const t=this._models.find(n=>n.id===e);if(!t)throw new Error("Selected model is not available");this._updating=!0,this._error=null;try{this._selectedModelId=t.id,this._selectedModelName=t.model,this._persistedSelection.value={id:t.id,model:t.model}}finally{this._updating=!1}}toDisplayName(e){const n=e.split(/\\|\//).pop();return n&&n.trim().length>0?n:e}determineInitialSelection(e){const t=this._persistedSelection.value;let n=this._selectedModelId??t?.id??null,i=this._selectedModelName??t?.model??null;if(n){const a=e.find(s=>s.id===n);a?(n=a.id,i=a.model):e[0]?(n=e[0].id,i=e[0].model):(n=null,i=null)}else e[0]&&(n=e[0].id,i=e[0].model);return{id:n,model:i}}}const As=new AL,_L=()=>As.models,CL=()=>As.loading,EL=()=>As.updating,TL=()=>As.error,IL=()=>As.selectedModelId,ML=()=>As.selectedModelName,OL=As.fetch.bind(As),NL=As.select.bind(As);class RL{callbacks=new Set;isStreamingActive=!1;lastKnownState=null;conversationStates=new Map;activeConversationId=null;startStreaming(){this.isStreamingActive=!0}stopStreaming(){this.isStreamingActive=!1}clearState(){this.lastKnownState=null;for(const e of this.callbacks)try{e(null)}catch(t){console.error("Error in clearState callback:",t)}}isStreaming(){return this.isStreamingActive}setActiveConversation(e){this.activeConversationId=e,this.notifyCallbacks()}updateConversationState(e,t){this.conversationStates.set(e,t),e===this.activeConversationId&&(this.lastKnownState=t,this.notifyCallbacks())}getConversationState(e){return this.conversationStates.get(e)||null}clearConversationState(e){this.conversationStates.delete(e),e===this.activeConversationId&&(this.lastKnownState=null,this.notifyCallbacks())}notifyCallbacks(){const e=this.activeConversationId?this.conversationStates.get(this.activeConversationId)||null:this.lastKnownState;for(const t of this.callbacks)try{t(e)}catch(n){console.error("Error in slots service callback:",n)}}fetchAndNotify(){console.warn("SlotsService.fetchAndNotify() is deprecated - use timing data from ChatService instead")}subscribe(e){return this.callbacks.add(e),this.lastKnownState&&e(this.lastKnownState),()=>{this.callbacks.delete(e)}}async updateFromTimingData(e,t){const n=await this.parseCompletionTimingData(e);if(n===null){console.warn("Failed to parse timing data - skipping update");return}t?this.updateConversationState(t,n):(this.lastKnownState=n,this.notifyCallbacks())}async getContextTotal(){if(this.lastKnownState&&this.lastKnownState.contextTotal>0)return this.lastKnownState.contextTotal;try{const t=fn().apiKey?.toString().trim(),n=await fetch("./slots",{headers:{...t?{Authorization:`Bearer ${t}`}:{}}});if(n.ok){const i=await n.json();if(Array.isArray(i)&&i.length>0){const a=i[0];if(a.n_ctx&&a.n_ctx>0)return a.n_ctx}}}catch(e){console.warn("Failed to fetch context total from /slots:",e)}return 4096}async parseCompletionTimingData(e){const t=e.prompt_n||0,n=e.predicted_n||0,i=e.predicted_per_second||0,a=e.cache_n||0,s=e.prompt_progress,o=await this.getContextTotal();if(o===null)return console.warn("No context total available - cannot calculate processing state"),null;const l=fn(),c=l.max_tokens||-1,u=t+a+n,h=n,d=s?Math.round(s.processed/s.total*100):void 0;return{status:n>0?"generating":s?"preparing":"idle",tokensDecoded:n,tokensRemaining:c-n,contextUsed:u,contextTotal:o,outputTokensUsed:h,outputTokensMax:c,hasNextToken:n>0,tokensPerSecond:i,temperature:l.temperature??.8,topP:l.top_p??.95,speculative:!1,progressPercent:d,promptTokens:t,cacheTokens:a}}async getCurrentState(){if(this.activeConversationId){const e=this.conversationStates.get(this.activeConversationId);if(e)return e}if(this.lastKnownState)return this.lastKnownState;try{const{chatStore:e}=await zc(async()=>{const{chatStore:n}=await Promise.resolve().then(()=>nz);return{chatStore:n}},void 0,Fr&&Fr.tagName.toUpperCase()==="SCRIPT"&&Fr.src||new URL("_app/immutable/bundle.DkfpbWnE.js",document.baseURI).href),t=e.activeMessages;for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.role==="assistant"&&i.timings){const a=await this.parseCompletionTimingData({prompt_n:i.timings.prompt_n||0,predicted_n:i.timings.predicted_n||0,predicted_per_second:i.timings.predicted_n&&i.timings.predicted_ms?i.timings.predicted_n/i.timings.predicted_ms*1e3:0,cache_n:i.timings.cache_n||0});if(a)return this.lastKnownState=a,a}}}catch(e){console.warn("Failed to restore timing data from messages:",e)}return null}}const Pn=new RL;class Cf{abortControllers=new Map;async sendMessage(e,t={},n){const{stream:i,onChunk:a,onComplete:s,onError:o,onReasoningChunk:l,onModel:c,temperature:u,max_tokens:h,dynatemp_range:d,dynatemp_exponent:f,top_k:p,top_p:m,min_p:y,xtc_probability:v,xtc_threshold:x,typ_p:S,repeat_last_n:A,repeat_penalty:C,presence_penalty:k,frequency_penalty:I,dry_multiplier:R,dry_base:U,dry_allowed_length:D,dry_penalty_last_n:$,samplers:H,custom:V,timings_per_token:z}=t,Z=fn(),q=n||"default";this.abortControllers.has(q)&&this.abortControllers.get(q)?.abort();const re=new AbortController;this.abortControllers.set(q,re);const X=e.map(W=>{if("id"in W&&"convId"in W&&"timestamp"in W){const me=W;return Cf.convertMessageToChatServiceData(me)}else return W}).filter(W=>W.role==="system"?(typeof W.content=="string"?W.content:"").trim().length>0:!0),P={messages:this.injectSystemMessage(X).map(W=>({role:W.role,content:W.content})),stream:i},be=!!Z.modelSelectorEnabled,_e=be?ML():null;if(be&&_e&&(P.model=_e),P.reasoning_format=Z.disableReasoningFormat?"none":"auto",u!==void 0&&(P.temperature=u),h!==void 0&&(P.max_tokens=h!==null&&h!==0?h:-1),d!==void 0&&(P.dynatemp_range=d),f!==void 0&&(P.dynatemp_exponent=f),p!==void 0&&(P.top_k=p),m!==void 0&&(P.top_p=m),y!==void 0&&(P.min_p=y),v!==void 0&&(P.xtc_probability=v),x!==void 0&&(P.xtc_threshold=x),S!==void 0&&(P.typ_p=S),A!==void 0&&(P.repeat_last_n=A),C!==void 0&&(P.repeat_penalty=C),k!==void 0&&(P.presence_penalty=k),I!==void 0&&(P.frequency_penalty=I),R!==void 0&&(P.dry_multiplier=R),U!==void 0&&(P.dry_base=U),D!==void 0&&(P.dry_allowed_length=D),$!==void 0&&(P.dry_penalty_last_n=$),H!==void 0&&(P.samplers=typeof H=="string"?H.split(";").filter(W=>W.trim()):H),z!==void 0&&(P.timings_per_token=z),V)try{const W=typeof V=="string"?JSON.parse(V):V;Object.assign(P,W)}catch(W){console.warn("Failed to parse custom parameters:",W)}try{const W=Z.apiKey?.toString().trim(),me=await fetch("./v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",...W?{Authorization:`Bearer ${W}`}:{}},body:JSON.stringify(P),signal:re.signal});if(!me.ok){const He=await this.parseErrorResponse(me);throw o&&o(He),He}if(i){await this.handleStreamResponse(me,a,s,o,l,c,n,re.signal);return}else return this.handleNonStreamResponse(me,s,o,c)}catch(W){if(W instanceof Error&&W.name==="AbortError"){console.log("Chat completion request was aborted");return}let me;throw W instanceof Error?W.name==="TypeError"&&W.message.includes("fetch")?(me=new Error("Unable to connect to server - please check if the server is running"),me.name="NetworkError"):W.message.includes("ECONNREFUSED")?(me=new Error("Connection refused - server may be offline"),me.name="NetworkError"):W.message.includes("ETIMEDOUT")?(me=new Error("Request timed out - the server took too long to respond"),me.name="TimeoutError"):me=W:me=new Error("Unknown error occurred while sending message"),console.error("Error in sendMessage:",W),o&&o(me),me}finally{this.abortControllers.delete(q)}}async handleStreamResponse(e,t,n,i,a,s,o,l){const c=e.body?.getReader();if(!c)throw new Error("No response body");const u=new TextDecoder;let h="",d="",f=!1,p,m=!1,y=!1;try{let v="";for(;!l?.aborted;){const{done:x,value:S}=await c.read();if(x||l?.aborted)break;v+=u.decode(S,{stream:!0});const A=v.split(`
`);v=A.pop()||"";for(const C of A){if(l?.aborted)break;if(C.startsWith("data: ")){const k=C.slice(6);if(k==="[DONE]"){m=!0;continue}try{const I=JSON.parse(k),R=this.extractModelName(I);R&&!y&&(y=!0,s?.(R));const U=I.choices[0]?.delta?.content,D=I.choices[0]?.delta?.reasoning_content,$=I.timings,H=I.prompt_progress;($||H)&&(this.updateProcessingState($,H,o),$&&(p=$)),U&&(f=!0,h+=U,l?.aborted||t?.(U)),D&&(f=!0,d+=D,l?.aborted||a?.(D))}catch(I){console.error("Error parsing JSON chunk:",I)}}}if(l?.aborted)break}if(l?.aborted)return;if(m){if(!f&&h.length===0)throw new Error("No response received from server. Please try again.");n?.(h,d||void 0,p)}}catch(v){const x=v instanceof Error?v:new Error("Stream error");throw i?.(x),x}finally{c.releaseLock()}}async handleNonStreamResponse(e,t,n,i){try{const a=await e.text();if(!a.trim())throw new Error("No response received from server. Please try again.");const s=JSON.parse(a),o=this.extractModelName(s);o&&i?.(o);const l=s.choices[0]?.message?.content||"",c=s.choices[0]?.message?.reasoning_content;if(c&&console.log("Full reasoning content:",c),!l.trim())throw new Error("No response received from server. Please try again.");return t?.(l,c),l}catch(a){const s=a instanceof Error?a:new Error("Parse error");throw n?.(s),s}}static convertMessageToChatServiceData(e){if(!e.extra||e.extra.length===0)return{role:e.role,content:e.content};const t=[];e.content&&t.push({type:"text",text:e.content});const n=e.extra.filter(l=>l.type==="imageFile");for(const l of n)t.push({type:"image_url",image_url:{url:l.base64Url}});const i=e.extra.filter(l=>l.type==="textFile");for(const l of i)t.push({type:"text",text:`
--- File: ${l.name} ---
${l.content}`});const a=e.extra.filter(l=>l.type==="context");for(const l of a)t.push({type:"text",text:`
--- File: ${l.name} ---
${l.content}`});const s=e.extra.filter(l=>l.type==="audioFile");for(const l of s)t.push({type:"input_audio",input_audio:{data:l.base64Data,format:l.mimeType.includes("wav")?"wav":"mp3"}});const o=e.extra.filter(l=>l.type==="pdfFile");for(const l of o)if(l.processedAsImages&&l.images)for(let c=0;c<l.images.length;c++)t.push({type:"image_url",image_url:{url:l.images[c]}});else t.push({type:"text",text:`
--- PDF File: ${l.name} ---
${l.content}`});return{role:e.role,content:t}}static async getServerProps(){try{const t=fn().apiKey?.toString().trim(),n=await fetch("./props",{headers:{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{}}});if(!n.ok)throw new Error(`Failed to fetch server props: ${n.status}`);return await n.json()}catch(e){throw console.error("Error fetching server props:",e),e}}abort(e){if(e){const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))}else{for(const t of this.abortControllers.values())t.abort();this.abortControllers.clear()}}injectSystemMessage(e){const n=fn().systemMessage?.toString().trim();if(!n)return e;if(e.length>0&&e[0].role==="system"){if(e[0].content!==n){const a=[...e];return a[0]={role:"system",content:n},a}return e}return[{role:"system",content:n},...e]}async parseErrorResponse(e){try{const t=await e.text(),i=JSON.parse(t).error?.message||"Unknown server error",a=new Error(i);return a.name=e.status===400?"ServerError":"HttpError",a}catch{const t=new Error(`Server error (${e.status}): ${e.statusText}`);return t.name="HttpError",t}}extractModelName(e){const t=c=>typeof c=="object"&&c!==null?c:void 0,n=c=>typeof c=="string"&&c.trim()?c.trim():void 0,i=t(e);if(!i)return;const a=n(i.model);if(a)return a;const s=Array.isArray(i.choices)?t(i.choices[0]):void 0;if(!s)return;const o=n(t(s.delta)?.model);if(o)return o;const l=n(t(s.message)?.model);if(l)return l}updateProcessingState(e,t,n){const i=e?.predicted_ms&&e?.predicted_n?e.predicted_n/e.predicted_ms*1e3:0;Pn.updateFromTimingData({prompt_n:e?.prompt_n||0,predicted_n:e?.predicted_n||0,predicted_per_second:i,cache_n:e?.cache_n||0,prompt_progress:t},n).catch(a=>{console.warn("Failed to update processing state:",a)})}}const ob=new Cf;class PL{constructor(){const e=this.readCachedServerProps();e&&(this._serverProps=e)}#e=oe(null);get _serverProps(){return g(this.#e)}set _serverProps(e){O(this.#e,e,!0)}#t=oe(!1);get _loading(){return g(this.#t)}set _loading(e){O(this.#t,e,!0)}#r=oe(null);get _error(){return g(this.#r)}set _error(e){O(this.#r,e,!0)}#n=oe(null);get _serverWarning(){return g(this.#n)}set _serverWarning(e){O(this.#n,e,!0)}#a=oe(null);get _slotsEndpointAvailable(){return g(this.#a)}set _slotsEndpointAvailable(e){O(this.#a,e,!0)}readCachedServerProps(){try{const e=localStorage.getItem(sb);return e?JSON.parse(e):null}catch(e){return console.warn("Failed to read cached server props from localStorage:",e),null}}persistServerProps(e){try{e?localStorage.setItem(sb,JSON.stringify(e)):localStorage.removeItem(sb)}catch(t){console.warn("Failed to persist server props to localStorage:",t)}}get serverProps(){return this._serverProps}get loading(){return this._loading}get error(){return this._error}get serverWarning(){return this._serverWarning}get modelName(){return this._serverProps?.model_path&&this._serverProps.model_path.split(/(\\|\/)/).pop()||null}get supportedModalities(){const e=[];return this._serverProps?.modalities?.audio&&e.push("audio"),this._serverProps?.modalities?.vision&&e.push("vision"),e}get supportsVision(){return this._serverProps?.modalities?.vision??!1}get supportsAudio(){return this._serverProps?.modalities?.audio??!1}get slotsEndpointAvailable(){return this._slotsEndpointAvailable}get serverDefaultParams(){return this._serverProps?.default_generation_settings?.params||null}async checkSlotsEndpointAvailability(){if(!this._serverProps){this._slotsEndpointAvailable=!1;return}if(this._serverProps.total_slots<=0){this._slotsEndpointAvailable=!1;return}try{const t=fn().apiKey?.toString().trim();if((await fetch("./slots",{headers:{...t?{Authorization:`Bearer ${t}`}:{}}})).status===501){console.info("Slots endpoint not implemented - server started without --slots flag"),this._slotsEndpointAvailable=!1;return}this._slotsEndpointAvailable=!0}catch(e){console.warn("Unable to test slots endpoint availability:",e),this._slotsEndpointAvailable=!1}}async fetchServerProps(){this._loading=!0,this._error=null,this._serverWarning=null;try{console.log("Fetching server properties...");const e=await Cf.getServerProps();this._serverProps=e,this.persistServerProps(e),console.log("Server properties loaded:",e),await this.checkSlotsEndpointAvailability()}catch(e){const t=this._serverProps!==null;let n="Failed to connect to server",i=!1,a=!1;e instanceof Error&&(e.name==="TypeError"&&e.message.includes("fetch")?(n="Server is not running or unreachable",i=!0):e.message.includes("ECONNREFUSED")?(n="Connection refused - server may be offline",i=!0):e.message.includes("ENOTFOUND")?(n="Server not found - check server address",i=!0):e.message.includes("ETIMEDOUT")?(n="Request timed out - the server took too long to respond",i=!0):e.message.includes("503")?(n="Server temporarily unavailable - try again shortly",a=!0):e.message.includes("500")?(n="Server error - check server logs",a=!0):e.message.includes("404")?n="Server endpoint not found":(e.message.includes("403")||e.message.includes("401"))&&(n="Access denied"));let s=null;t?(this._error=null,(i||a)&&(this._serverWarning=n),console.warn("Failed to refresh server properties, continuing with cached values:",n)):(s=this.readCachedServerProps(),s?(this._serverProps=s,this._error=null,(i||a)&&(this._serverWarning=n),console.warn("Failed to refresh server properties, using cached values from localStorage:",n)):this._error=n),console.error("Error fetching server properties:",e)}finally{this._loading=!1}}clear(){this._serverProps=null,this._error=null,this._serverWarning=null,this._loading=!1,this._slotsEndpointAvailable=null,this.persistServerProps(null)}}const Kn=new PL,FL=()=>Kn.serverProps,du=()=>Kn.loading,DL=()=>Kn.error,d7=()=>Kn.serverWarning,f7=()=>Kn.modelName,Za=()=>Kn.supportsVision,el=()=>Kn.supportsAudio;function Kh(r,e,t){e in r&&(r[e]=t)}function Yh(r,e){return r[e]}function LL(r,e){const t={};for(const n of e){const i=Yh(r,n);i!==void 0&&(t[n]=i)}return t}class BL{#e=oe(Mr({...La}));get config(){return g(this.#e)}set config(e){O(this.#e,e,!0)}#t=oe("auto");get theme(){return g(this.#t)}set theme(e){O(this.#t,e,!0)}#r=oe(!1);get isInitialized(){return g(this.#r)}set isInitialized(e){O(this.#r,e,!0)}#n=oe(Mr(new Set));get userOverrides(){return g(this.#n)}set userOverrides(e){O(this.#n,e,!0)}getServerDefaults(){const e=Kn.serverDefaultParams;return e?Zo.extractServerDefaults(e):{}}constructor(){this.initialize()}initialize(){try{this.loadConfig(),this.loadTheme(),this.isInitialized=!0}catch(e){console.error("Failed to initialize settings store:",e)}}loadConfig(){try{const e=localStorage.getItem("config"),t=JSON.parse(e||"{}");this.config={...La,...t};const n=JSON.parse(localStorage.getItem("userOverrides")||"[]");this.userOverrides=new Set(n)}catch(e){console.warn("Failed to parse config from localStorage, using defaults:",e),this.config={...La},this.userOverrides=new Set}}loadTheme(){this.theme=localStorage.getItem("theme")||"auto"}updateConfig(e,t){if(this.config[e]=t,Zo.canSyncParameter(e)){const i=this.getServerDefaults()[e];if(i!==void 0){const a=io(t),s=io(i);a===s?this.userOverrides.delete(e):this.userOverrides.add(e)}}this.saveConfig()}updateMultipleConfig(e){Object.assign(this.config,e);const t=this.getServerDefaults();for(const[n,i]of Object.entries(e))if(Zo.canSyncParameter(n)){const a=t[n];if(a!==void 0){const s=io(i),o=io(a);s===o?this.userOverrides.delete(n):this.userOverrides.add(n)}}this.saveConfig()}saveConfig(){try{localStorage.setItem("config",JSON.stringify(this.config)),localStorage.setItem("userOverrides",JSON.stringify(Array.from(this.userOverrides)))}catch(e){console.error("Failed to save config to localStorage:",e)}}updateTheme(e){this.theme=e,this.saveTheme()}saveTheme(){try{this.theme==="auto"?localStorage.removeItem("theme"):localStorage.setItem("theme",this.theme)}catch(e){console.error("Failed to save theme to localStorage:",e)}}resetConfig(){this.config={...La},this.saveConfig()}resetTheme(){this.theme="auto",this.saveTheme()}resetAll(){this.resetConfig(),this.resetTheme()}getConfig(e){return this.config[e]}getAllConfig(){return{...this.config}}syncWithServerDefaults(){if(!Kn.serverDefaultParams){console.warn("No server parameters available for initialization");return}const t=this.getServerDefaults();for(const[n,i]of Object.entries(t)){const a=Yh(this.config,n),s=io(a),o=io(i);s===o?(this.userOverrides.delete(n),Kh(this.config,n,i)):this.userOverrides.has(n)||Kh(this.config,n,i)}this.saveConfig(),console.log("Settings initialized with props defaults:",t),console.log("Current user overrides after sync:",Array.from(this.userOverrides))}clearAllUserOverrides(){this.userOverrides.clear(),this.saveConfig(),console.log("Cleared all user overrides")}forceSyncWithServerDefaults(){const e=this.getServerDefaults(),t=Zo.getSyncableParameterKeys();for(const n of t){if(e[n]!==void 0){const i=io(e[n]);Kh(this.config,n,i)}else if(n in La){const i=Yh(La,n);Kh(this.config,n,i)}this.userOverrides.delete(n)}this.saveConfig()}getParameterInfo(e){const t=this.getServerDefaults(),n=Yh(this.config,e);return Zo.getParameterInfo(e,n??"",t,this.userOverrides)}resetParameterToServerDefault(e){const t=this.getServerDefaults();if(t[e]!==void 0){const n=io(t[e]);this.config[e]=n}else if(e in La){const n=Yh(La,e);Kh(this.config,e,n)}this.userOverrides.delete(e),this.saveConfig()}getParameterDiff(){const e=this.getServerDefaults();if(Object.keys(e).length===0)return{};const t=LL(this.config,Zo.getSyncableParameterKeys());return Zo.createParameterDiff(t,e)}}const nn=new BL,fn=()=>nn.config,UL=nn.updateConfig.bind(nn),zL=nn.updateMultipleConfig.bind(nn);nn.updateTheme.bind(nn),nn.resetConfig.bind(nn),nn.resetTheme.bind(nn),nn.resetAll.bind(nn),nn.getConfig.bind(nn),nn.getAllConfig.bind(nn),nn.syncWithServerDefaults.bind(nn);const jL=nn.forceSyncWithServerDefaults.bind(nn),HL=nn.getParameterInfo.bind(nn),g7=nn.resetParameterToServerDefault.bind(nn);nn.getParameterDiff.bind(nn),nn.clearAllUserOverrides.bind(nn);class qL{mediaRecorder=null;audioChunks=[];stream=null;recordingState=!1;async startRecording(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),this.initializeRecorder(this.stream),this.audioChunks=[],this.mediaRecorder.start(100),this.recordingState=!0}catch(e){throw console.error("Failed to start recording:",e),new Error("Failed to access microphone. Please check permissions.")}}async stopRecording(){return new Promise((e,t)=>{if(!this.mediaRecorder||this.mediaRecorder.state==="inactive"){t(new Error("No active recording to stop"));return}this.mediaRecorder.onstop=()=>{const n=this.mediaRecorder?.mimeType||Ai.WAV,i=new Blob(this.audioChunks,{type:n});this.cleanup(),e(i)},this.mediaRecorder.onerror=n=>{console.error("Recording error:",n),this.cleanup(),t(new Error("Recording failed"))},this.mediaRecorder.stop()})}isRecording(){return this.recordingState}cancelRecording(){this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&this.mediaRecorder.stop(),this.cleanup()}initializeRecorder(e){const t={};MediaRecorder.isTypeSupported(Ai.WAV)?t.mimeType=Ai.WAV:MediaRecorder.isTypeSupported(Ai.WEBM_OPUS)?t.mimeType=Ai.WEBM_OPUS:MediaRecorder.isTypeSupported(Ai.WEBM)?t.mimeType=Ai.WEBM:MediaRecorder.isTypeSupported(Ai.MP4)?t.mimeType=Ai.MP4:console.warn("No preferred audio format supported, using default"),this.mediaRecorder=new MediaRecorder(e,t),this.mediaRecorder.ondataavailable=n=>{n.data.size>0&&this.audioChunks.push(n.data)},this.mediaRecorder.onstop=()=>{this.recordingState=!1},this.mediaRecorder.onerror=n=>{console.error("MediaRecorder error:",n),this.recordingState=!1}}cleanup(){if(this.stream){for(const e of this.stream.getTracks())e.stop();this.stream=null}this.mediaRecorder=null,this.audioChunks=[],this.recordingState=!1}}async function GL(r){try{if(r.type.includes("wav"))return r;const e=await r.arrayBuffer(),t=new(window.AudioContext||window.webkitAudioContext),n=await t.decodeAudioData(e),i=WL(n);return t.close(),i}catch(e){return console.error("Failed to convert audio to WAV:",e),r}}function WL(r){const e=r.length,t=r.numberOfChannels,n=r.sampleRate,a=t*2,s=n*a,o=e*a,l=44+o,c=new ArrayBuffer(l),u=new DataView(c),h=(f,p)=>{for(let m=0;m<p.length;m++)u.setUint8(f+m,p.charCodeAt(m))};h(0,"RIFF"),u.setUint32(4,l-8,!0),h(8,"WAVE"),h(12,"fmt "),u.setUint32(16,16,!0),u.setUint16(20,1,!0),u.setUint16(22,t,!0),u.setUint32(24,n,!0),u.setUint32(28,s,!0),u.setUint16(32,a,!0),u.setUint16(34,16,!0),h(36,"data"),u.setUint32(40,o,!0);let d=44;for(let f=0;f<e;f++)for(let p=0;p<t;p++){const m=Math.max(-1,Math.min(1,r.getChannelData(p)[f]));u.setInt16(d,m*32767,!0),d+=2}return new Blob([c],{type:Ai.WAV})}function VL(r,e){const t=new Date().toISOString().replace(/[:.]/g,"-"),n=r.type.includes("wav")?"wav":"mp3",i=`recording-${t}.${n}`;return new File([r],i,{type:r.type,lastModified:Date.now()})}function XL(){return!!(typeof navigator<"u"&&navigator.mediaDevices&&typeof navigator.mediaDevices.getUserMedia=="function"&&typeof window<"u"&&window.MediaRecorder)}function p7(r){return r.isComposing||r.keyCode===229}var $L=ee('<!> <form><!> <div class="flex-column relative min-h-[48px] items-center rounded-3xl px-5 py-3 shadow-sm transition-all focus-within:shadow-md"><!> <!></div></form> <!>',1);function m7(r,e){ge(e,!0);let t=L(e,"disabled",3,!1),n=L(e,"isLoading",3,!1),i=L(e,"showHelperText",3,!0),a=L(e,"uploadedFiles",31,()=>Mr([])),s,o=j(fn),l=oe(void 0),c=oe(void 0),u=oe(!1),h=oe(""),d=j(()=>Number(g(o).pasteLongTextToFileLen)||2500),f=oe(Mr(n())),p=oe(!1),m=oe(void 0);function y(q){switch(q){case tn.IMAGE:return[...Object.values(Xs),...Object.values(ha)].join(",");case tn.AUDIO:return[...Object.values(oh),...Object.values(Ai)].join(",");case tn.PDF:return[...Object.values(w0),...Object.values(Dl)].join(",");case tn.TEXT:return[...Object.values(Rr),_r.PLAIN].join(",");default:return""}}function v(q){e.onFileUpload?.(q)}function x(q){q?O(l,y(q),!0):O(l,void 0),setTimeout(()=>{g(c)?.click()},10)}async function S(q){if(q.key==="Enter"&&!q.shiftKey&&!p7(q)){if(q.preventDefault(),!g(h).trim()&&a().length===0||t()||n())return;const re=g(h).trim(),X=[...a()];O(h,""),a([]),g(m)?.resetHeight(),await e.onSend?.(re,X)||(O(h,re,!0),a(X))}}function A(q){if(!q.clipboardData)return;const re=Array.from(q.clipboardData.items).filter(ie=>ie.kind==="file").map(ie=>ie.getAsFile()).filter(ie=>ie!==null);if(re.length>0){q.preventDefault(),e.onFileUpload?.(re);return}const X=q.clipboardData.getData(_r.PLAIN);if(X.length>0&&g(d)>0&&X.length>g(d)){q.preventDefault();const ie=new File([X],"Pasted",{type:_r.PLAIN});e.onFileUpload?.([ie])}}async function C(){if(!s||!g(p)){console.warn("Audio recording not supported");return}if(g(u))try{const q=await s.stopRecording(),re=await GL(q),X=VL(re);e.onFileUpload?.([X]),O(u,!1)}catch(q){console.error("Failed to stop recording:",q),O(u,!1)}else try{await s.startRecording(),O(u,!0)}catch(q){console.error("Failed to start recording:",q)}}function k(){e.onStop?.()}async function I(q){if(q.preventDefault(),!g(h).trim()&&a().length===0||t()||n())return;const re=g(h).trim(),X=[...a()];O(h,""),a([]),g(m)?.resetHeight(),await e.onSend?.(re,X)||(O(h,re,!0),a(X))}Si(()=>{setTimeout(()=>g(m)?.focus(),10),O(p,XL(),!0),s=new qL}),Pv(()=>{setTimeout(()=>g(m)?.focus(),10)}),Ft(()=>{g(f)&&!n()&&setTimeout(()=>g(m)?.focus(),10),O(f,n())});var R=$L(),U=F(R);Tr($B(U,{onFileSelect:v,get accept(){return g(l)},set accept(q){O(l,q,!0)}}),q=>O(c,q,!0),()=>g(c));var D=ae(U,2),$=te(D);u7($,{get onFileRemove(){return e.onFileRemove},class:"mb-3 px-5 pt-5",get uploadedFiles(){return a()},set uploadedFiles(q){a(q)}});var H=ae($,2),V=te(H);Tr(QL(V,{onKeydown:S,get disabled(){return t()},get value(){return g(h)},set value(q){O(h,q,!0)}}),q=>O(m,q,!0),()=>g(m));var z=ae(V,2);{let q=j(()=>g(h).trim().length>0||a().length>0);jB(z,{get canSend(){return g(q)},get disabled(){return t()},get isLoading(){return n()},get isRecording(){return g(u)},onFileUpload:x,onMicClick:C,onStop:k})}Q(H),Q(D);var Z=ae(D,2);qB(Z,{get show(){return i()}}),qe(()=>tr(D,1,`${ab} border-radius-bottom-none mx-auto max-w-[48rem] overflow-hidden rounded-3xl backdrop-blur-md ${e.class??""}`)),Rn("submit",D,I),Rn("paste",H,A),_(r,R),pe()}function KL(r){r&&(r.style.height="1rem",r.style.height=r.scrollHeight+"px")}var YL=r=>KL(r.currentTarget),JL=ee("<div><textarea></textarea></div>");function QL(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"disabled",3,!1),i=L(e,"placeholder",3,"Ask anything..."),a=L(e,"value",15,""),s;Si(()=>{s&&s.focus()});function o(){return s}function l(){s?.focus()}function c(){s&&(s.style.height="1rem")}var u=JL(),h=te(u);e0(h);let d;return h.__keydown=function(...f){e.onKeydown?.apply(this,f)},h.__input=[YL],Tr(h,f=>s=f,()=>s),Q(u),qe(f=>{tr(u,1,`flex-1 ${t()??""}`),d=tr(h,1,"text-md max-h-32 min-h-12 w-full resize-none border-0 bg-transparent p-0 leading-6 outline-none placeholder:text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",null,d,f),h.disabled=n(),Jt(h,"placeholder",i())},[()=>({"cursor-not-allowed":n()})]),Rn("paste",h,function(...f){e.onPaste?.apply(this,f)}),Nl(h,a),_(r,u),pe({getElement:o,focus:l,resetHeight:c})}wi(["keydown","input"]);function b7(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"sideOffset",3,4),i=De(e,["$$slots","$$events","$$legacy","ref","sideOffset","portalProps","class"]);var a=J(),s=F(a);ve(s,()=>Ll,(o,l)=>{l(o,$e(()=>e.portalProps,{children:(c,u)=>{var h=J(),d=F(h);{let f=j(()=>Qt("z-50 max-h-(--bits-dropdown-menu-content-available-height) min-w-[8rem] origin-(--bits-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 dark:border-border/20",e.class));ve(d,()=>iN,(p,m)=>{m(p,$e({"data-slot":"dropdown-menu-content",get sideOffset(){return n()},get class(){return g(f)}},()=>i,{get ref(){return t()},set ref(y){t(y)}}))})}_(c,h)},$$slots:{default:!0}}))}),_(r,a),pe()}function Jh(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"variant",3,"default"),i=De(e,["$$slots","$$events","$$legacy","ref","class","inset","variant"]);var a=J(),s=F(a);{let o=j(()=>Qt("relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:!text-destructive",e.class));ve(s,()=>KO,(l,c)=>{c(l,$e({"data-slot":"dropdown-menu-item",get"data-inset"(){return e.inset},get"data-variant"(){return n()},get class(){return g(o)}},()=>i,{get ref(){return t()},set ref(u){t(u)}}))})}_(r,a),pe()}function ZL(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("-mx-1 my-1 h-px bg-border/20",e.class));ve(a,()=>JO,(o,l)=>{l(o,$e({"data-slot":"dropdown-menu-separator",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}function v7(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref"]);var i=J(),a=F(i);ve(a,()=>sN,(s,o)=>{o(s,$e({"data-slot":"dropdown-menu-trigger"},()=>n,{get ref(){return t()},set ref(l){t(l)}}))}),_(r,i),pe()}const y7=tN;function ao(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref"]);var i=J(),a=F(i);ve(a,()=>zN,(s,o)=>{o(s,$e({"data-slot":"tooltip-trigger"},()=>n,{get ref(){return t()},set ref(l){t(l)}}))}),_(r,i),pe()}var eB=ee("<div></div>"),tB=ee("<!> <!>",1);function so(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"sideOffset",3,0),i=L(e,"side",3,"top"),a=De(e,["$$slots","$$events","$$legacy","ref","class","sideOffset","side","children","arrowClasses"]);var s=J(),o=F(s);ve(o,()=>Ll,(l,c)=>{c(l,{children:(u,h)=>{var d=J(),f=F(d);{let p=j(()=>Qt("z-50 w-fit origin-(--bits-tooltip-content-transform-origin) animate-in rounded-md bg-primary px-3 py-1.5 text-xs text-balance text-primary-foreground fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e.class));ve(f,()=>BN,(m,y)=>{y(m,$e({"data-slot":"tooltip-content",get sideOffset(){return n()},get side(){return i()},get class(){return g(p)}},()=>a,{get ref(){return t()},set ref(v){t(v)},children:(v,x)=>{var S=tB(),A=F(S);Te(A,()=>e.children??Re);var C=ae(A,2);{const k=(I,R)=>{let U=()=>R?.().props;var D=eB();Lt(D,$=>({class:$,...U()}),[()=>Qt("z-50 size-2.5 rotate-45 rounded-[2px] bg-primary","data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%_+_2px)]","data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%_+_1px)]","data-[side=right]:translate-x-[calc(50%_+_2px)] data-[side=right]:translate-y-1/2","data-[side=left]:-translate-y-[calc(50%_-_3px)]",e.arrowClasses)]),_(I,D)};ve(C,()=>jN,(I,R)=>{R(I,{child:k,$$slots:{child:!0}})})}_(v,S)},$$slots:{default:!0}}))})}_(u,d)},$$slots:{default:!0}})}),_(r,s),pe()}const oo=FN,rB=HN,fu=100;var nB=ee('<span class="sr-only">Attach files</span> <!>',1),iB=ee("<p> </p>"),aB=ee("<!> <!>",1),sB=ee("<!> <span>Images</span>",1),oB=ee("<p>Images require vision models to be processed</p>"),lB=ee("<!> <!>",1),cB=ee("<!> <span>Audio Files</span>",1),uB=ee("<p>Audio files require audio models to be processed</p>"),hB=ee("<!> <!>",1),dB=ee("<!> <span>Text Files</span>",1),fB=ee("<!> <span>PDF Files</span>",1),gB=ee("<p>PDFs will be converted to text. Image-based PDFs may not work properly.</p>"),pB=ee("<!> <!>",1),mB=ee("<!> <!> <!> <!>",1),bB=ee("<!> <!>",1),vB=ee("<div><!></div>");function yB(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"disabled",3,!1);const i=j(()=>Za()?"Attach files":"Text files and PDFs supported. Images, audio, and video require vision models.");function a(l){e.onFileUpload?.(l)}var s=vB(),o=te(s);ve(o,()=>y7,(l,c)=>{c(l,{children:(u,h)=>{var d=bB(),f=F(d);ve(f,()=>v7,(m,y)=>{y(m,{name:"Attach files",children:(v,x)=>{var S=J(),A=F(S);ve(A,()=>oo,(C,k)=>{k(C,{get delayDuration(){return fu},children:(I,R)=>{var U=aB(),D=F(U);ve(D,()=>ao,(H,V)=>{V(H,{children:(z,Z)=>{Qr(z,{class:"file-upload-button h-8 w-8 rounded-full bg-transparent p-0 text-muted-foreground hover:bg-foreground/10 hover:text-foreground",get disabled(){return n()},type:"button",children:(q,re)=>{var X=nB(),ie=ae(F(X),2);$R(ie,{class:"h-4 w-4"}),_(q,X)},$$slots:{default:!0}})},$$slots:{default:!0}})});var $=ae(D,2);ve($,()=>so,(H,V)=>{V(H,{children:(z,Z)=>{var q=iB(),re=te(q,!0);Q(q),qe(()=>at(re,g(i))),_(z,q)},$$slots:{default:!0}})}),_(I,U)},$$slots:{default:!0}})}),_(v,S)},$$slots:{default:!0}})});var p=ae(f,2);ve(p,()=>b7,(m,y)=>{y(m,{align:"start",class:"w-48",children:(v,x)=>{var S=mB(),A=F(S);ve(A,()=>oo,(R,U)=>{U(R,{get delayDuration(){return fu},children:(D,$)=>{var H=lB(),V=F(H);ve(V,()=>ao,(q,re)=>{re(q,{class:"w-full",children:(X,ie)=>{var P=J(),be=F(P);{let _e=j(()=>!Za());ve(be,()=>Jh,(W,me)=>{me(W,{class:"images-button flex cursor-pointer items-center gap-2",get disabled(){return g(_e)},onclick:()=>a(tn.IMAGE),children:(He,Xe)=>{var Le=sB(),bt=F(Le);L6(bt,{class:"h-4 w-4"}),Rt(2),_(He,Le)},$$slots:{default:!0}})})}_(X,P)},$$slots:{default:!0}})});var z=ae(V,2);{var Z=q=>{var re=J(),X=F(re);ve(X,()=>so,(ie,P)=>{P(ie,{children:(be,_e)=>{var W=oB();_(be,W)},$$slots:{default:!0}})}),_(q,re)};ce(z,q=>{Za()||q(Z)})}_(D,H)},$$slots:{default:!0}})});var C=ae(A,2);ve(C,()=>oo,(R,U)=>{U(R,{get delayDuration(){return fu},children:(D,$)=>{var H=hB(),V=F(H);ve(V,()=>ao,(q,re)=>{re(q,{class:"w-full",children:(X,ie)=>{var P=J(),be=F(P);{let _e=j(()=>!el());ve(be,()=>Jh,(W,me)=>{me(W,{class:"audio-button flex cursor-pointer items-center gap-2",get disabled(){return g(_e)},onclick:()=>a(tn.AUDIO),children:(He,Xe)=>{var Le=cB(),bt=F(Le);ZR(bt,{class:"h-4 w-4"}),Rt(2),_(He,Le)},$$slots:{default:!0}})})}_(X,P)},$$slots:{default:!0}})});var z=ae(V,2);{var Z=q=>{var re=J(),X=F(re);ve(X,()=>so,(ie,P)=>{P(ie,{children:(be,_e)=>{var W=uB();_(be,W)},$$slots:{default:!0}})}),_(q,re)};ce(z,q=>{el()||q(Z)})}_(D,H)},$$slots:{default:!0}})});var k=ae(C,2);ve(k,()=>Jh,(R,U)=>{U(R,{class:"flex cursor-pointer items-center gap-2",onclick:()=>a(tn.TEXT),children:(D,$)=>{var H=dB(),V=F(H);Ch(V,{class:"h-4 w-4"}),Rt(2),_(D,H)},$$slots:{default:!0}})});var I=ae(k,2);ve(I,()=>oo,(R,U)=>{U(R,{get delayDuration(){return fu},children:(D,$)=>{var H=pB(),V=F(H);ve(V,()=>ao,(q,re)=>{re(q,{class:"w-full",children:(X,ie)=>{var P=J(),be=F(P);ve(be,()=>Jh,(_e,W)=>{W(_e,{class:"flex cursor-pointer items-center gap-2",onclick:()=>a(tn.PDF),children:(me,He)=>{var Xe=fB(),Le=F(Xe);D6(Le,{class:"h-4 w-4"}),Rt(2),_(me,Xe)},$$slots:{default:!0}})}),_(X,P)},$$slots:{default:!0}})});var z=ae(V,2);{var Z=q=>{var re=J(),X=F(re);ve(X,()=>so,(ie,P)=>{P(ie,{children:(be,_e)=>{var W=gB();_(be,W)},$$slots:{default:!0}})}),_(q,re)};ce(z,q=>{Za()||q(Z)})}_(D,H)},$$slots:{default:!0}})}),_(v,S)},$$slots:{default:!0}})}),_(u,d)},$$slots:{default:!0}})}),Q(s),qe(()=>tr(s,1,`flex items-center gap-1 ${t()??""}`)),_(r,s),pe()}var wB=ee('<span class="sr-only"> </span> <!>',1),xB=ee("<p>Current model does not support audio</p>"),SB=ee("<!> <!>",1),kB=ee("<div><!></div>");function AB(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"disabled",3,!1),i=L(e,"isLoading",3,!1),a=L(e,"isRecording",3,!1);var s=kB(),o=te(s);ve(o,()=>oo,(l,c)=>{c(l,{delayDuration:100,children:(u,h)=>{var d=SB(),f=F(d);ve(f,()=>ao,(y,v)=>{v(y,{children:(x,S)=>{{let A=j(()=>a()?"animate-pulse bg-red-500 text-white hover:bg-red-600":"bg-transparent text-muted-foreground hover:bg-foreground/10 hover:text-foreground"),C=j(()=>el()?"":"cursor-not-allowed opacity-50"),k=j(()=>n()||i()||!el());Qr(x,{get class(){return`h-8 w-8 rounded-full p-0 ${g(A)??""} ${g(C)??""}`},get disabled(){return g(k)},get onclick(){return e.onMicClick},type:"button",children:(I,R)=>{var U=wB(),D=F(U),$=te(D,!0);Q(D);var H=ae(D,2);B6(H,{class:"h-4 w-4"}),qe(()=>at($,a()?"Stop recording":"Start recording")),_(I,U)},$$slots:{default:!0}})}},$$slots:{default:!0}})});var p=ae(f,2);{var m=y=>{var v=J(),x=F(v);ve(x,()=>so,(S,A)=>{A(S,{children:(C,k)=>{var I=xB();_(C,I)},$$slots:{default:!0}})}),_(y,v)};ce(p,y=>{el()||y(m)})}_(u,d)},$$slots:{default:!0}})}),Q(s),qe(()=>tr(s,1,`flex items-center gap-1 ${t()??""}`)),_(r,s),pe()}function _B(r){if(typeof document>"u")return;const e=document.body;if(e)return e.appendChild(r),{destroy(){r.parentNode===e&&e.removeChild(r)}}}function CB(r,e,t,n,i,a){g(e)||g(t)||(g(n)?i():a())}var EB=ee('<div class="flex items-center gap-2 text-xs text-muted-foreground"><!> Loading models…</div>'),TB=ee('<p class="text-xs text-muted-foreground">No models available.</p>'),IB=(r,e,t)=>e(g(t).id),MB=ee('<span class="text-xs text-muted-foreground"> </span>'),OB=ee('<button type="button" role="option"><span class="block w-full truncate font-medium"> </span> <!></button>'),NB=ee('<div role="listbox"><div class="overflow-y-auto py-1"></div></div>'),RB=ee('<div class="relative w-full"><button type="button" aria-haspopup="listbox"><span class="max-w-[160px] truncate text-right font-medium"> </span> <!></button> <!></div>'),PB=ee('<p class="text-xs text-destructive"> </p>'),FB=ee("<div><!> <!></div>");function DB(r,e){ge(e,!0);let t=L(e,"class",3,""),n=j(_L),i=j(CL),a=j(EL),s=j(TL),o=j(IL),l=oe(!1),c=oe(!1),u=null,h=oe(null),d=oe(null),f=oe(null),p=null;Si(async()=>{try{await OL()}catch(X){console.error("Unable to load models:",X)}finally{O(l,!0)}});function m(X){if(!u)return;const ie=X.target;ie&&!u.contains(ie)&&!(g(d)&&g(d).contains(ie))&&R()}function y(X){X.key==="Escape"&&R()}function v(){g(c)&&D()}function x(){g(c)&&D()}async function S(X){if(!X)return;const ie=g(n).find(P=>P.id===X);if(!ie){console.error("Model is no longer available");return}try{await NL(ie.id)}catch(P){console.error("Failed to switch model:",P)}}const A=8,C=6,k=320;async function I(){g(i)||g(a)||(O(c,!0),await Oc(),D(),requestAnimationFrame(()=>D()))}function R(){g(c)&&(O(c,!1),O(f,null),p=null)}async function U(X){try{await S(X)}finally{R()}}Ft(()=>{(g(i)||g(a))&&R()}),Ft(()=>{const X=g(n).length;!g(c)||X<=0||queueMicrotask(()=>D())});function D(){if(!g(c)||!g(h)||!g(d))return;const X=g(h).getBoundingClientRect(),ie=window.innerWidth,P=window.innerHeight;if(ie===0||P===0)return;const be=g(d).scrollWidth,_e=g(d).scrollHeight,W=Math.max(0,ie-A*2),me=Math.min(k,W||k),He=me>0?me:Math.min(k,ie),Xe=Math.min(160,He||160);let Le=p;if(Le===null){const lt=Math.min(be,He),ct=Math.max(X.width,lt,Xe);Le=Math.min(ct,He||ct),p=Le}else Le=Math.min(Math.max(Le,Xe),He||Le);Le>0&&(g(d).style.width=`${Le}px`);const bt=Math.max(0,P-A-X.bottom-C),Ie=Math.max(0,X.top-A-C),Ve=Math.max(0,P-A*2),We=Math.max(1,Ve>0?Ve:_e);function Qe(lt){const ct=lt==="bottom"?bt:Ie,Ct=ct>0?Math.min(ct,We):We,St=Math.min(_e,Ct),Ze=Math.max(0,St);let nt;if(lt==="bottom"){const ht=X.bottom+C,kt=A,Se=P-A-Ze;Se<kt?nt=kt:nt=Math.min(Math.max(ht,kt),Se)}else{const ht=X.top-C-Ze,kt=A,Se=P-A-Ze;Se<kt?nt=kt:nt=Math.max(Math.min(ht,Se),kt)}return{placement:lt,top:nt,height:Ze,maxHeight:St}}const mt=Qe("bottom"),Ke=Qe("top");let ze=mt;_e>mt.maxHeight&&Ke.maxHeight>mt.maxHeight&&(ze=Ke),g(d).style.maxHeight=ze.maxHeight>0?`${Math.round(ze.maxHeight)}px`:"";let Ge=X.right-Le;const ot=ie-A-Le;ot<A?Ge=A:(Ge>ot&&(Ge=ot),Ge<A&&(Ge=A)),O(f,{top:Math.round(ze.top),left:Math.round(Ge),width:Math.round(Le),placement:ze.placement,maxHeight:Math.round(ze.maxHeight)},!0)}function $(){return g(o)?g(n).find(X=>X.id===g(o)):g(n)[0]}var H=FB();Rn("resize",Tl,v),Rn("scroll",Tl,x),Rn("pointerdown",Tc,m),Rn("keydown",Tc,y);var V=te(H);{var z=X=>{var ie=EB(),P=te(ie);l2(P,{class:"h-4 w-4 animate-spin"}),Rt(),Q(ie),_(X,ie)},Z=X=>{var ie=J(),P=F(ie);{var be=W=>{var me=TB();_(W,me)},_e=W=>{var me=RB();const He=j($);var Xe=te(me);Xe.__click=[CB,i,a,c,R,I];var Le=te(Xe),bt=te(Le,!0);Q(Le);var Ie=ae(Le,2);{var Ve=Ke=>{l2(Ke,{class:"h-3.5 w-3.5 animate-spin text-muted-foreground"})},We=Ke=>{{let ze=j(()=>Qt("h-4 w-4 text-muted-foreground transition-transform",g(c)?"rotate-180 text-foreground":""));o2(Ke,{get class(){return g(ze)}})}};ce(Ie,Ke=>{g(a)?Ke(Ve):Ke(We,!1)})}Q(Xe),Tr(Xe,Ke=>O(h,Ke),()=>g(h));var Qe=ae(Xe,2);{var mt=Ke=>{var ze=NB();let Ge;var ot=te(ze);let lt;_n(ot,21,()=>g(n),ct=>ct.id,(ct,Ct)=>{var St=OB();St.__click=[IB,U,Ct];var Ze=te(St),nt=te(Ze,!0);Q(Ze);var ht=ae(Ze,2);{var kt=Se=>{var Fe=MB(),it=te(Fe,!0);Q(Fe),qe(()=>at(it,g(Ct).description)),_(Se,Fe)};ce(ht,Se=>{g(Ct).description&&Se(kt)})}Q(St),qe(Se=>{tr(St,1,Se),Jt(St,"aria-selected",g(Ct).id===g(He)?.id),Jt(Ze,"title",g(Ct).name),at(nt,g(Ct).name)},[()=>ai(Qt("flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm transition hover:bg-muted focus:bg-muted focus:outline-none",g(Ct).id===g(He)?.id?"bg-accent text-accent-foreground":""))]),_(ct,St)}),Q(ot),Q(ze),Tr(ze,ct=>O(d,ct),()=>g(d)),R_(ze,ct=>_B?.(ct)),qe((ct,Ct,St)=>{tr(ze,1,ct),Jt(ze,"data-placement",g(f)?.placement??"bottom"),Ge=Ol(ze,"",Ge,Ct),lt=Ol(ot,"",lt,St)},[()=>ai(Qt("fixed z-[1000] overflow-hidden rounded-md border bg-popover shadow-lg transition-opacity",g(f)?"opacity-100":"pointer-events-none opacity-0")),()=>({top:g(f)?`${g(f).top}px`:void 0,left:g(f)?`${g(f).left}px`:void 0,width:g(f)?`${g(f).width}px`:void 0}),()=>({"max-height":g(f)&&g(f).maxHeight>0?`${g(f).maxHeight}px`:void 0})]),_(Ke,ze)};ce(Qe,Ke=>{g(c)&&Ke(mt)})}Q(me),qe(Ke=>{tr(Xe,1,Ke),Jt(Xe,"aria-expanded",g(c)),Xe.disabled=g(i)||g(a),at(bt,g(He)?.name||"Select model")},[()=>ai(Qt("flex w-full items-center justify-end gap-2 rounded-md px-2 py-1 text-sm text-muted-foreground transition hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",g(c)?"text-foreground":""))]),_(W,me)};ce(P,W=>{g(n).length===0?W(be):W(_e,!1)},!0)}_(X,ie)};ce(V,X=>{g(i)&&g(n).length===0&&!g(l)?X(z):X(Z,!1)})}var q=ae(V,2);{var re=X=>{var ie=PB(),P=te(ie,!0);Q(ie),qe(()=>at(P,g(s))),_(X,ie)};ce(q,X=>{g(s)&&X(re)})}Q(H),Tr(H,X=>u=X,()=>u),qe(X=>tr(H,1,X),[()=>ai(Qt("relative z-10 flex max-w-[200px] min-w-[120px] flex-col items-end gap-1",t()))]),_(r,H),pe()}wi(["click"]);var LB=ee('<span class="sr-only">Stop</span> <!>',1),BB=ee('<span class="sr-only">Send</span> <!>',1),UB=ee("<!> <!>",1),zB=ee("<div><!> <!> <!></div>");function jB(r,e){ge(e,!0);let t=L(e,"canSend",3,!1),n=L(e,"class",3,""),i=L(e,"disabled",3,!1),a=L(e,"isLoading",3,!1),s=L(e,"isRecording",3,!1),o=j(fn);var l=zB(),c=te(l);yB(c,{class:"mr-auto",get disabled(){return i()},get onFileUpload(){return e.onFileUpload}});var u=ae(c,2);{var h=m=>{DB(m,{class:"shrink-0"})};ce(u,m=>{g(o).modelSelectorEnabled&&m(h)})}var d=ae(u,2);{var f=m=>{Qr(m,{type:"button",get onclick(){return e.onStop},class:"h-8 w-8 bg-transparent p-0 hover:bg-destructive/20",children:(y,v)=>{var x=LB(),S=ae(F(x),2);YR(S,{class:"h-8 w-8 fill-destructive stroke-destructive"}),_(y,x)},$$slots:{default:!0}})},p=m=>{var y=UB(),v=F(y);AB(v,{get disabled(){return i()},get isLoading(){return a()},get isRecording(){return s()},get onMicClick(){return e.onMicClick}});var x=ae(v,2);{let S=j(()=>!t()||i()||a());Qr(x,{type:"submit",get disabled(){return g(S)},class:"h-8 w-8 rounded-full p-0",children:(A,C)=>{var k=BB(),I=ae(F(k),2);NR(I,{class:"h-12 w-12"}),_(A,k)},$$slots:{default:!0}})}_(m,y)};ce(d,m=>{a()?m(f):m(p,!1)})}Q(l),qe(()=>tr(l,1,`flex w-full items-center gap-2 ${n()??""}`)),_(r,l),pe()}var HB=ee('<div><p class="text-xs text-muted-foreground">Press <kbd class="rounded bg-muted px-1 py-0.5 font-mono text-xs">Enter</kbd> to send, <kbd class="rounded bg-muted px-1 py-0.5 font-mono text-xs">Shift + Enter</kbd> for new line</p></div>');function qB(r,e){let t=L(e,"class",3,""),n=L(e,"show",3,!0);var i=J(),a=F(i);{var s=o=>{var l=HB();qe(()=>tr(l,1,`mt-4 flex items-center justify-center ${t()??""}`)),_(o,l)};ce(a,o=>{n()&&o(s)})}_(r,i)}function GB(r){const e=[],t=[],n={},i=Za(),a=el();for(const s of r){const o=da(s.type);let l=!0,c="";switch(o){case tn.IMAGE:i||(l=!1,c="Images require a vision-capable model");break;case tn.AUDIO:a||(l=!1,c="Audio files require an audio-capable model");break;case tn.TEXT:case tn.PDF:break}l?e.push(s):(t.push(s),n[s.name]=c)}return{supportedFiles:e,unsupportedFiles:t,modalityReasons:n}}function WB(){const r=Za(),e=el(),t=[],n=[];return t.push(...Object.values(Rr)),n.push(...Object.values(_r)),t.push(...Object.values(w0)),n.push(...Object.values(Dl)),r&&(t.push(...Object.values(Xs)),n.push(...Object.values(ha))),e&&(t.push(...Object.values(oh)),n.push(...Object.values(Ai))),[...t,...n].join(",")}function VB(r,e){const t=r.target;t.files&&e.onFileSelect?.(Array.from(t.files))}var XB=ee('<input type="file"/>');function $B(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"multiple",3,!0),i,a=j(()=>e.accept??WB());function s(){i?.click()}var o=XB();return o.__change=[VB,e],Tr(o,l=>i=l,()=>i),qe(()=>{o.multiple=n(),Jt(o,"accept",g(a)),tr(o,1,`hidden ${t()??""}`)}),_(r,o),pe({click:s})}wi(["change"]);var Ef={exports:{}},KB=Ef.exports,w7;function YB(){return w7||(w7=1,function(r,e){(function(t,n){r.exports=n()})(KB,function(){var t=function(b,w){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,N){T.__proto__=N}||function(T,N){for(var B in N)Object.prototype.hasOwnProperty.call(N,B)&&(T[B]=N[B])})(b,w)},n=function(){return(n=Object.assign||function(b){for(var w,T=1,N=arguments.length;T<N;T++)for(var B in w=arguments[T])Object.prototype.hasOwnProperty.call(w,B)&&(b[B]=w[B]);return b}).apply(this,arguments)};function i(b,w,T){for(var N,B=0,K=w.length;B<K;B++)!N&&B in w||((N=N||Array.prototype.slice.call(w,0,B))[B]=w[B]);return b.concat(N||Array.prototype.slice.call(w))}var a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:NE,s=Object.keys,o=Array.isArray;function l(b,w){return typeof w!="object"||s(w).forEach(function(T){b[T]=w[T]}),b}typeof Promise>"u"||a.Promise||(a.Promise=Promise);var c=Object.getPrototypeOf,u={}.hasOwnProperty;function h(b,w){return u.call(b,w)}function d(b,w){typeof w=="function"&&(w=w(c(b))),(typeof Reflect>"u"?s:Reflect.ownKeys)(w).forEach(function(T){p(b,T,w[T])})}var f=Object.defineProperty;function p(b,w,T,N){f(b,w,l(T&&h(T,"get")&&typeof T.get=="function"?{get:T.get,set:T.set,configurable:!0}:{value:T,configurable:!0,writable:!0},N))}function m(b){return{from:function(w){return b.prototype=Object.create(w.prototype),p(b.prototype,"constructor",b),{extend:d.bind(null,b.prototype)}}}}var y=Object.getOwnPropertyDescriptor,v=[].slice;function x(b,w,T){return v.call(b,w,T)}function S(b,w){return w(b)}function A(b){if(!b)throw new Error("Assertion Failed")}function C(b){a.setImmediate?setImmediate(b):setTimeout(b,0)}function k(b,w){if(typeof w=="string"&&h(b,w))return b[w];if(!w)return b;if(typeof w!="string"){for(var T=[],N=0,B=w.length;N<B;++N){var K=k(b,w[N]);T.push(K)}return T}var ne=w.indexOf(".");if(ne!==-1){var he=b[w.substr(0,ne)];return he==null?void 0:k(he,w.substr(ne+1))}}function I(b,w,T){if(b&&w!==void 0&&!("isFrozen"in Object&&Object.isFrozen(b)))if(typeof w!="string"&&"length"in w){A(typeof T!="string"&&"length"in T);for(var N=0,B=w.length;N<B;++N)I(b,w[N],T[N])}else{var K,ne,he=w.indexOf(".");he!==-1?(K=w.substr(0,he),(ne=w.substr(he+1))===""?T===void 0?o(b)&&!isNaN(parseInt(K))?b.splice(K,1):delete b[K]:b[K]=T:I(he=!(he=b[K])||!h(b,K)?b[K]={}:he,ne,T)):T===void 0?o(b)&&!isNaN(parseInt(w))?b.splice(w,1):delete b[w]:b[w]=T}}function R(b){var w,T={};for(w in b)h(b,w)&&(T[w]=b[w]);return T}var U=[].concat;function D(b){return U.apply([],b)}var Se="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(D([8,16,32,64].map(function(b){return["Int","Uint","Float"].map(function(w){return w+b+"Array"})}))).filter(function(b){return a[b]}),$=new Set(Se.map(function(b){return a[b]})),H=null;function V(b){return H=new WeakMap,b=function w(T){if(!T||typeof T!="object")return T;var N=H.get(T);if(N)return N;if(o(T)){N=[],H.set(T,N);for(var B=0,K=T.length;B<K;++B)N.push(w(T[B]))}else if($.has(T.constructor))N=T;else{var ne,he=c(T);for(ne in N=he===Object.prototype?{}:Object.create(he),H.set(T,N),T)h(T,ne)&&(N[ne]=w(T[ne]))}return N}(b),H=null,b}var z={}.toString;function Z(b){return z.call(b).slice(8,-1)}var q=typeof Symbol<"u"?Symbol.iterator:"@@iterator",re=typeof q=="symbol"?function(b){var w;return b!=null&&(w=b[q])&&w.apply(b)}:function(){return null};function X(b,w){return w=b.indexOf(w),0<=w&&b.splice(w,1),0<=w}var ie={};function P(b){var w,T,N,B;if(arguments.length===1){if(o(b))return b.slice();if(this===ie&&typeof b=="string")return[b];if(B=re(b)){for(T=[];!(N=B.next()).done;)T.push(N.value);return T}if(b==null)return[b];if(typeof(w=b.length)!="number")return[b];for(T=new Array(w);w--;)T[w]=b[w];return T}for(w=arguments.length,T=new Array(w);w--;)T[w]=arguments[w];return T}var be=typeof Symbol<"u"?function(b){return b[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},kt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Va=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(kt),_e={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function W(b,w){this.name=b,this.message=w}function me(b,w){return b+". Errors: "+Object.keys(w).map(function(T){return w[T].toString()}).filter(function(T,N,B){return B.indexOf(T)===N}).join(`
`)}function He(b,w,T,N){this.failures=w,this.failedKeys=N,this.successCount=T,this.message=me(b,w)}function Xe(b,w){this.name="BulkError",this.failures=Object.keys(w).map(function(T){return w[T]}),this.failuresByPos=w,this.message=me(b,this.failures)}m(W).from(Error).extend({toString:function(){return this.name+": "+this.message}}),m(He).from(W),m(Xe).from(W);var Le=Va.reduce(function(b,w){return b[w]=w+"Error",b},{}),bt=W,Ie=Va.reduce(function(b,w){var T=w+"Error";function N(B,K){this.name=T,B?typeof B=="string"?(this.message="".concat(B).concat(K?`
`+K:""),this.inner=K||null):typeof B=="object"&&(this.message="".concat(B.name," ").concat(B.message),this.inner=B):(this.message=_e[w]||T,this.inner=null)}return m(N).from(bt),b[w]=N,b},{});Ie.Syntax=SyntaxError,Ie.Type=TypeError,Ie.Range=RangeError;var Ve=kt.reduce(function(b,w){return b[w+"Error"]=Ie[w],b},{}),We=Va.reduce(function(b,w){return["Syntax","Type","Range"].indexOf(w)===-1&&(b[w+"Error"]=Ie[w]),b},{});function Qe(){}function mt(b){return b}function Ke(b,w){return b==null||b===mt?w:function(T){return w(b(T))}}function ze(b,w){return function(){b.apply(this,arguments),w.apply(this,arguments)}}function Ge(b,w){return b===Qe?w:function(){var T=b.apply(this,arguments);T!==void 0&&(arguments[0]=T);var N=this.onsuccess,B=this.onerror;this.onsuccess=null,this.onerror=null;var K=w.apply(this,arguments);return N&&(this.onsuccess=this.onsuccess?ze(N,this.onsuccess):N),B&&(this.onerror=this.onerror?ze(B,this.onerror):B),K!==void 0?K:T}}function ot(b,w){return b===Qe?w:function(){b.apply(this,arguments);var T=this.onsuccess,N=this.onerror;this.onsuccess=this.onerror=null,w.apply(this,arguments),T&&(this.onsuccess=this.onsuccess?ze(T,this.onsuccess):T),N&&(this.onerror=this.onerror?ze(N,this.onerror):N)}}function lt(b,w){return b===Qe?w:function(T){var N=b.apply(this,arguments);l(T,N);var B=this.onsuccess,K=this.onerror;return this.onsuccess=null,this.onerror=null,T=w.apply(this,arguments),B&&(this.onsuccess=this.onsuccess?ze(B,this.onsuccess):B),K&&(this.onerror=this.onerror?ze(K,this.onerror):K),N===void 0?T===void 0?void 0:T:l(N,T)}}function ct(b,w){return b===Qe?w:function(){return w.apply(this,arguments)!==!1&&b.apply(this,arguments)}}function Ct(b,w){return b===Qe?w:function(){var T=b.apply(this,arguments);if(T&&typeof T.then=="function"){for(var N=this,B=arguments.length,K=new Array(B);B--;)K[B]=arguments[B];return T.then(function(){return w.apply(N,K)})}return w.apply(this,arguments)}}We.ModifyError=He,We.DexieError=W,We.BulkError=Xe;var St=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ze(b){St=b}var nt={},ht=100,Se=typeof Promise>"u"?[]:function(){var b=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[b,c(b),b];var w=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[w,c(w),b]}(),kt=Se[0],Va=Se[1],Se=Se[2],Va=Va&&Va.then,Fe=kt&&kt.constructor,it=!!Se,yt=function(b,w){wt.push([b,w]),kr&&(queueMicrotask(zt),kr=!1)},$t=!0,kr=!0,Ar=[],mr=[],sn=mt,Zr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Qe,pgp:!1,env:{},finalize:Qe},Je=Zr,wt=[],Et=0,hr=[];function tt(b){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var w=this._PSD=Je;if(typeof b!="function"){if(b!==nt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Ur(this,this._value))}this._state=null,this._value=null,++w.ref,function T(N,B){try{B(function(K){if(N._state===null){if(K===N)throw new TypeError("A promise cannot be resolved with itself.");var ne=N._lib&&wr();K&&typeof K.then=="function"?T(N,function(he,ye){K instanceof tt?K._then(he,ye):K.then(he,ye)}):(N._state=!0,N._value=K,le(N)),ne&&en()}},Ur.bind(null,N))}catch(K){Ur(N,K)}}(this,b)}var Ut={get:function(){var b=Je,w=Wi;function T(N,B){var K=this,ne=!b.global&&(b!==Je||w!==Wi),he=ne&&!Ga(),ye=new tt(function(ke,Ee){Be(K,new ur(pc(N,b,ne,he),pc(B,b,ne,he),ke,Ee,b))});return this._consoleTask&&(ye._consoleTask=this._consoleTask),ye}return T.prototype=nt,T},set:function(b){p(this,"then",b&&b.prototype===nt?Ut:{get:function(){return b},set:Ut.set})}};function ur(b,w,T,N,B){this.onFulfilled=typeof b=="function"?b:null,this.onRejected=typeof w=="function"?w:null,this.resolve=T,this.reject=N,this.psd=B}function Ur(b,w){var T,N;mr.push(w),b._state===null&&(T=b._lib&&wr(),w=sn(w),b._state=!1,b._value=w,N=b,Ar.some(function(B){return B._value===N._value})||Ar.push(N),le(b),T&&en())}function le(b){var w=b._listeners;b._listeners=[];for(var T=0,N=w.length;T<N;++T)Be(b,w[T]);var B=b._PSD;--B.ref||B.finalize(),Et===0&&(++Et,yt(function(){--Et==0&&Dt()},[]))}function Be(b,w){if(b._state!==null){var T=b._state?w.onFulfilled:w.onRejected;if(T===null)return(b._state?w.resolve:w.reject)(b._value);++w.psd.ref,++Et,yt(et,[T,b,w])}else b._listeners.push(w)}function et(b,w,T){try{var N,B=w._value;!w._state&&mr.length&&(mr=[]),N=St&&w._consoleTask?w._consoleTask.run(function(){return b(B)}):b(B),w._state||mr.indexOf(B)!==-1||function(K){for(var ne=Ar.length;ne;)if(Ar[--ne]._value===K._value)return Ar.splice(ne,1)}(w),T.resolve(N)}catch(K){T.reject(K)}finally{--Et==0&&Dt(),--T.psd.ref||T.psd.finalize()}}function zt(){ka(Zr,function(){wr()&&en()})}function wr(){var b=$t;return kr=$t=!1,b}function en(){var b,w,T;do for(;0<wt.length;)for(b=wt,wt=[],T=b.length,w=0;w<T;++w){var N=b[w];N[0].apply(null,N[1])}while(0<wt.length);kr=$t=!0}function Dt(){var b=Ar;Ar=[],b.forEach(function(N){N._PSD.onunhandled.call(null,N._value,N)});for(var w=hr.slice(0),T=w.length;T;)w[--T]()}function Mt(b){return new tt(nt,!1,b)}function Tt(b,w){var T=Je;return function(){var N=wr(),B=Je;try{return bi(T,!0),b.apply(this,arguments)}catch(K){w&&w(K)}finally{bi(B,!1),N&&en()}}}d(tt.prototype,{then:Ut,_then:function(b,w){Be(this,new ur(null,null,b,w,Je))},catch:function(b){if(arguments.length===1)return this.then(null,b);var w=b,T=arguments[1];return typeof w=="function"?this.then(null,function(N){return(N instanceof w?T:Mt)(N)}):this.then(null,function(N){return(N&&N.name===w?T:Mt)(N)})},finally:function(b){return this.then(function(w){return tt.resolve(b()).then(function(){return w})},function(w){return tt.resolve(b()).then(function(){return Mt(w)})})},timeout:function(b,w){var T=this;return b<1/0?new tt(function(N,B){var K=setTimeout(function(){return B(new Ie.Timeout(w))},b);T.then(N,B).finally(clearTimeout.bind(null,K))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&p(tt.prototype,Symbol.toStringTag,"Dexie.Promise"),Zr.env=Nu(),d(tt,{all:function(){var b=P.apply(null,arguments).map(Sa);return new tt(function(w,T){b.length===0&&w([]);var N=b.length;b.forEach(function(B,K){return tt.resolve(B).then(function(ne){b[K]=ne,--N||w(b)},T)})})},resolve:function(b){return b instanceof tt?b:b&&typeof b.then=="function"?new tt(function(w,T){b.then(w,T)}):new tt(nt,!0,b)},reject:Mt,race:function(){var b=P.apply(null,arguments).map(Sa);return new tt(function(w,T){b.map(function(N){return tt.resolve(N).then(w,T)})})},PSD:{get:function(){return Je},set:function(b){return Je=b}},totalEchoes:{get:function(){return Wi}},newPSD:Ei,usePSD:ka,scheduler:{get:function(){return yt},set:function(b){yt=b}},rejectionMapper:{get:function(){return sn},set:function(b){sn=b}},follow:function(b,w){return new tt(function(T,N){return Ei(function(B,K){var ne=Je;ne.unhandleds=[],ne.onunhandled=K,ne.finalize=ze(function(){var he,ye=this;he=function(){ye.unhandleds.length===0?B():K(ye.unhandleds[0])},hr.push(function ke(){he(),hr.splice(hr.indexOf(ke),1)}),++Et,yt(function(){--Et==0&&Dt()},[])},ne.finalize),b()},w,T,N)})}}),Fe&&(Fe.allSettled&&p(tt,"allSettled",function(){var b=P.apply(null,arguments).map(Sa);return new tt(function(w){b.length===0&&w([]);var T=b.length,N=new Array(T);b.forEach(function(B,K){return tt.resolve(B).then(function(ne){return N[K]={status:"fulfilled",value:ne}},function(ne){return N[K]={status:"rejected",reason:ne}}).then(function(){return--T||w(N)})})})}),Fe.any&&typeof AggregateError<"u"&&p(tt,"any",function(){var b=P.apply(null,arguments).map(Sa);return new tt(function(w,T){b.length===0&&T(new AggregateError([]));var N=b.length,B=new Array(N);b.forEach(function(K,ne){return tt.resolve(K).then(function(he){return w(he)},function(he){B[ne]=he,--N||T(new AggregateError(B))})})})}),Fe.withResolvers&&(tt.withResolvers=Fe.withResolvers));var Cr={awaits:0,echoes:0,id:0},Sn=0,qa=[],Ps=0,Wi=0,So=0;function Ei(b,w,T,N){var B=Je,K=Object.create(B);return K.parent=B,K.ref=0,K.global=!1,K.id=++So,Zr.env,K.env=it?{Promise:tt,PromiseProp:{value:tt,configurable:!0,writable:!0},all:tt.all,race:tt.race,allSettled:tt.allSettled,any:tt.any,resolve:tt.resolve,reject:tt.reject}:{},w&&l(K,w),++B.ref,K.finalize=function(){--this.parent.ref||this.parent.finalize()},N=ka(K,b,T,N),K.ref===0&&K.finalize(),N}function Fs(){return Cr.id||(Cr.id=++Sn),++Cr.awaits,Cr.echoes+=ht,Cr.id}function Ga(){return!!Cr.awaits&&(--Cr.awaits==0&&(Cr.id=0),Cr.echoes=Cr.awaits*ht,!0)}function Sa(b){return Cr.echoes&&b&&b.constructor===Fe?(Fs(),b.then(function(w){return Ga(),w},function(w){return Ga(),Tn(w)})):b}function Ds(){var b=qa[qa.length-1];qa.pop(),bi(b,!1)}function bi(b,w){var T,N=Je;(w?!Cr.echoes||Ps++&&b===Je:!Ps||--Ps&&b===Je)||queueMicrotask(w?(function(B){++Wi,Cr.echoes&&--Cr.echoes!=0||(Cr.echoes=Cr.awaits=Cr.id=0),qa.push(Je),bi(B,!0)}).bind(null,b):Ds),b!==Je&&(Je=b,N===Zr&&(Zr.env=Nu()),it&&(T=Zr.env.Promise,w=b.env,(N.global||b.global)&&(Object.defineProperty(a,"Promise",w.PromiseProp),T.all=w.all,T.race=w.race,T.resolve=w.resolve,T.reject=w.reject,w.allSettled&&(T.allSettled=w.allSettled),w.any&&(T.any=w.any))))}function Nu(){var b=a.Promise;return it?{Promise:b,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:b.all,race:b.race,allSettled:b.allSettled,any:b.any,resolve:b.resolve,reject:b.reject}:{}}function ka(b,w,T,N,B){var K=Je;try{return bi(b,!0),w(T,N,B)}finally{bi(K,!1)}}function pc(b,w,T,N){return typeof b!="function"?b:function(){var B=Je;T&&Fs(),bi(w,!0);try{return b.apply(this,arguments)}finally{bi(B,!1),N&&queueMicrotask(Ga)}}}function aa(b){Promise===Fe&&Cr.echoes===0?Ps===0?b():enqueueNativeMicroTask(b):setTimeout(b,0)}(""+Va).indexOf("[native code]")===-1&&(Fs=Ga=Qe);var Tn=tt.reject,Ls="￿",is="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",D1="String expected.",fl=[],ko="__dbnames",Sd="readonly",ft="readwrite";function Xt(b,w){return b?w?function(){return b.apply(this,arguments)&&w.apply(this,arguments)}:b:w}var qr={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function cn(b){return typeof b!="string"||/\./.test(b)?function(w){return w}:function(w){return w[b]===void 0&&b in w&&delete(w=V(w))[b],w}}function Dn(){throw Ie.Type()}function vr(b,w){try{var T=as(b),N=as(w);if(T!==N)return T==="Array"?1:N==="Array"?-1:T==="binary"?1:N==="binary"?-1:T==="string"?1:N==="string"?-1:T==="Date"?1:N!=="Date"?NaN:-1;switch(T){case"number":case"Date":case"string":return w<b?1:b<w?-1:0;case"binary":return function(B,K){for(var ne=B.length,he=K.length,ye=ne<he?ne:he,ke=0;ke<ye;++ke)if(B[ke]!==K[ke])return B[ke]<K[ke]?-1:1;return ne===he?0:ne<he?-1:1}(mc(b),mc(w));case"Array":return function(B,K){for(var ne=B.length,he=K.length,ye=ne<he?ne:he,ke=0;ke<ye;++ke){var Ee=vr(B[ke],K[ke]);if(Ee!==0)return Ee}return ne===he?0:ne<he?-1:1}(b,w)}}catch{}return NaN}function as(b){var w=typeof b;return w!="object"?w:ArrayBuffer.isView(b)?"binary":(b=Z(b),b==="ArrayBuffer"?"binary":b)}function mc(b){return b instanceof Uint8Array?b:ArrayBuffer.isView(b)?new Uint8Array(b.buffer,b.byteOffset,b.byteLength):new Uint8Array(b)}var Ti=(Yr.prototype._trans=function(b,w,T){var N=this._tx||Je.trans,B=this.name,K=St&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(b==="readonly"?"read":"write"," ").concat(this.name));function ne(ke,Ee,de){if(!de.schema[B])throw new Ie.NotFound("Table "+B+" not part of transaction");return w(de.idbtrans,de)}var he=wr();try{var ye=N&&N.db._novip===this.db._novip?N===Je.trans?N._promise(b,ne,T):Ei(function(){return N._promise(b,ne,T)},{trans:N,transless:Je.transless||Je}):function ke(Ee,de,Oe,xe){if(Ee.idbdb&&(Ee._state.openComplete||Je.letThrough||Ee._vip)){var Ce=Ee._createTransaction(de,Oe,Ee._dbSchema);try{Ce.create(),Ee._state.PR1398_maxLoop=3}catch(Me){return Me.name===Le.InvalidState&&Ee.isOpen()&&0<--Ee._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Ee.close({disableAutoOpen:!1}),Ee.open().then(function(){return ke(Ee,de,Oe,xe)})):Tn(Me)}return Ce._promise(de,function(Me,Ae){return Ei(function(){return Je.trans=Ce,xe(Me,Ae,Ce)})}).then(function(Me){if(de==="readwrite")try{Ce.idbtrans.commit()}catch{}return de==="readonly"?Me:Ce._completion.then(function(){return Me})})}if(Ee._state.openComplete)return Tn(new Ie.DatabaseClosed(Ee._state.dbOpenError));if(!Ee._state.isBeingOpened){if(!Ee._state.autoOpen)return Tn(new Ie.DatabaseClosed);Ee.open().catch(Qe)}return Ee._state.dbReadyPromise.then(function(){return ke(Ee,de,Oe,xe)})}(this.db,b,[this.name],ne);return K&&(ye._consoleTask=K,ye=ye.catch(function(ke){return console.trace(ke),Tn(ke)})),ye}finally{he&&en()}},Yr.prototype.get=function(b,w){var T=this;return b&&b.constructor===Object?this.where(b).first(w):b==null?Tn(new Ie.Type("Invalid argument to Table.get()")):this._trans("readonly",function(N){return T.core.get({trans:N,key:b}).then(function(B){return T.hook.reading.fire(B)})}).then(w)},Yr.prototype.where=function(b){if(typeof b=="string")return new this.db.WhereClause(this,b);if(o(b))return new this.db.WhereClause(this,"[".concat(b.join("+"),"]"));var w=s(b);if(w.length===1)return this.where(w[0]).equals(b[w[0]]);var T=this.schema.indexes.concat(this.schema.primKey).filter(function(he){if(he.compound&&w.every(function(ke){return 0<=he.keyPath.indexOf(ke)})){for(var ye=0;ye<w.length;++ye)if(w.indexOf(he.keyPath[ye])===-1)return!1;return!0}return!1}).sort(function(he,ye){return he.keyPath.length-ye.keyPath.length})[0];if(T&&this.db._maxKey!==Ls){var K=T.keyPath.slice(0,w.length);return this.where(K).equals(K.map(function(ye){return b[ye]}))}!T&&St&&console.warn("The query ".concat(JSON.stringify(b)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(w.join("+"),"]"));var N=this.schema.idxByName;function B(he,ye){return vr(he,ye)===0}var ne=w.reduce(function(de,ye){var ke=de[0],Ee=de[1],de=N[ye],Oe=b[ye];return[ke||de,ke||!de?Xt(Ee,de&&de.multi?function(xe){return xe=k(xe,ye),o(xe)&&xe.some(function(Ce){return B(Oe,Ce)})}:function(xe){return B(Oe,k(xe,ye))}):Ee]},[null,null]),K=ne[0],ne=ne[1];return K?this.where(K.name).equals(b[K.keyPath]).filter(ne):T?this.filter(ne):this.where(w).equals("")},Yr.prototype.filter=function(b){return this.toCollection().and(b)},Yr.prototype.count=function(b){return this.toCollection().count(b)},Yr.prototype.offset=function(b){return this.toCollection().offset(b)},Yr.prototype.limit=function(b){return this.toCollection().limit(b)},Yr.prototype.each=function(b){return this.toCollection().each(b)},Yr.prototype.toArray=function(b){return this.toCollection().toArray(b)},Yr.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Yr.prototype.orderBy=function(b){return new this.db.Collection(new this.db.WhereClause(this,o(b)?"[".concat(b.join("+"),"]"):b))},Yr.prototype.reverse=function(){return this.toCollection().reverse()},Yr.prototype.mapToClass=function(b){var w,T=this.db,N=this.name;function B(){return w!==null&&w.apply(this,arguments)||this}(this.schema.mappedClass=b).prototype instanceof Dn&&(function(ye,ke){if(typeof ke!="function"&&ke!==null)throw new TypeError("Class extends value "+String(ke)+" is not a constructor or null");function Ee(){this.constructor=ye}t(ye,ke),ye.prototype=ke===null?Object.create(ke):(Ee.prototype=ke.prototype,new Ee)}(B,w=b),Object.defineProperty(B.prototype,"db",{get:function(){return T},enumerable:!1,configurable:!0}),B.prototype.table=function(){return N},b=B);for(var K=new Set,ne=b.prototype;ne;ne=c(ne))Object.getOwnPropertyNames(ne).forEach(function(ye){return K.add(ye)});function he(ye){if(!ye)return ye;var ke,Ee=Object.create(b.prototype);for(ke in ye)if(!K.has(ke))try{Ee[ke]=ye[ke]}catch{}return Ee}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=he,this.hook("reading",he),b},Yr.prototype.defineClass=function(){return this.mapToClass(function(b){l(this,b)})},Yr.prototype.add=function(b,w){var T=this,N=this.schema.primKey,B=N.auto,K=N.keyPath,ne=b;return K&&B&&(ne=cn(K)(b)),this._trans("readwrite",function(he){return T.core.mutate({trans:he,type:"add",keys:w!=null?[w]:null,values:[ne]})}).then(function(he){return he.numFailures?tt.reject(he.failures[0]):he.lastResult}).then(function(he){if(K)try{I(b,K,he)}catch{}return he})},Yr.prototype.update=function(b,w){return typeof b!="object"||o(b)?this.where(":id").equals(b).modify(w):(b=k(b,this.schema.primKey.keyPath),b===void 0?Tn(new Ie.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(b).modify(w))},Yr.prototype.put=function(b,w){var T=this,N=this.schema.primKey,B=N.auto,K=N.keyPath,ne=b;return K&&B&&(ne=cn(K)(b)),this._trans("readwrite",function(he){return T.core.mutate({trans:he,type:"put",values:[ne],keys:w!=null?[w]:null})}).then(function(he){return he.numFailures?tt.reject(he.failures[0]):he.lastResult}).then(function(he){if(K)try{I(b,K,he)}catch{}return he})},Yr.prototype.delete=function(b){var w=this;return this._trans("readwrite",function(T){return w.core.mutate({trans:T,type:"delete",keys:[b]})}).then(function(T){return T.numFailures?tt.reject(T.failures[0]):void 0})},Yr.prototype.clear=function(){var b=this;return this._trans("readwrite",function(w){return b.core.mutate({trans:w,type:"deleteRange",range:qr})}).then(function(w){return w.numFailures?tt.reject(w.failures[0]):void 0})},Yr.prototype.bulkGet=function(b){var w=this;return this._trans("readonly",function(T){return w.core.getMany({keys:b,trans:T}).then(function(N){return N.map(function(B){return w.hook.reading.fire(B)})})})},Yr.prototype.bulkAdd=function(b,w,T){var N=this,B=Array.isArray(w)?w:void 0,K=(T=T||(B?void 0:w))?T.allKeys:void 0;return this._trans("readwrite",function(ne){var ke=N.schema.primKey,he=ke.auto,ke=ke.keyPath;if(ke&&B)throw new Ie.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(B&&B.length!==b.length)throw new Ie.InvalidArgument("Arguments objects and keys must have the same length");var ye=b.length,ke=ke&&he?b.map(cn(ke)):b;return N.core.mutate({trans:ne,type:"add",keys:B,values:ke,wantResults:K}).then(function(Ce){var de=Ce.numFailures,Oe=Ce.results,xe=Ce.lastResult,Ce=Ce.failures;if(de===0)return K?Oe:xe;throw new Xe("".concat(N.name,".bulkAdd(): ").concat(de," of ").concat(ye," operations failed"),Ce)})})},Yr.prototype.bulkPut=function(b,w,T){var N=this,B=Array.isArray(w)?w:void 0,K=(T=T||(B?void 0:w))?T.allKeys:void 0;return this._trans("readwrite",function(ne){var ke=N.schema.primKey,he=ke.auto,ke=ke.keyPath;if(ke&&B)throw new Ie.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(B&&B.length!==b.length)throw new Ie.InvalidArgument("Arguments objects and keys must have the same length");var ye=b.length,ke=ke&&he?b.map(cn(ke)):b;return N.core.mutate({trans:ne,type:"put",keys:B,values:ke,wantResults:K}).then(function(Ce){var de=Ce.numFailures,Oe=Ce.results,xe=Ce.lastResult,Ce=Ce.failures;if(de===0)return K?Oe:xe;throw new Xe("".concat(N.name,".bulkPut(): ").concat(de," of ").concat(ye," operations failed"),Ce)})})},Yr.prototype.bulkUpdate=function(b){var w=this,T=this.core,N=b.map(function(ne){return ne.key}),B=b.map(function(ne){return ne.changes}),K=[];return this._trans("readwrite",function(ne){return T.getMany({trans:ne,keys:N,cache:"clone"}).then(function(he){var ye=[],ke=[];b.forEach(function(de,Oe){var xe=de.key,Ce=de.changes,Me=he[Oe];if(Me){for(var Ae=0,Pe=Object.keys(Ce);Ae<Pe.length;Ae++){var Ue=Pe[Ae],je=Ce[Ue];if(Ue===w.schema.primKey.keyPath){if(vr(je,xe)!==0)throw new Ie.Constraint("Cannot update primary key in bulkUpdate()")}else I(Me,Ue,je)}K.push(Oe),ye.push(xe),ke.push(Me)}});var Ee=ye.length;return T.mutate({trans:ne,type:"put",keys:ye,values:ke,updates:{keys:N,changeSpecs:B}}).then(function(de){var Oe=de.numFailures,xe=de.failures;if(Oe===0)return Ee;for(var Ce=0,Me=Object.keys(xe);Ce<Me.length;Ce++){var Ae,Pe=Me[Ce],Ue=K[Number(Pe)];Ue!=null&&(Ae=xe[Pe],delete xe[Pe],xe[Ue]=Ae)}throw new Xe("".concat(w.name,".bulkUpdate(): ").concat(Oe," of ").concat(Ee," operations failed"),xe)})})})},Yr.prototype.bulkDelete=function(b){var w=this,T=b.length;return this._trans("readwrite",function(N){return w.core.mutate({trans:N,type:"delete",keys:b})}).then(function(ne){var B=ne.numFailures,K=ne.lastResult,ne=ne.failures;if(B===0)return K;throw new Xe("".concat(w.name,".bulkDelete(): ").concat(B," of ").concat(T," operations failed"),ne)})},Yr);function Yr(){}function gl(b){function w(ne,he){if(he){for(var ye=arguments.length,ke=new Array(ye-1);--ye;)ke[ye-1]=arguments[ye];return T[ne].subscribe.apply(null,ke),b}if(typeof ne=="string")return T[ne]}var T={};w.addEventType=K;for(var N=1,B=arguments.length;N<B;++N)K(arguments[N]);return w;function K(ne,he,ye){if(typeof ne!="object"){var ke;he=he||ct;var Ee={subscribers:[],fire:ye=ye||Qe,subscribe:function(de){Ee.subscribers.indexOf(de)===-1&&(Ee.subscribers.push(de),Ee.fire=he(Ee.fire,de))},unsubscribe:function(de){Ee.subscribers=Ee.subscribers.filter(function(Oe){return Oe!==de}),Ee.fire=Ee.subscribers.reduce(he,ye)}};return T[ne]=w[ne]=Ee}s(ke=ne).forEach(function(de){var Oe=ke[de];if(o(Oe))K(de,ke[de][0],ke[de][1]);else{if(Oe!=="asap")throw new Ie.InvalidArgument("Invalid event config");var xe=K(de,mt,function(){for(var Ce=arguments.length,Me=new Array(Ce);Ce--;)Me[Ce]=arguments[Ce];xe.subscribers.forEach(function(Ae){C(function(){Ae.apply(null,Me)})})})}})}}function pl(b,w){return m(w).from({prototype:b}),w}function Ao(b,w){return!(b.filter||b.algorithm||b.or)&&(w?b.justLimit:!b.replayFilter)}function kd(b,w){b.filter=Xt(b.filter,w)}function Ad(b,w,T){var N=b.replayFilter;b.replayFilter=N?function(){return Xt(N(),w())}:w,b.justLimit=T&&!N}function Ru(b,w){if(b.isPrimKey)return w.primaryKey;var T=w.getIndexByKeyPath(b.index);if(!T)throw new Ie.Schema("KeyPath "+b.index+" on object store "+w.name+" is not indexed");return T}function L1(b,w,T){var N=Ru(b,w.schema);return w.openCursor({trans:T,values:!b.keysOnly,reverse:b.dir==="prev",unique:!!b.unique,query:{index:N,range:b.range}})}function _o(b,w,T,N){var B=b.replayFilter?Xt(b.filter,b.replayFilter()):b.filter;if(b.or){var K={},ne=function(he,ye,ke){var Ee,de;B&&!B(ye,ke,function(Oe){return ye.stop(Oe)},function(Oe){return ye.fail(Oe)})||((de=""+(Ee=ye.primaryKey))=="[object ArrayBuffer]"&&(de=""+new Uint8Array(Ee)),h(K,de)||(K[de]=!0,w(he,ye,ke)))};return Promise.all([b.or._iterate(ne,T),_d(L1(b,N,T),b.algorithm,ne,!b.keysOnly&&b.valueMapper)])}return _d(L1(b,N,T),Xt(b.algorithm,B),w,!b.keysOnly&&b.valueMapper)}function _d(b,w,T,N){var B=Tt(N?function(K,ne,he){return T(N(K),ne,he)}:T);return b.then(function(K){if(K)return K.start(function(){var ne=function(){return K.continue()};w&&!w(K,function(he){return ne=he},function(he){K.stop(he),ne=Qe},function(he){K.fail(he),ne=Qe})||B(K.value,K,function(he){return ne=he}),ne()})})}var Ii=(B1.prototype.execute=function(b){var w=this["@@propmod"];if(w.add!==void 0){var T=w.add;if(o(T))return i(i([],o(b)?b:[],!0),T).sort();if(typeof T=="number")return(Number(b)||0)+T;if(typeof T=="bigint")try{return BigInt(b)+T}catch{return BigInt(0)+T}throw new TypeError("Invalid term ".concat(T))}if(w.remove!==void 0){var N=w.remove;if(o(N))return o(b)?b.filter(function(B){return!N.includes(B)}).sort():[];if(typeof N=="number")return Number(b)-N;if(typeof N=="bigint")try{return BigInt(b)-N}catch{return BigInt(0)-N}throw new TypeError("Invalid subtrahend ".concat(N))}return T=(T=w.replacePrefix)===null||T===void 0?void 0:T[0],T&&typeof b=="string"&&b.startsWith(T)?w.replacePrefix[1]+b.substring(T.length):b},B1);function B1(b){this["@@propmod"]=b}var Cd=(Ot.prototype._read=function(b,w){var T=this._ctx;return T.error?T.table._trans(null,Tn.bind(null,T.error)):T.table._trans("readonly",b).then(w)},Ot.prototype._write=function(b){var w=this._ctx;return w.error?w.table._trans(null,Tn.bind(null,w.error)):w.table._trans("readwrite",b,"locked")},Ot.prototype._addAlgorithm=function(b){var w=this._ctx;w.algorithm=Xt(w.algorithm,b)},Ot.prototype._iterate=function(b,w){return _o(this._ctx,b,w,this._ctx.table.core)},Ot.prototype.clone=function(b){var w=Object.create(this.constructor.prototype),T=Object.create(this._ctx);return b&&l(T,b),w._ctx=T,w},Ot.prototype.raw=function(){return this._ctx.valueMapper=null,this},Ot.prototype.each=function(b){var w=this._ctx;return this._read(function(T){return _o(w,b,T,w.table.core)})},Ot.prototype.count=function(b){var w=this;return this._read(function(T){var N=w._ctx,B=N.table.core;if(Ao(N,!0))return B.count({trans:T,query:{index:Ru(N,B.schema),range:N.range}}).then(function(ne){return Math.min(ne,N.limit)});var K=0;return _o(N,function(){return++K,!1},T,B).then(function(){return K})}).then(b)},Ot.prototype.sortBy=function(b,w){var T=b.split(".").reverse(),N=T[0],B=T.length-1;function K(ye,ke){return ke?K(ye[T[ke]],ke-1):ye[N]}var ne=this._ctx.dir==="next"?1:-1;function he(ye,ke){return vr(K(ye,B),K(ke,B))*ne}return this.toArray(function(ye){return ye.sort(he)}).then(w)},Ot.prototype.toArray=function(b){var w=this;return this._read(function(T){var N=w._ctx;if(N.dir==="next"&&Ao(N,!0)&&0<N.limit){var B=N.valueMapper,K=Ru(N,N.table.core.schema);return N.table.core.query({trans:T,limit:N.limit,values:!0,query:{index:K,range:N.range}}).then(function(he){return he=he.result,B?he.map(B):he})}var ne=[];return _o(N,function(he){return ne.push(he)},T,N.table.core).then(function(){return ne})},b)},Ot.prototype.offset=function(b){var w=this._ctx;return b<=0||(w.offset+=b,Ao(w)?Ad(w,function(){var T=b;return function(N,B){return T===0||(T===1?--T:B(function(){N.advance(T),T=0}),!1)}}):Ad(w,function(){var T=b;return function(){return--T<0}})),this},Ot.prototype.limit=function(b){return this._ctx.limit=Math.min(this._ctx.limit,b),Ad(this._ctx,function(){var w=b;return function(T,N,B){return--w<=0&&N(B),0<=w}},!0),this},Ot.prototype.until=function(b,w){return kd(this._ctx,function(T,N,B){return!b(T.value)||(N(B),w)}),this},Ot.prototype.first=function(b){return this.limit(1).toArray(function(w){return w[0]}).then(b)},Ot.prototype.last=function(b){return this.reverse().first(b)},Ot.prototype.filter=function(b){var w;return kd(this._ctx,function(T){return b(T.value)}),(w=this._ctx).isMatch=Xt(w.isMatch,b),this},Ot.prototype.and=function(b){return this.filter(b)},Ot.prototype.or=function(b){return new this.db.WhereClause(this._ctx.table,b,this)},Ot.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Ot.prototype.desc=function(){return this.reverse()},Ot.prototype.eachKey=function(b){var w=this._ctx;return w.keysOnly=!w.isMatch,this.each(function(T,N){b(N.key,N)})},Ot.prototype.eachUniqueKey=function(b){return this._ctx.unique="unique",this.eachKey(b)},Ot.prototype.eachPrimaryKey=function(b){var w=this._ctx;return w.keysOnly=!w.isMatch,this.each(function(T,N){b(N.primaryKey,N)})},Ot.prototype.keys=function(b){var w=this._ctx;w.keysOnly=!w.isMatch;var T=[];return this.each(function(N,B){T.push(B.key)}).then(function(){return T}).then(b)},Ot.prototype.primaryKeys=function(b){var w=this._ctx;if(w.dir==="next"&&Ao(w,!0)&&0<w.limit)return this._read(function(N){var B=Ru(w,w.table.core.schema);return w.table.core.query({trans:N,values:!1,limit:w.limit,query:{index:B,range:w.range}})}).then(function(N){return N.result}).then(b);w.keysOnly=!w.isMatch;var T=[];return this.each(function(N,B){T.push(B.primaryKey)}).then(function(){return T}).then(b)},Ot.prototype.uniqueKeys=function(b){return this._ctx.unique="unique",this.keys(b)},Ot.prototype.firstKey=function(b){return this.limit(1).keys(function(w){return w[0]}).then(b)},Ot.prototype.lastKey=function(b){return this.reverse().firstKey(b)},Ot.prototype.distinct=function(){var b=this._ctx,b=b.index&&b.table.schema.idxByName[b.index];if(!b||!b.multi)return this;var w={};return kd(this._ctx,function(B){var N=B.primaryKey.toString(),B=h(w,N);return w[N]=!0,!B}),this},Ot.prototype.modify=function(b){var w=this,T=this._ctx;return this._write(function(N){var B,K,ne;ne=typeof b=="function"?b:(B=s(b),K=B.length,function(Ae){for(var Pe=!1,Ue=0;Ue<K;++Ue){var je=B[Ue],Ye=b[je],gt=k(Ae,je);Ye instanceof Ii?(I(Ae,je,Ye.execute(gt)),Pe=!0):gt!==Ye&&(I(Ae,je,Ye),Pe=!0)}return Pe});var he=T.table.core,de=he.schema.primaryKey,ye=de.outbound,ke=de.extractKey,Ee=200,de=w.db._options.modifyChunkSize;de&&(Ee=typeof de=="object"?de[he.name]||de["*"]||200:de);function Oe(Ae,je){var Ue=je.failures,je=je.numFailures;Ce+=Ae-je;for(var Ye=0,gt=s(Ue);Ye<gt.length;Ye++){var _t=gt[Ye];xe.push(Ue[_t])}}var xe=[],Ce=0,Me=[];return w.clone().primaryKeys().then(function(Ae){function Pe(je){var Ye=Math.min(Ee,Ae.length-je);return he.getMany({trans:N,keys:Ae.slice(je,je+Ye),cache:"immutable"}).then(function(gt){for(var _t=[],pt=[],vt=ye?[]:null,It=[],At=0;At<Ye;++At){var jt=gt[At],Ir={value:V(jt),primKey:Ae[je+At]};ne.call(Ir,Ir.value,Ir)!==!1&&(Ir.value==null?It.push(Ae[je+At]):ye||vr(ke(jt),ke(Ir.value))===0?(pt.push(Ir.value),ye&&vt.push(Ae[je+At])):(It.push(Ae[je+At]),_t.push(Ir.value)))}return Promise.resolve(0<_t.length&&he.mutate({trans:N,type:"add",values:_t}).then(function(Gr){for(var Wr in Gr.failures)It.splice(parseInt(Wr),1);Oe(_t.length,Gr)})).then(function(){return(0<pt.length||Ue&&typeof b=="object")&&he.mutate({trans:N,type:"put",keys:vt,values:pt,criteria:Ue,changeSpec:typeof b!="function"&&b,isAdditionalChunk:0<je}).then(function(Gr){return Oe(pt.length,Gr)})}).then(function(){return(0<It.length||Ue&&b===Pu)&&he.mutate({trans:N,type:"delete",keys:It,criteria:Ue,isAdditionalChunk:0<je}).then(function(Gr){return Oe(It.length,Gr)})}).then(function(){return Ae.length>je+Ye&&Pe(je+Ee)})})}var Ue=Ao(T)&&T.limit===1/0&&(typeof b!="function"||b===Pu)&&{index:T.index,range:T.range};return Pe(0).then(function(){if(0<xe.length)throw new He("Error modifying one or more objects",xe,Ce,Me);return Ae.length})})})},Ot.prototype.delete=function(){var b=this._ctx,w=b.range;return Ao(b)&&(b.isPrimKey||w.type===3)?this._write(function(T){var N=b.table.core.schema.primaryKey,B=w;return b.table.core.count({trans:T,query:{index:N,range:B}}).then(function(K){return b.table.core.mutate({trans:T,type:"deleteRange",range:B}).then(function(ne){var he=ne.failures;if(ne.lastResult,ne.results,ne=ne.numFailures,ne)throw new He("Could not delete some values",Object.keys(he).map(function(ye){return he[ye]}),K-ne);return K-ne})})}):this.modify(Pu)},Ot);function Ot(){}var Pu=function(b,w){return w.value=null};function ni(b,w){return b<w?-1:b===w?0:1}function bn(b,w){return w<b?-1:b===w?0:1}function li(b,w,T){return b=b instanceof Kt?new b.Collection(b):b,b._ctx.error=new(T||TypeError)(w),b}function sa(b){return new b.Collection(b,function(){return Nt("")}).limit(0)}function ml(b,w,T,N){var B,K,ne,he,ye,ke,Ee,de=T.length;if(!T.every(function(Ce){return typeof Ce=="string"}))return li(b,D1);function Oe(Ce){B=Ce==="next"?function(Ae){return Ae.toUpperCase()}:function(Ae){return Ae.toLowerCase()},K=Ce==="next"?function(Ae){return Ae.toLowerCase()}:function(Ae){return Ae.toUpperCase()},ne=Ce==="next"?ni:bn;var Me=T.map(function(Ae){return{lower:K(Ae),upper:B(Ae)}}).sort(function(Ae,Pe){return ne(Ae.lower,Pe.lower)});he=Me.map(function(Ae){return Ae.upper}),ye=Me.map(function(Ae){return Ae.lower}),Ee=(ke=Ce)==="next"?"":N}Oe("next"),b=new b.Collection(b,function(){return Wa(he[0],ye[de-1]+N)}),b._ondirectionchange=function(Ce){Oe(Ce)};var xe=0;return b._addAlgorithm(function(Ce,Me,Ae){var Pe=Ce.key;if(typeof Pe!="string")return!1;var Ue=K(Pe);if(w(Ue,ye,xe))return!0;for(var je=null,Ye=xe;Ye<de;++Ye){var gt=function(_t,pt,vt,It,At,jt){for(var Ir=Math.min(_t.length,It.length),Gr=-1,Wr=0;Wr<Ir;++Wr){var Aa=pt[Wr];if(Aa!==It[Wr])return At(_t[Wr],vt[Wr])<0?_t.substr(0,Wr)+vt[Wr]+vt.substr(Wr+1):At(_t[Wr],It[Wr])<0?_t.substr(0,Wr)+It[Wr]+vt.substr(Wr+1):0<=Gr?_t.substr(0,Gr)+pt[Gr]+vt.substr(Gr+1):null;At(_t[Wr],Aa)<0&&(Gr=Wr)}return Ir<It.length&&jt==="next"?_t+vt.substr(_t.length):Ir<_t.length&&jt==="prev"?_t.substr(0,vt.length):Gr<0?null:_t.substr(0,Gr)+It[Gr]+vt.substr(Gr+1)}(Pe,Ue,he[Ye],ye[Ye],ne,ke);gt===null&&je===null?xe=Ye+1:(je===null||0<ne(je,gt))&&(je=gt)}return Me(je!==null?function(){Ce.continue(je+Ee)}:Ae),!1}),b}function Wa(b,w,T,N){return{type:2,lower:b,upper:w,lowerOpen:T,upperOpen:N}}function Nt(b){return{type:1,lower:b,upper:b}}var Kt=(Object.defineProperty(Zt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Zt.prototype.between=function(b,w,T,N){T=T!==!1,N=N===!0;try{return 0<this._cmp(b,w)||this._cmp(b,w)===0&&(T||N)&&(!T||!N)?sa(this):new this.Collection(this,function(){return Wa(b,w,!T,!N)})}catch{return li(this,is)}},Zt.prototype.equals=function(b){return b==null?li(this,is):new this.Collection(this,function(){return Nt(b)})},Zt.prototype.above=function(b){return b==null?li(this,is):new this.Collection(this,function(){return Wa(b,void 0,!0)})},Zt.prototype.aboveOrEqual=function(b){return b==null?li(this,is):new this.Collection(this,function(){return Wa(b,void 0,!1)})},Zt.prototype.below=function(b){return b==null?li(this,is):new this.Collection(this,function(){return Wa(void 0,b,!1,!0)})},Zt.prototype.belowOrEqual=function(b){return b==null?li(this,is):new this.Collection(this,function(){return Wa(void 0,b)})},Zt.prototype.startsWith=function(b){return typeof b!="string"?li(this,D1):this.between(b,b+Ls,!0,!0)},Zt.prototype.startsWithIgnoreCase=function(b){return b===""?this.startsWith(b):ml(this,function(w,T){return w.indexOf(T[0])===0},[b],Ls)},Zt.prototype.equalsIgnoreCase=function(b){return ml(this,function(w,T){return w===T[0]},[b],"")},Zt.prototype.anyOfIgnoreCase=function(){var b=P.apply(ie,arguments);return b.length===0?sa(this):ml(this,function(w,T){return T.indexOf(w)!==-1},b,"")},Zt.prototype.startsWithAnyOfIgnoreCase=function(){var b=P.apply(ie,arguments);return b.length===0?sa(this):ml(this,function(w,T){return T.some(function(N){return w.indexOf(N)===0})},b,Ls)},Zt.prototype.anyOf=function(){var b=this,w=P.apply(ie,arguments),T=this._cmp;try{w.sort(T)}catch{return li(this,is)}if(w.length===0)return sa(this);var N=new this.Collection(this,function(){return Wa(w[0],w[w.length-1])});N._ondirectionchange=function(K){T=K==="next"?b._ascending:b._descending,w.sort(T)};var B=0;return N._addAlgorithm(function(K,ne,he){for(var ye=K.key;0<T(ye,w[B]);)if(++B===w.length)return ne(he),!1;return T(ye,w[B])===0||(ne(function(){K.continue(w[B])}),!1)}),N},Zt.prototype.notEqual=function(b){return this.inAnyRange([[-1/0,b],[b,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Zt.prototype.noneOf=function(){var b=P.apply(ie,arguments);if(b.length===0)return new this.Collection(this);try{b.sort(this._ascending)}catch{return li(this,is)}var w=b.reduce(function(T,N){return T?T.concat([[T[T.length-1][1],N]]):[[-1/0,N]]},null);return w.push([b[b.length-1],this.db._maxKey]),this.inAnyRange(w,{includeLowers:!1,includeUppers:!1})},Zt.prototype.inAnyRange=function(Pe,w){var T=this,N=this._cmp,B=this._ascending,K=this._descending,ne=this._min,he=this._max;if(Pe.length===0)return sa(this);if(!Pe.every(function(Ue){return Ue[0]!==void 0&&Ue[1]!==void 0&&B(Ue[0],Ue[1])<=0}))return li(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ie.InvalidArgument);var ye=!w||w.includeLowers!==!1,ke=w&&w.includeUppers===!0,Ee,de=B;function Oe(Ue,je){return de(Ue[0],je[0])}try{(Ee=Pe.reduce(function(Ue,je){for(var Ye=0,gt=Ue.length;Ye<gt;++Ye){var _t=Ue[Ye];if(N(je[0],_t[1])<0&&0<N(je[1],_t[0])){_t[0]=ne(_t[0],je[0]),_t[1]=he(_t[1],je[1]);break}}return Ye===gt&&Ue.push(je),Ue},[])).sort(Oe)}catch{return li(this,is)}var xe=0,Ce=ke?function(Ue){return 0<B(Ue,Ee[xe][1])}:function(Ue){return 0<=B(Ue,Ee[xe][1])},Me=ye?function(Ue){return 0<K(Ue,Ee[xe][0])}:function(Ue){return 0<=K(Ue,Ee[xe][0])},Ae=Ce,Pe=new this.Collection(this,function(){return Wa(Ee[0][0],Ee[Ee.length-1][1],!ye,!ke)});return Pe._ondirectionchange=function(Ue){de=Ue==="next"?(Ae=Ce,B):(Ae=Me,K),Ee.sort(Oe)},Pe._addAlgorithm(function(Ue,je,Ye){for(var gt,_t=Ue.key;Ae(_t);)if(++xe===Ee.length)return je(Ye),!1;return!Ce(gt=_t)&&!Me(gt)||(T._cmp(_t,Ee[xe][1])===0||T._cmp(_t,Ee[xe][0])===0||je(function(){de===B?Ue.continue(Ee[xe][0]):Ue.continue(Ee[xe][1])}),!1)}),Pe},Zt.prototype.startsWithAnyOf=function(){var b=P.apply(ie,arguments);return b.every(function(w){return typeof w=="string"})?b.length===0?sa(this):this.inAnyRange(b.map(function(w){return[w,w+Ls]})):li(this,"startsWithAnyOf() only works with strings")},Zt);function Zt(){}function Pr(b){return Tt(function(w){return Ln(w),b(w.target.error),!1})}function Ln(b){b.stopPropagation&&b.stopPropagation(),b.preventDefault&&b.preventDefault()}var Vi="storagemutated",Ed="x-storagemutated-1",Bs=gl(null,Vi),Tne=(Us.prototype._lock=function(){return A(!Je.global),++this._reculock,this._reculock!==1||Je.global||(Je.lockOwnerFor=this),this},Us.prototype._unlock=function(){if(A(!Je.global),--this._reculock==0)for(Je.global||(Je.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var b=this._blockedFuncs.shift();try{ka(b[1],b[0])}catch{}}return this},Us.prototype._locked=function(){return this._reculock&&Je.lockOwnerFor!==this},Us.prototype.create=function(b){var w=this;if(!this.mode)return this;var T=this.db.idbdb,N=this.db._state.dbOpenError;if(A(!this.idbtrans),!b&&!T)switch(N&&N.name){case"DatabaseClosedError":throw new Ie.DatabaseClosed(N);case"MissingAPIError":throw new Ie.MissingAPI(N.message,N);default:throw new Ie.OpenFailed(N)}if(!this.active)throw new Ie.TransactionInactive;return A(this._completion._state===null),(b=this.idbtrans=b||(this.db.core||T).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Tt(function(B){Ln(B),w._reject(b.error)}),b.onabort=Tt(function(B){Ln(B),w.active&&w._reject(new Ie.Abort(b.error)),w.active=!1,w.on("abort").fire(B)}),b.oncomplete=Tt(function(){w.active=!1,w._resolve(),"mutatedParts"in b&&Bs.storagemutated.fire(b.mutatedParts)}),this},Us.prototype._promise=function(b,w,T){var N=this;if(b==="readwrite"&&this.mode!=="readwrite")return Tn(new Ie.ReadOnly("Transaction is readonly"));if(!this.active)return Tn(new Ie.TransactionInactive);if(this._locked())return new tt(function(K,ne){N._blockedFuncs.push([function(){N._promise(b,w,T).then(K,ne)},Je])});if(T)return Ei(function(){var K=new tt(function(ne,he){N._lock();var ye=w(ne,he,N);ye&&ye.then&&ye.then(ne,he)});return K.finally(function(){return N._unlock()}),K._lib=!0,K});var B=new tt(function(K,ne){var he=w(K,ne,N);he&&he.then&&he.then(K,ne)});return B._lib=!0,B},Us.prototype._root=function(){return this.parent?this.parent._root():this},Us.prototype.waitFor=function(b){var w,T=this._root(),N=tt.resolve(b);T._waitingFor?T._waitingFor=T._waitingFor.then(function(){return N}):(T._waitingFor=N,T._waitingQueue=[],w=T.idbtrans.objectStore(T.storeNames[0]),function K(){for(++T._spinCount;T._waitingQueue.length;)T._waitingQueue.shift()();T._waitingFor&&(w.get(-1/0).onsuccess=K)}());var B=T._waitingFor;return new tt(function(K,ne){N.then(function(he){return T._waitingQueue.push(Tt(K.bind(null,he)))},function(he){return T._waitingQueue.push(Tt(ne.bind(null,he)))}).finally(function(){T._waitingFor===B&&(T._waitingFor=null)})})},Us.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Ie.Abort))},Us.prototype.table=function(b){var w=this._memoizedTables||(this._memoizedTables={});if(h(w,b))return w[b];var T=this.schema[b];if(!T)throw new Ie.NotFound("Table "+b+" not part of transaction");return T=new this.db.Table(b,T,this),T.core=this.db.core.table(b),w[b]=T},Us);function Us(){}function v5(b,w,T,N,B,K,ne){return{name:b,keyPath:w,unique:T,multi:N,auto:B,compound:K,src:(T&&!ne?"&":"")+(N?"*":"")+(B?"++":"")+Wk(w)}}function Wk(b){return typeof b=="string"?b:b?"["+[].join.call(b,"+")+"]":""}function y5(b,w,T){return{name:b,primKey:w,indexes:T,mappedClass:null,idxByName:(N=function(B){return[B.name,B]},T.reduce(function(B,K,ne){return ne=N(K,ne),ne&&(B[ne[0]]=ne[1]),B},{}))};var N}var Td=function(b){try{return b.only([[]]),Td=function(){return[[]]},[[]]}catch{return Td=function(){return Ls},Ls}};function w5(b){return b==null?function(){}:typeof b=="string"?(w=b).split(".").length===1?function(T){return T[w]}:function(T){return k(T,w)}:function(T){return k(T,b)};var w}function Vk(b){return[].slice.call(b)}var Ine=0;function Id(b){return b==null?":id":typeof b=="string"?b:"[".concat(b.join("+"),"]")}function Mne(b,w,ye){function N(Ae){if(Ae.type===3)return null;if(Ae.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var xe=Ae.lower,Ce=Ae.upper,Me=Ae.lowerOpen,Ae=Ae.upperOpen;return xe===void 0?Ce===void 0?null:w.upperBound(Ce,!!Ae):Ce===void 0?w.lowerBound(xe,!!Me):w.bound(xe,Ce,!!Me,!!Ae)}function B(Oe){var xe,Ce=Oe.name;return{name:Ce,schema:Oe,mutate:function(Me){var Ae=Me.trans,Pe=Me.type,Ue=Me.keys,je=Me.values,Ye=Me.range;return new Promise(function(gt,_t){gt=Tt(gt);var pt=Ae.objectStore(Ce),vt=pt.keyPath==null,It=Pe==="put"||Pe==="add";if(!It&&Pe!=="delete"&&Pe!=="deleteRange")throw new Error("Invalid operation type: "+Pe);var At,jt=(Ue||je||{length:1}).length;if(Ue&&je&&Ue.length!==je.length)throw new Error("Given keys array must have same length as given values array.");if(jt===0)return gt({numFailures:0,failures:{},results:[],lastResult:void 0});function Ir(Xi){++Aa,Ln(Xi)}var Gr=[],Wr=[],Aa=0;if(Pe==="deleteRange"){if(Ye.type===4)return gt({numFailures:Aa,failures:Wr,results:[],lastResult:void 0});Ye.type===3?Gr.push(At=pt.clear()):Gr.push(At=pt.delete(N(Ye)))}else{var vt=It?vt?[je,Ue]:[je,null]:[Ue,null],Er=vt[0],Oi=vt[1];if(It)for(var Ni=0;Ni<jt;++Ni)Gr.push(At=Oi&&Oi[Ni]!==void 0?pt[Pe](Er[Ni],Oi[Ni]):pt[Pe](Er[Ni])),At.onerror=Ir;else for(Ni=0;Ni<jt;++Ni)Gr.push(At=pt[Pe](Er[Ni])),At.onerror=Ir}function J1(Xi){Xi=Xi.target.result,Gr.forEach(function(yc,B5){return yc.error!=null&&(Wr[B5]=yc.error)}),gt({numFailures:Aa,failures:Wr,results:Pe==="delete"?Ue:Gr.map(function(yc){return yc.result}),lastResult:Xi})}At.onerror=function(Xi){Ir(Xi),J1(Xi)},At.onsuccess=J1})},getMany:function(Me){var Ae=Me.trans,Pe=Me.keys;return new Promise(function(Ue,je){Ue=Tt(Ue);for(var Ye,gt=Ae.objectStore(Ce),_t=Pe.length,pt=new Array(_t),vt=0,It=0,At=function(Gr){Gr=Gr.target,pt[Gr._pos]=Gr.result,++It===vt&&Ue(pt)},jt=Pr(je),Ir=0;Ir<_t;++Ir)Pe[Ir]!=null&&((Ye=gt.get(Pe[Ir]))._pos=Ir,Ye.onsuccess=At,Ye.onerror=jt,++vt);vt===0&&Ue(pt)})},get:function(Me){var Ae=Me.trans,Pe=Me.key;return new Promise(function(Ue,je){Ue=Tt(Ue);var Ye=Ae.objectStore(Ce).get(Pe);Ye.onsuccess=function(gt){return Ue(gt.target.result)},Ye.onerror=Pr(je)})},query:(xe=ke,function(Me){return new Promise(function(Ae,Pe){Ae=Tt(Ae);var Ue,je,Ye,vt=Me.trans,gt=Me.values,_t=Me.limit,At=Me.query,pt=_t===1/0?void 0:_t,It=At.index,At=At.range,vt=vt.objectStore(Ce),It=It.isPrimaryKey?vt:vt.index(It.name),At=N(At);if(_t===0)return Ae({result:[]});xe?((pt=gt?It.getAll(At,pt):It.getAllKeys(At,pt)).onsuccess=function(jt){return Ae({result:jt.target.result})},pt.onerror=Pr(Pe)):(Ue=0,je=!gt&&"openKeyCursor"in It?It.openKeyCursor(At):It.openCursor(At),Ye=[],je.onsuccess=function(jt){var Ir=je.result;return Ir?(Ye.push(gt?Ir.value:Ir.primaryKey),++Ue===_t?Ae({result:Ye}):void Ir.continue()):Ae({result:Ye})},je.onerror=Pr(Pe))})}),openCursor:function(Me){var Ae=Me.trans,Pe=Me.values,Ue=Me.query,je=Me.reverse,Ye=Me.unique;return new Promise(function(gt,_t){gt=Tt(gt);var It=Ue.index,pt=Ue.range,vt=Ae.objectStore(Ce),vt=It.isPrimaryKey?vt:vt.index(It.name),It=je?Ye?"prevunique":"prev":Ye?"nextunique":"next",At=!Pe&&"openKeyCursor"in vt?vt.openKeyCursor(N(pt),It):vt.openCursor(N(pt),It);At.onerror=Pr(_t),At.onsuccess=Tt(function(jt){var Ir,Gr,Wr,Aa,Er=At.result;Er?(Er.___id=++Ine,Er.done=!1,Ir=Er.continue.bind(Er),Gr=(Gr=Er.continuePrimaryKey)&&Gr.bind(Er),Wr=Er.advance.bind(Er),Aa=function(){throw new Error("Cursor not stopped")},Er.trans=Ae,Er.stop=Er.continue=Er.continuePrimaryKey=Er.advance=function(){throw new Error("Cursor not started")},Er.fail=Tt(_t),Er.next=function(){var Oi=this,Ni=1;return this.start(function(){return Ni--?Oi.continue():Oi.stop()}).then(function(){return Oi})},Er.start=function(Oi){function Ni(){if(At.result)try{Oi()}catch(Xi){Er.fail(Xi)}else Er.done=!0,Er.start=function(){throw new Error("Cursor behind last entry")},Er.stop()}var J1=new Promise(function(Xi,yc){Xi=Tt(Xi),At.onerror=Pr(yc),Er.fail=yc,Er.stop=function(B5){Er.stop=Er.continue=Er.continuePrimaryKey=Er.advance=Aa,Xi(B5)}});return At.onsuccess=Tt(function(Xi){At.onsuccess=Ni,Ni()}),Er.continue=Ir,Er.continuePrimaryKey=Gr,Er.advance=Wr,Ni(),J1},gt(Er)):gt(null)},_t)})},count:function(Me){var Ae=Me.query,Pe=Me.trans,Ue=Ae.index,je=Ae.range;return new Promise(function(Ye,gt){var _t=Pe.objectStore(Ce),pt=Ue.isPrimaryKey?_t:_t.index(Ue.name),_t=N(je),pt=_t?pt.count(_t):pt.count();pt.onsuccess=Tt(function(vt){return Ye(vt.target.result)}),pt.onerror=Pr(gt)})}}}var K,ne,he,Ee=(ne=ye,he=Vk((K=b).objectStoreNames),{schema:{name:K.name,tables:he.map(function(Oe){return ne.objectStore(Oe)}).map(function(Oe){var xe=Oe.keyPath,Ae=Oe.autoIncrement,Ce=o(xe),Me={},Ae={name:Oe.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:xe==null,compound:Ce,keyPath:xe,autoIncrement:Ae,unique:!0,extractKey:w5(xe)},indexes:Vk(Oe.indexNames).map(function(Pe){return Oe.index(Pe)}).map(function(Ye){var Ue=Ye.name,je=Ye.unique,gt=Ye.multiEntry,Ye=Ye.keyPath,gt={name:Ue,compound:o(Ye),keyPath:Ye,unique:je,multiEntry:gt,extractKey:w5(Ye)};return Me[Id(Ye)]=gt}),getIndexByKeyPath:function(Pe){return Me[Id(Pe)]}};return Me[":id"]=Ae.primaryKey,xe!=null&&(Me[Id(xe)]=Ae.primaryKey),Ae})},hasGetAll:0<he.length&&"getAll"in ne.objectStore(he[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),ye=Ee.schema,ke=Ee.hasGetAll,Ee=ye.tables.map(B),de={};return Ee.forEach(function(Oe){return de[Oe.name]=Oe}),{stack:"dbcore",transaction:b.transaction.bind(b),table:function(Oe){if(!de[Oe])throw new Error("Table '".concat(Oe,"' not found"));return de[Oe]},MIN_KEY:-1/0,MAX_KEY:Td(w),schema:ye}}function One(b,w,T,N){var B=T.IDBKeyRange;return T.indexedDB,{dbcore:(N=Mne(w,B,N),b.dbcore.reduce(function(K,ne){return ne=ne.create,n(n({},K),ne(K))},N))}}function U1(b,N){var T=N.db,N=One(b._middlewares,T,b._deps,N);b.core=N.dbcore,b.tables.forEach(function(B){var K=B.name;b.core.schema.tables.some(function(ne){return ne.name===K})&&(B.core=b.core.table(K),b[K]instanceof b.Table&&(b[K].core=B.core))})}function z1(b,w,T,N){T.forEach(function(B){var K=N[B];w.forEach(function(ne){var he=function ye(ke,Ee){return y(ke,Ee)||(ke=c(ke))&&ye(ke,Ee)}(ne,B);(!he||"value"in he&&he.value===void 0)&&(ne===b.Transaction.prototype||ne instanceof b.Transaction?p(ne,B,{get:function(){return this.table(B)},set:function(ye){f(this,B,{value:ye,writable:!0,configurable:!0,enumerable:!0})}}):ne[B]=new b.Table(B,K))})})}function x5(b,w){w.forEach(function(T){for(var N in T)T[N]instanceof b.Table&&delete T[N]})}function Nne(b,w){return b._cfg.version-w._cfg.version}function Rne(b,w,T,N){var B=b._dbSchema;T.objectStoreNames.contains("$meta")&&!B.$meta&&(B.$meta=y5("$meta",$k("")[0],[]),b._storeNames.push("$meta"));var K=b._createTransaction("readwrite",b._storeNames,B);K.create(T),K._completion.catch(N);var ne=K._reject.bind(K),he=Je.transless||Je;Ei(function(){return Je.trans=K,Je.transless=he,w!==0?(U1(b,T),ke=w,((ye=K).storeNames.includes("$meta")?ye.table("$meta").get("version").then(function(Ee){return Ee??ke}):tt.resolve(ke)).then(function(Ee){return Oe=Ee,xe=K,Ce=T,Me=[],Ee=(de=b)._versions,Ae=de._dbSchema=H1(0,de.idbdb,Ce),(Ee=Ee.filter(function(Pe){return Pe._cfg.version>=Oe})).length!==0?(Ee.forEach(function(Pe){Me.push(function(){var Ue=Ae,je=Pe._cfg.dbschema;q1(de,Ue,Ce),q1(de,je,Ce),Ae=de._dbSchema=je;var Ye=S5(Ue,je);Ye.add.forEach(function(It){k5(Ce,It[0],It[1].primKey,It[1].indexes)}),Ye.change.forEach(function(It){if(It.recreate)throw new Ie.Upgrade("Not yet support for changing primary key");var At=Ce.objectStore(It.name);It.add.forEach(function(jt){return j1(At,jt)}),It.change.forEach(function(jt){At.deleteIndex(jt.name),j1(At,jt)}),It.del.forEach(function(jt){return At.deleteIndex(jt)})});var gt=Pe._cfg.contentUpgrade;if(gt&&Pe._cfg.version>Oe){U1(de,Ce),xe._memoizedTables={};var _t=R(je);Ye.del.forEach(function(It){_t[It]=Ue[It]}),x5(de,[de.Transaction.prototype]),z1(de,[de.Transaction.prototype],s(_t),_t),xe.schema=_t;var pt,vt=be(gt);return vt&&Fs(),Ye=tt.follow(function(){var It;(pt=gt(xe))&&vt&&(It=Ga.bind(null,null),pt.then(It,It))}),pt&&typeof pt.then=="function"?tt.resolve(pt):Ye.then(function(){return pt})}}),Me.push(function(Ue){var je,Ye,gt=Pe._cfg.dbschema;je=gt,Ye=Ue,[].slice.call(Ye.db.objectStoreNames).forEach(function(_t){return je[_t]==null&&Ye.db.deleteObjectStore(_t)}),x5(de,[de.Transaction.prototype]),z1(de,[de.Transaction.prototype],de._storeNames,de._dbSchema),xe.schema=de._dbSchema}),Me.push(function(Ue){de.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(de.idbdb.version/10)===Pe._cfg.version?(de.idbdb.deleteObjectStore("$meta"),delete de._dbSchema.$meta,de._storeNames=de._storeNames.filter(function(je){return je!=="$meta"})):Ue.objectStore("$meta").put(Pe._cfg.version,"version"))})}),function Pe(){return Me.length?tt.resolve(Me.shift()(xe.idbtrans)).then(Pe):tt.resolve()}().then(function(){Xk(Ae,Ce)})):tt.resolve();var de,Oe,xe,Ce,Me,Ae}).catch(ne)):(s(B).forEach(function(Ee){k5(T,Ee,B[Ee].primKey,B[Ee].indexes)}),U1(b,T),void tt.follow(function(){return b.on.populate.fire(K)}).catch(ne));var ye,ke})}function Pne(b,w){Xk(b._dbSchema,w),w.db.version%10!=0||w.objectStoreNames.contains("$meta")||w.db.createObjectStore("$meta").add(Math.ceil(w.db.version/10-1),"version");var T=H1(0,b.idbdb,w);q1(b,b._dbSchema,w);for(var N=0,B=S5(T,b._dbSchema).change;N<B.length;N++){var K=function(ne){if(ne.change.length||ne.recreate)return console.warn("Unable to patch indexes of table ".concat(ne.name," because it has changes on the type of index or primary key.")),{value:void 0};var he=w.objectStore(ne.name);ne.add.forEach(function(ye){St&&console.debug("Dexie upgrade patch: Creating missing index ".concat(ne.name,".").concat(ye.src)),j1(he,ye)})}(B[N]);if(typeof K=="object")return K.value}}function S5(b,w){var T,N={del:[],add:[],change:[]};for(T in b)w[T]||N.del.push(T);for(T in w){var B=b[T],K=w[T];if(B){var ne={name:T,def:K,recreate:!1,del:[],add:[],change:[]};if(""+(B.primKey.keyPath||"")!=""+(K.primKey.keyPath||"")||B.primKey.auto!==K.primKey.auto)ne.recreate=!0,N.change.push(ne);else{var he=B.idxByName,ye=K.idxByName,ke=void 0;for(ke in he)ye[ke]||ne.del.push(ke);for(ke in ye){var Ee=he[ke],de=ye[ke];Ee?Ee.src!==de.src&&ne.change.push(de):ne.add.push(de)}(0<ne.del.length||0<ne.add.length||0<ne.change.length)&&N.change.push(ne)}}else N.add.push([T,K])}return N}function k5(b,w,T,N){var B=b.db.createObjectStore(w,T.keyPath?{keyPath:T.keyPath,autoIncrement:T.auto}:{autoIncrement:T.auto});return N.forEach(function(K){return j1(B,K)}),B}function Xk(b,w){s(b).forEach(function(T){w.db.objectStoreNames.contains(T)||(St&&console.debug("Dexie: Creating missing table",T),k5(w,T,b[T].primKey,b[T].indexes))})}function j1(b,w){b.createIndex(w.name,w.keyPath,{unique:w.unique,multiEntry:w.multi})}function H1(b,w,T){var N={};return x(w.objectStoreNames,0).forEach(function(B){for(var K=T.objectStore(B),ne=v5(Wk(ke=K.keyPath),ke||"",!0,!1,!!K.autoIncrement,ke&&typeof ke!="string",!0),he=[],ye=0;ye<K.indexNames.length;++ye){var Ee=K.index(K.indexNames[ye]),ke=Ee.keyPath,Ee=v5(Ee.name,ke,!!Ee.unique,!!Ee.multiEntry,!1,ke&&typeof ke!="string",!1);he.push(Ee)}N[B]=y5(B,ne,he)}),N}function q1(b,w,T){for(var N=T.db.objectStoreNames,B=0;B<N.length;++B){var K=N[B],ne=T.objectStore(K);b._hasGetAll="getAll"in ne;for(var he=0;he<ne.indexNames.length;++he){var ye=ne.indexNames[he],ke=ne.index(ye).keyPath,Ee=typeof ke=="string"?ke:"["+x(ke).join("+")+"]";!w[K]||(ke=w[K].idxByName[Ee])&&(ke.name=ye,delete w[K].idxByName[Ee],w[K].idxByName[ye]=ke)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(b._hasGetAll=!1)}function $k(b){return b.split(",").map(function(w,T){var N=(w=w.trim()).replace(/([&*]|\+\+)/g,""),B=/^\[/.test(N)?N.match(/^\[(.*)\]$/)[1].split("+"):N;return v5(N,B||null,/\&/.test(w),/\*/.test(w),/\+\+/.test(w),o(B),T===0)})}var Fne=(G1.prototype._parseStoresSpec=function(b,w){s(b).forEach(function(T){if(b[T]!==null){var N=$k(b[T]),B=N.shift();if(B.unique=!0,B.multi)throw new Ie.Schema("Primary key cannot be multi-valued");N.forEach(function(K){if(K.auto)throw new Ie.Schema("Only primary key can be marked as autoIncrement (++)");if(!K.keyPath)throw new Ie.Schema("Index must have a name and cannot be an empty string")}),w[T]=y5(T,B,N)}})},G1.prototype.stores=function(T){var w=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,T):T;var T=w._versions,N={},B={};return T.forEach(function(K){l(N,K._cfg.storesSource),B=K._cfg.dbschema={},K._parseStoresSpec(N,B)}),w._dbSchema=B,x5(w,[w._allTables,w,w.Transaction.prototype]),z1(w,[w._allTables,w,w.Transaction.prototype,this._cfg.tables],s(B),B),w._storeNames=s(B),this},G1.prototype.upgrade=function(b){return this._cfg.contentUpgrade=Ct(this._cfg.contentUpgrade||Qe,b),this},G1);function G1(){}function A5(b,w){var T=b._dbNamesDB;return T||(T=b._dbNamesDB=new Co(ko,{addons:[],indexedDB:b,IDBKeyRange:w})).version(1).stores({dbnames:"name"}),T.table("dbnames")}function _5(b){return b&&typeof b.databases=="function"}function C5(b){return Ei(function(){return Je.letThrough=!0,b()})}function E5(b){return!("from"in b)}var Mi=function(b,w){if(!this){var T=new Mi;return b&&"d"in b&&l(T,b),T}l(this,arguments.length?{d:1,from:b,to:1<arguments.length?w:b}:{d:0})};function Md(b,w,T){var N=vr(w,T);if(!isNaN(N)){if(0<N)throw RangeError();if(E5(b))return l(b,{from:w,to:T,d:1});var B=b.l,N=b.r;if(vr(T,b.from)<0)return B?Md(B,w,T):b.l={from:w,to:T,d:1,l:null,r:null},Yk(b);if(0<vr(w,b.to))return N?Md(N,w,T):b.r={from:w,to:T,d:1,l:null,r:null},Yk(b);vr(w,b.from)<0&&(b.from=w,b.l=null,b.d=N?N.d+1:1),0<vr(T,b.to)&&(b.to=T,b.r=null,b.d=b.l?b.l.d+1:1),T=!b.r,B&&!b.l&&Od(b,B),N&&T&&Od(b,N)}}function Od(b,w){E5(w)||function T(N,ye){var K=ye.from,ne=ye.to,he=ye.l,ye=ye.r;Md(N,K,ne),he&&T(N,he),ye&&T(N,ye)}(b,w)}function Kk(b,w){var T=W1(w),N=T.next();if(N.done)return!1;for(var B=N.value,K=W1(b),ne=K.next(B.from),he=ne.value;!N.done&&!ne.done;){if(vr(he.from,B.to)<=0&&0<=vr(he.to,B.from))return!0;vr(B.from,he.from)<0?B=(N=T.next(he.from)).value:he=(ne=K.next(B.from)).value}return!1}function W1(b){var w=E5(b)?null:{s:0,n:b};return{next:function(T){for(var N=0<arguments.length;w;)switch(w.s){case 0:if(w.s=1,N)for(;w.n.l&&vr(T,w.n.from)<0;)w={up:w,n:w.n.l,s:1};else for(;w.n.l;)w={up:w,n:w.n.l,s:1};case 1:if(w.s=2,!N||vr(T,w.n.to)<=0)return{value:w.n,done:!1};case 2:if(w.n.r){w.s=3,w={up:w,n:w.n.r,s:0};continue}case 3:w=w.up}return{done:!0}}}}function Yk(b){var w,T,N=(((w=b.r)===null||w===void 0?void 0:w.d)||0)-(((T=b.l)===null||T===void 0?void 0:T.d)||0),B=1<N?"r":N<-1?"l":"";B&&(w=B=="r"?"l":"r",T=n({},b),N=b[B],b.from=N.from,b.to=N.to,b[B]=N[B],T[B]=N[w],(b[w]=T).d=Jk(T)),b.d=Jk(b)}function Jk(T){var w=T.r,T=T.l;return(w?T?Math.max(w.d,T.d):w.d:T?T.d:0)+1}function V1(b,w){return s(w).forEach(function(T){b[T]?Od(b[T],w[T]):b[T]=function N(B){var K,ne,he={};for(K in B)h(B,K)&&(ne=B[K],he[K]=!ne||typeof ne!="object"||$.has(ne.constructor)?ne:N(ne));return he}(w[T])}),b}function T5(b,w){return b.all||w.all||Object.keys(b).some(function(T){return w[T]&&Kk(w[T],b[T])})}d(Mi.prototype,((Va={add:function(b){return Od(this,b),this},addKey:function(b){return Md(this,b,b),this},addKeys:function(b){var w=this;return b.forEach(function(T){return Md(w,T,T)}),this},hasKey:function(b){var w=W1(this).next(b).value;return w&&vr(w.from,b)<=0&&0<=vr(w.to,b)}})[q]=function(){return W1(this)},Va));var bc={},I5={},M5=!1;function X1(b){V1(I5,b),M5||(M5=!0,setTimeout(function(){M5=!1,O5(I5,!(I5={}))},0))}function O5(b,w){w===void 0&&(w=!1);var T=new Set;if(b.all)for(var N=0,B=Object.values(bc);N<B.length;N++)Qk(ne=B[N],b,T,w);else for(var K in b){var ne,he=/^idb\:\/\/(.*)\/(.*)\//.exec(K);he&&(K=he[1],he=he[2],(ne=bc["idb://".concat(K,"/").concat(he)])&&Qk(ne,b,T,w))}T.forEach(function(ye){return ye()})}function Qk(b,w,T,N){for(var B=[],K=0,ne=Object.entries(b.queries.query);K<ne.length;K++){for(var he=ne[K],ye=he[0],ke=[],Ee=0,de=he[1];Ee<de.length;Ee++){var Oe=de[Ee];T5(w,Oe.obsSet)?Oe.subscribers.forEach(function(Ae){return T.add(Ae)}):N&&ke.push(Oe)}N&&B.push([ye,ke])}if(N)for(var xe=0,Ce=B;xe<Ce.length;xe++){var Me=Ce[xe],ye=Me[0],ke=Me[1];b.queries.query[ye]=ke}}function Dne(b){var w=b._state,T=b._deps.indexedDB;if(w.isBeingOpened||b.idbdb)return w.dbReadyPromise.then(function(){return w.dbOpenError?Tn(w.dbOpenError):b});w.isBeingOpened=!0,w.dbOpenError=null,w.openComplete=!1;var N=w.openCanceller,B=Math.round(10*b.verno),K=!1;function ne(){if(w.openCanceller!==N)throw new Ie.DatabaseClosed("db.open() was cancelled")}function he(){return new tt(function(Oe,xe){if(ne(),!T)throw new Ie.MissingAPI;var Ce=b.name,Me=w.autoSchema||!B?T.open(Ce):T.open(Ce,B);if(!Me)throw new Ie.MissingAPI;Me.onerror=Pr(xe),Me.onblocked=Tt(b._fireOnBlocked),Me.onupgradeneeded=Tt(function(Ae){var Pe;Ee=Me.transaction,w.autoSchema&&!b._options.allowEmptyDB?(Me.onerror=Ln,Ee.abort(),Me.result.close(),(Pe=T.deleteDatabase(Ce)).onsuccess=Pe.onerror=Tt(function(){xe(new Ie.NoSuchDatabase("Database ".concat(Ce," doesnt exist")))})):(Ee.onerror=Pr(xe),Ae=Ae.oldVersion>Math.pow(2,62)?0:Ae.oldVersion,de=Ae<1,b.idbdb=Me.result,K&&Pne(b,Ee),Rne(b,Ae/10,Ee,xe))},xe),Me.onsuccess=Tt(function(){Ee=null;var Ae,Pe,Ue,je,Ye,gt=b.idbdb=Me.result,_t=x(gt.objectStoreNames);if(0<_t.length)try{var pt=gt.transaction((je=_t).length===1?je[0]:je,"readonly");if(w.autoSchema)Pe=gt,Ue=pt,(Ae=b).verno=Pe.version/10,Ue=Ae._dbSchema=H1(0,Pe,Ue),Ae._storeNames=x(Pe.objectStoreNames,0),z1(Ae,[Ae._allTables],s(Ue),Ue);else if(q1(b,b._dbSchema,pt),((Ye=S5(H1(0,(Ye=b).idbdb,pt),Ye._dbSchema)).add.length||Ye.change.some(function(vt){return vt.add.length||vt.change.length}))&&!K)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),gt.close(),B=gt.version+1,K=!0,Oe(he());U1(b,pt)}catch{}fl.push(b),gt.onversionchange=Tt(function(vt){w.vcFired=!0,b.on("versionchange").fire(vt)}),gt.onclose=Tt(function(vt){b.on("close").fire(vt)}),de&&(Ye=b._deps,pt=Ce,gt=Ye.indexedDB,Ye=Ye.IDBKeyRange,_5(gt)||pt===ko||A5(gt,Ye).put({name:pt}).catch(Qe)),Oe()},xe)}).catch(function(Oe){switch(Oe?.name){case"UnknownError":if(0<w.PR1398_maxLoop)return w.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),he();break;case"VersionError":if(0<B)return B=0,he()}return tt.reject(Oe)})}var ye,ke=w.dbReadyResolve,Ee=null,de=!1;return tt.race([N,(typeof navigator>"u"?tt.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Oe){function xe(){return indexedDB.databases().finally(Oe)}ye=setInterval(xe,100),xe()}).finally(function(){return clearInterval(ye)}):Promise.resolve()).then(he)]).then(function(){return ne(),w.onReadyBeingFired=[],tt.resolve(C5(function(){return b.on.ready.fire(b.vip)})).then(function Oe(){if(0<w.onReadyBeingFired.length){var xe=w.onReadyBeingFired.reduce(Ct,Qe);return w.onReadyBeingFired=[],tt.resolve(C5(function(){return xe(b.vip)})).then(Oe)}})}).finally(function(){w.openCanceller===N&&(w.onReadyBeingFired=null,w.isBeingOpened=!1)}).catch(function(Oe){w.dbOpenError=Oe;try{Ee&&Ee.abort()}catch{}return N===w.openCanceller&&b._close(),Tn(Oe)}).finally(function(){w.openComplete=!0,ke()}).then(function(){var Oe;return de&&(Oe={},b.tables.forEach(function(xe){xe.schema.indexes.forEach(function(Ce){Ce.name&&(Oe["idb://".concat(b.name,"/").concat(xe.name,"/").concat(Ce.name)]=new Mi(-1/0,[[[]]]))}),Oe["idb://".concat(b.name,"/").concat(xe.name,"/")]=Oe["idb://".concat(b.name,"/").concat(xe.name,"/:dels")]=new Mi(-1/0,[[[]]])}),Bs(Vi).fire(Oe),O5(Oe,!0)),b})}function N5(b){function w(K){return b.next(K)}var T=B(w),N=B(function(K){return b.throw(K)});function B(K){return function(ye){var he=K(ye),ye=he.value;return he.done?ye:ye&&typeof ye.then=="function"?ye.then(T,N):o(ye)?Promise.all(ye).then(T,N):T(ye)}}return B(w)()}function $1(b,w,T){for(var N=o(b)?b.slice():[b],B=0;B<T;++B)N.push(w);return N}var Lne={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(b){return n(n({},b),{table:function(w){var T=b.table(w),N=T.schema,B={},K=[];function ne(de,Oe,xe){var Ce=Id(de),Me=B[Ce]=B[Ce]||[],Ae=de==null?0:typeof de=="string"?1:de.length,Pe=0<Oe,Pe=n(n({},xe),{name:Pe?"".concat(Ce,"(virtual-from:").concat(xe.name,")"):xe.name,lowLevelIndex:xe,isVirtual:Pe,keyTail:Oe,keyLength:Ae,extractKey:w5(de),unique:!Pe&&xe.unique});return Me.push(Pe),Pe.isPrimaryKey||K.push(Pe),1<Ae&&ne(Ae===2?de[0]:de.slice(0,Ae-1),Oe+1,xe),Me.sort(function(Ue,je){return Ue.keyTail-je.keyTail}),Pe}w=ne(N.primaryKey.keyPath,0,N.primaryKey),B[":id"]=[w];for(var he=0,ye=N.indexes;he<ye.length;he++){var ke=ye[he];ne(ke.keyPath,0,ke)}function Ee(de){var Oe,xe=de.query.index;return xe.isVirtual?n(n({},de),{query:{index:xe.lowLevelIndex,range:(Oe=de.query.range,xe=xe.keyTail,{type:Oe.type===1?2:Oe.type,lower:$1(Oe.lower,Oe.lowerOpen?b.MAX_KEY:b.MIN_KEY,xe),lowerOpen:!0,upper:$1(Oe.upper,Oe.upperOpen?b.MIN_KEY:b.MAX_KEY,xe),upperOpen:!0})}}):de}return n(n({},T),{schema:n(n({},N),{primaryKey:w,indexes:K,getIndexByKeyPath:function(de){return(de=B[Id(de)])&&de[0]}}),count:function(de){return T.count(Ee(de))},query:function(de){return T.query(Ee(de))},openCursor:function(de){var Oe=de.query.index,xe=Oe.keyTail,Ce=Oe.isVirtual,Me=Oe.keyLength;return Ce?T.openCursor(Ee(de)).then(function(Pe){return Pe&&Ae(Pe)}):T.openCursor(de);function Ae(Pe){return Object.create(Pe,{continue:{value:function(Ue){Ue!=null?Pe.continue($1(Ue,de.reverse?b.MAX_KEY:b.MIN_KEY,xe)):de.unique?Pe.continue(Pe.key.slice(0,Me).concat(de.reverse?b.MIN_KEY:b.MAX_KEY,xe)):Pe.continue()}},continuePrimaryKey:{value:function(Ue,je){Pe.continuePrimaryKey($1(Ue,b.MAX_KEY,xe),je)}},primaryKey:{get:function(){return Pe.primaryKey}},key:{get:function(){var Ue=Pe.key;return Me===1?Ue[0]:Ue.slice(0,Me)}},value:{get:function(){return Pe.value}}})}}})}})}};function R5(b,w,T,N){return T=T||{},N=N||"",s(b).forEach(function(B){var K,ne,he;h(w,B)?(K=b[B],ne=w[B],typeof K=="object"&&typeof ne=="object"&&K&&ne?(he=Z(K))!==Z(ne)?T[N+B]=w[B]:he==="Object"?R5(K,ne,T,N+B+"."):K!==ne&&(T[N+B]=w[B]):K!==ne&&(T[N+B]=w[B])):T[N+B]=void 0}),s(w).forEach(function(B){h(b,B)||(T[N+B]=w[B])}),T}function P5(b,w){return w.type==="delete"?w.keys:w.keys||w.values.map(b.extractKey)}var Bne={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(b){return n(n({},b),{table:function(w){var T=b.table(w),N=T.schema.primaryKey;return n(n({},T),{mutate:function(B){var K=Je.trans,ne=K.table(w).hook,he=ne.deleting,ye=ne.creating,ke=ne.updating;switch(B.type){case"add":if(ye.fire===Qe)break;return K._promise("readwrite",function(){return Ee(B)},!0);case"put":if(ye.fire===Qe&&ke.fire===Qe)break;return K._promise("readwrite",function(){return Ee(B)},!0);case"delete":if(he.fire===Qe)break;return K._promise("readwrite",function(){return Ee(B)},!0);case"deleteRange":if(he.fire===Qe)break;return K._promise("readwrite",function(){return function de(Oe,xe,Ce){return T.query({trans:Oe,values:!1,query:{index:N,range:xe},limit:Ce}).then(function(Me){var Ae=Me.result;return Ee({type:"delete",keys:Ae,trans:Oe}).then(function(Pe){return 0<Pe.numFailures?Promise.reject(Pe.failures[0]):Ae.length<Ce?{failures:[],numFailures:0,lastResult:void 0}:de(Oe,n(n({},xe),{lower:Ae[Ae.length-1],lowerOpen:!0}),Ce)})})}(B.trans,B.range,1e4)},!0)}return T.mutate(B);function Ee(de){var Oe,xe,Ce,Me=Je.trans,Ae=de.keys||P5(N,de);if(!Ae)throw new Error("Keys missing");return(de=de.type==="add"||de.type==="put"?n(n({},de),{keys:Ae}):n({},de)).type!=="delete"&&(de.values=i([],de.values)),de.keys&&(de.keys=i([],de.keys)),Oe=T,Ce=Ae,((xe=de).type==="add"?Promise.resolve([]):Oe.getMany({trans:xe.trans,keys:Ce,cache:"immutable"})).then(function(Pe){var Ue=Ae.map(function(je,Ye){var gt,_t,pt,vt=Pe[Ye],It={onerror:null,onsuccess:null};return de.type==="delete"?he.fire.call(It,je,vt,Me):de.type==="add"||vt===void 0?(gt=ye.fire.call(It,je,de.values[Ye],Me),je==null&&gt!=null&&(de.keys[Ye]=je=gt,N.outbound||I(de.values[Ye],N.keyPath,je))):(gt=R5(vt,de.values[Ye]),(_t=ke.fire.call(It,gt,je,vt,Me))&&(pt=de.values[Ye],Object.keys(_t).forEach(function(At){h(pt,At)?pt[At]=_t[At]:I(pt,At,_t[At])}))),It});return T.mutate(de).then(function(je){for(var Ye=je.failures,gt=je.results,_t=je.numFailures,je=je.lastResult,pt=0;pt<Ae.length;++pt){var vt=(gt||Ae)[pt],It=Ue[pt];vt==null?It.onerror&&It.onerror(Ye[pt]):It.onsuccess&&It.onsuccess(de.type==="put"&&Pe[pt]?de.values[pt]:vt)}return{failures:Ye,results:gt,numFailures:_t,lastResult:je}}).catch(function(je){return Ue.forEach(function(Ye){return Ye.onerror&&Ye.onerror(je)}),Promise.reject(je)})})}}})}})}};function Zk(b,w,T){try{if(!w||w.keys.length<b.length)return null;for(var N=[],B=0,K=0;B<w.keys.length&&K<b.length;++B)vr(w.keys[B],b[K])===0&&(N.push(T?V(w.values[B]):w.values[B]),++K);return N.length===b.length?N:null}catch{return null}}var Une={stack:"dbcore",level:-1,create:function(b){return{table:function(w){var T=b.table(w);return n(n({},T),{getMany:function(N){if(!N.cache)return T.getMany(N);var B=Zk(N.keys,N.trans._cache,N.cache==="clone");return B?tt.resolve(B):T.getMany(N).then(function(K){return N.trans._cache={keys:N.keys,values:N.cache==="clone"?V(K):K},K})},mutate:function(N){return N.type!=="add"&&(N.trans._cache=null),T.mutate(N)}})}}}};function eA(b,w){return b.trans.mode==="readonly"&&!!b.subscr&&!b.trans.explicit&&b.trans.db._options.cache!=="disabled"&&!w.schema.primaryKey.outbound}function tA(b,w){switch(b){case"query":return w.values&&!w.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var zne={stack:"dbcore",level:0,name:"Observability",create:function(b){var w=b.schema.name,T=new Mi(b.MIN_KEY,b.MAX_KEY);return n(n({},b),{transaction:function(N,B,K){if(Je.subscr&&B!=="readonly")throw new Ie.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Je.querier));return b.transaction(N,B,K)},table:function(N){var B=b.table(N),K=B.schema,ne=K.primaryKey,de=K.indexes,he=ne.extractKey,ye=ne.outbound,ke=ne.autoIncrement&&de.filter(function(xe){return xe.compound&&xe.keyPath.includes(ne.keyPath)}),Ee=n(n({},B),{mutate:function(xe){function Ce(At){return At="idb://".concat(w,"/").concat(N,"/").concat(At),je[At]||(je[At]=new Mi)}var Me,Ae,Pe,Ue=xe.trans,je=xe.mutatedParts||(xe.mutatedParts={}),Ye=Ce(""),gt=Ce(":dels"),_t=xe.type,It=xe.type==="deleteRange"?[xe.range]:xe.type==="delete"?[xe.keys]:xe.values.length<50?[P5(ne,xe).filter(function(At){return At}),xe.values]:[],pt=It[0],vt=It[1],It=xe.trans._cache;return o(pt)?(Ye.addKeys(pt),(It=_t==="delete"||pt.length===vt.length?Zk(pt,It):null)||gt.addKeys(pt),(It||vt)&&(Me=Ce,Ae=It,Pe=vt,K.indexes.forEach(function(At){var jt=Me(At.name||"");function Ir(Wr){return Wr!=null?At.extractKey(Wr):null}function Gr(Wr){return At.multiEntry&&o(Wr)?Wr.forEach(function(Aa){return jt.addKey(Aa)}):jt.addKey(Wr)}(Ae||Pe).forEach(function(Wr,Oi){var Er=Ae&&Ir(Ae[Oi]),Oi=Pe&&Ir(Pe[Oi]);vr(Er,Oi)!==0&&(Er!=null&&Gr(Er),Oi!=null&&Gr(Oi))})}))):pt?(vt={from:(vt=pt.lower)!==null&&vt!==void 0?vt:b.MIN_KEY,to:(vt=pt.upper)!==null&&vt!==void 0?vt:b.MAX_KEY},gt.add(vt),Ye.add(vt)):(Ye.add(T),gt.add(T),K.indexes.forEach(function(At){return Ce(At.name).add(T)})),B.mutate(xe).then(function(At){return!pt||xe.type!=="add"&&xe.type!=="put"||(Ye.addKeys(At.results),ke&&ke.forEach(function(jt){for(var Ir=xe.values.map(function(Er){return jt.extractKey(Er)}),Gr=jt.keyPath.findIndex(function(Er){return Er===ne.keyPath}),Wr=0,Aa=At.results.length;Wr<Aa;++Wr)Ir[Wr][Gr]=At.results[Wr];Ce(jt.name).addKeys(Ir)})),Ue.mutatedParts=V1(Ue.mutatedParts||{},je),At})}}),de=function(Ce){var Me=Ce.query,Ce=Me.index,Me=Me.range;return[Ce,new Mi((Ce=Me.lower)!==null&&Ce!==void 0?Ce:b.MIN_KEY,(Me=Me.upper)!==null&&Me!==void 0?Me:b.MAX_KEY)]},Oe={get:function(xe){return[ne,new Mi(xe.key)]},getMany:function(xe){return[ne,new Mi().addKeys(xe.keys)]},count:de,query:de,openCursor:de};return s(Oe).forEach(function(xe){Ee[xe]=function(Ce){var Me=Je.subscr,Ae=!!Me,Pe=eA(Je,B)&&tA(xe,Ce)?Ce.obsSet={}:Me;if(Ae){var Ue=function(vt){return vt="idb://".concat(w,"/").concat(N,"/").concat(vt),Pe[vt]||(Pe[vt]=new Mi)},je=Ue(""),Ye=Ue(":dels"),Me=Oe[xe](Ce),Ae=Me[0],Me=Me[1];if((xe==="query"&&Ae.isPrimaryKey&&!Ce.values?Ye:Ue(Ae.name||"")).add(Me),!Ae.isPrimaryKey){if(xe!=="count"){var gt=xe==="query"&&ye&&Ce.values&&B.query(n(n({},Ce),{values:!1}));return B[xe].apply(this,arguments).then(function(vt){if(xe==="query"){if(ye&&Ce.values)return gt.then(function(Ir){return Ir=Ir.result,je.addKeys(Ir),vt});var It=Ce.values?vt.result.map(he):vt.result;(Ce.values?je:Ye).addKeys(It)}else if(xe==="openCursor"){var At=vt,jt=Ce.values;return At&&Object.create(At,{key:{get:function(){return Ye.addKey(At.primaryKey),At.key}},primaryKey:{get:function(){var Ir=At.primaryKey;return Ye.addKey(Ir),Ir}},value:{get:function(){return jt&&je.addKey(At.primaryKey),At.value}}})}return vt})}Ye.add(T)}}return B[xe].apply(this,arguments)}}),Ee}})}};function rA(b,w,T){if(T.numFailures===0)return w;if(w.type==="deleteRange")return null;var N=w.keys?w.keys.length:"values"in w&&w.values?w.values.length:1;return T.numFailures===N?null:(w=n({},w),o(w.keys)&&(w.keys=w.keys.filter(function(B,K){return!(K in T.failures)})),"values"in w&&o(w.values)&&(w.values=w.values.filter(function(B,K){return!(K in T.failures)})),w)}function F5(b,w){return T=b,((N=w).lower===void 0||(N.lowerOpen?0<vr(T,N.lower):0<=vr(T,N.lower)))&&(b=b,(w=w).upper===void 0||(w.upperOpen?vr(b,w.upper)<0:vr(b,w.upper)<=0));var T,N}function nA(b,w,Oe,N,B,K){if(!Oe||Oe.length===0)return b;var ne=w.query.index,he=ne.multiEntry,ye=w.query.range,ke=N.schema.primaryKey.extractKey,Ee=ne.extractKey,de=(ne.lowLevelIndex||ne).extractKey,Oe=Oe.reduce(function(xe,Ce){var Me=xe,Ae=[];if(Ce.type==="add"||Ce.type==="put")for(var Pe=new Mi,Ue=Ce.values.length-1;0<=Ue;--Ue){var je,Ye=Ce.values[Ue],gt=ke(Ye);Pe.hasKey(gt)||(je=Ee(Ye),(he&&o(je)?je.some(function(At){return F5(At,ye)}):F5(je,ye))&&(Pe.addKey(gt),Ae.push(Ye)))}switch(Ce.type){case"add":var _t=new Mi().addKeys(w.values?xe.map(function(jt){return ke(jt)}):xe),Me=xe.concat(w.values?Ae.filter(function(jt){return jt=ke(jt),!_t.hasKey(jt)&&(_t.addKey(jt),!0)}):Ae.map(function(jt){return ke(jt)}).filter(function(jt){return!_t.hasKey(jt)&&(_t.addKey(jt),!0)}));break;case"put":var pt=new Mi().addKeys(Ce.values.map(function(jt){return ke(jt)}));Me=xe.filter(function(jt){return!pt.hasKey(w.values?ke(jt):jt)}).concat(w.values?Ae:Ae.map(function(jt){return ke(jt)}));break;case"delete":var vt=new Mi().addKeys(Ce.keys);Me=xe.filter(function(jt){return!vt.hasKey(w.values?ke(jt):jt)});break;case"deleteRange":var It=Ce.range;Me=xe.filter(function(jt){return!F5(ke(jt),It)})}return Me},b);return Oe===b?b:(Oe.sort(function(xe,Ce){return vr(de(xe),de(Ce))||vr(ke(xe),ke(Ce))}),w.limit&&w.limit<1/0&&(Oe.length>w.limit?Oe.length=w.limit:b.length===w.limit&&Oe.length<w.limit&&(B.dirty=!0)),K?Object.freeze(Oe):Oe)}function iA(b,w){return vr(b.lower,w.lower)===0&&vr(b.upper,w.upper)===0&&!!b.lowerOpen==!!w.lowerOpen&&!!b.upperOpen==!!w.upperOpen}function jne(b,w){return function(T,N,B,K){if(T===void 0)return N!==void 0?-1:0;if(N===void 0)return 1;if((N=vr(T,N))===0){if(B&&K)return 0;if(B)return 1;if(K)return-1}return N}(b.lower,w.lower,b.lowerOpen,w.lowerOpen)<=0&&0<=function(T,N,B,K){if(T===void 0)return N!==void 0?1:0;if(N===void 0)return-1;if((N=vr(T,N))===0){if(B&&K)return 0;if(B)return-1;if(K)return 1}return N}(b.upper,w.upper,b.upperOpen,w.upperOpen)}function Hne(b,w,T,N){b.subscribers.add(T),N.addEventListener("abort",function(){var B,K;b.subscribers.delete(T),b.subscribers.size===0&&(B=b,K=w,setTimeout(function(){B.subscribers.size===0&&X(K,B)},3e3))})}var qne={stack:"dbcore",level:0,name:"Cache",create:function(b){var w=b.schema.name;return n(n({},b),{transaction:function(T,N,B){var K,ne,he=b.transaction(T,N,B);return N==="readwrite"&&(ne=(K=new AbortController).signal,B=function(ye){return function(){if(K.abort(),N==="readwrite"){for(var ke=new Set,Ee=0,de=T;Ee<de.length;Ee++){var Oe=de[Ee],xe=bc["idb://".concat(w,"/").concat(Oe)];if(xe){var Ce=b.table(Oe),Me=xe.optimisticOps.filter(function(jt){return jt.trans===he});if(he._explicit&&ye&&he.mutatedParts)for(var Ae=0,Pe=Object.values(xe.queries.query);Ae<Pe.length;Ae++)for(var Ue=0,je=(_t=Pe[Ae]).slice();Ue<je.length;Ue++)T5((pt=je[Ue]).obsSet,he.mutatedParts)&&(X(_t,pt),pt.subscribers.forEach(function(jt){return ke.add(jt)}));else if(0<Me.length){xe.optimisticOps=xe.optimisticOps.filter(function(jt){return jt.trans!==he});for(var Ye=0,gt=Object.values(xe.queries.query);Ye<gt.length;Ye++)for(var _t,pt,vt,It=0,At=(_t=gt[Ye]).slice();It<At.length;It++)(pt=At[It]).res!=null&&he.mutatedParts&&(ye&&!pt.dirty?(vt=Object.isFrozen(pt.res),vt=nA(pt.res,pt.req,Me,Ce,pt,vt),pt.dirty?(X(_t,pt),pt.subscribers.forEach(function(jt){return ke.add(jt)})):vt!==pt.res&&(pt.res=vt,pt.promise=tt.resolve({result:vt}))):(pt.dirty&&X(_t,pt),pt.subscribers.forEach(function(jt){return ke.add(jt)})))}}}ke.forEach(function(jt){return jt()})}}},he.addEventListener("abort",B(!1),{signal:ne}),he.addEventListener("error",B(!1),{signal:ne}),he.addEventListener("complete",B(!0),{signal:ne})),he},table:function(T){var N=b.table(T),B=N.schema.primaryKey;return n(n({},N),{mutate:function(K){var ne=Je.trans;if(B.outbound||ne.db._options.cache==="disabled"||ne.explicit||ne.idbtrans.mode!=="readwrite")return N.mutate(K);var he=bc["idb://".concat(w,"/").concat(T)];return he?(ne=N.mutate(K),K.type!=="add"&&K.type!=="put"||!(50<=K.values.length||P5(B,K).some(function(ye){return ye==null}))?(he.optimisticOps.push(K),K.mutatedParts&&X1(K.mutatedParts),ne.then(function(ye){0<ye.numFailures&&(X(he.optimisticOps,K),(ye=rA(0,K,ye))&&he.optimisticOps.push(ye),K.mutatedParts&&X1(K.mutatedParts))}),ne.catch(function(){X(he.optimisticOps,K),K.mutatedParts&&X1(K.mutatedParts)})):ne.then(function(ye){var ke=rA(0,n(n({},K),{values:K.values.map(function(Ee,de){var Oe;return ye.failures[de]?Ee:(Ee=(Oe=B.keyPath)!==null&&Oe!==void 0&&Oe.includes(".")?V(Ee):n({},Ee),I(Ee,B.keyPath,ye.results[de]),Ee)})}),ye);he.optimisticOps.push(ke),queueMicrotask(function(){return K.mutatedParts&&X1(K.mutatedParts)})}),ne):N.mutate(K)},query:function(K){if(!eA(Je,N)||!tA("query",K))return N.query(K);var ne=((ke=Je.trans)===null||ke===void 0?void 0:ke.db._options.cache)==="immutable",de=Je,he=de.requery,ye=de.signal,ke=function(Ce,Me,Ae,Pe){var Ue=bc["idb://".concat(Ce,"/").concat(Me)];if(!Ue)return[];if(!(Me=Ue.queries[Ae]))return[null,!1,Ue,null];var je=Me[(Pe.query?Pe.query.index.name:null)||""];if(!je)return[null,!1,Ue,null];switch(Ae){case"query":var Ye=je.find(function(gt){return gt.req.limit===Pe.limit&&gt.req.values===Pe.values&&iA(gt.req.query.range,Pe.query.range)});return Ye?[Ye,!0,Ue,je]:[je.find(function(gt){return("limit"in gt.req?gt.req.limit:1/0)>=Pe.limit&&(!Pe.values||gt.req.values)&&jne(gt.req.query.range,Pe.query.range)}),!1,Ue,je];case"count":return Ye=je.find(function(gt){return iA(gt.req.query.range,Pe.query.range)}),[Ye,!!Ye,Ue,je]}}(w,T,"query",K),Ee=ke[0],de=ke[1],Oe=ke[2],xe=ke[3];return Ee&&de?Ee.obsSet=K.obsSet:(de=N.query(K).then(function(Ce){var Me=Ce.result;if(Ee&&(Ee.res=Me),ne){for(var Ae=0,Pe=Me.length;Ae<Pe;++Ae)Object.freeze(Me[Ae]);Object.freeze(Me)}else Ce.result=V(Me);return Ce}).catch(function(Ce){return xe&&Ee&&X(xe,Ee),Promise.reject(Ce)}),Ee={obsSet:K.obsSet,promise:de,subscribers:new Set,type:"query",req:K,dirty:!1},xe?xe.push(Ee):(xe=[Ee],(Oe=Oe||(bc["idb://".concat(w,"/").concat(T)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[K.query.index.name||""]=xe)),Hne(Ee,xe,he,ye),Ee.promise.then(function(Ce){return{result:nA(Ce.result,K,Oe?.optimisticOps,N,Ee,ne)}})}})}})}};function K1(b,w){return new Proxy(b,{get:function(T,N,B){return N==="db"?w:Reflect.get(T,N,B)}})}var Co=(qn.prototype.version=function(b){if(isNaN(b)||b<.1)throw new Ie.Type("Given version is not a positive number");if(b=Math.round(10*b)/10,this.idbdb||this._state.isBeingOpened)throw new Ie.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,b);var w=this._versions,T=w.filter(function(N){return N._cfg.version===b})[0];return T||(T=new this.Version(b),w.push(T),w.sort(Nne),T.stores({}),this._state.autoSchema=!1,T)},qn.prototype._whenReady=function(b){var w=this;return this.idbdb&&(this._state.openComplete||Je.letThrough||this._vip)?b():new tt(function(T,N){if(w._state.openComplete)return N(new Ie.DatabaseClosed(w._state.dbOpenError));if(!w._state.isBeingOpened){if(!w._state.autoOpen)return void N(new Ie.DatabaseClosed);w.open().catch(Qe)}w._state.dbReadyPromise.then(T,N)}).then(b)},qn.prototype.use=function(b){var w=b.stack,T=b.create,N=b.level,B=b.name;return B&&this.unuse({stack:w,name:B}),b=this._middlewares[w]||(this._middlewares[w]=[]),b.push({stack:w,create:T,level:N??10,name:B}),b.sort(function(K,ne){return K.level-ne.level}),this},qn.prototype.unuse=function(b){var w=b.stack,T=b.name,N=b.create;return w&&this._middlewares[w]&&(this._middlewares[w]=this._middlewares[w].filter(function(B){return N?B.create!==N:!!T&&B.name!==T})),this},qn.prototype.open=function(){var b=this;return ka(Zr,function(){return Dne(b)})},qn.prototype._close=function(){var b=this._state,w=fl.indexOf(this);if(0<=w&&fl.splice(w,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}b.isBeingOpened||(b.dbReadyPromise=new tt(function(T){b.dbReadyResolve=T}),b.openCanceller=new tt(function(T,N){b.cancelOpen=N}))},qn.prototype.close=function(T){var w=(T===void 0?{disableAutoOpen:!0}:T).disableAutoOpen,T=this._state;w?(T.isBeingOpened&&T.cancelOpen(new Ie.DatabaseClosed),this._close(),T.autoOpen=!1,T.dbOpenError=new Ie.DatabaseClosed):(this._close(),T.autoOpen=this._options.autoOpen||T.isBeingOpened,T.openComplete=!1,T.dbOpenError=null)},qn.prototype.delete=function(b){var w=this;b===void 0&&(b={disableAutoOpen:!0});var T=0<arguments.length&&typeof arguments[0]!="object",N=this._state;return new tt(function(B,K){function ne(){w.close(b);var he=w._deps.indexedDB.deleteDatabase(w.name);he.onsuccess=Tt(function(){var ye,ke,Ee;ye=w._deps,ke=w.name,Ee=ye.indexedDB,ye=ye.IDBKeyRange,_5(Ee)||ke===ko||A5(Ee,ye).delete(ke).catch(Qe),B()}),he.onerror=Pr(K),he.onblocked=w._fireOnBlocked}if(T)throw new Ie.InvalidArgument("Invalid closeOptions argument to db.delete()");N.isBeingOpened?N.dbReadyPromise.then(ne):ne()})},qn.prototype.backendDB=function(){return this.idbdb},qn.prototype.isOpen=function(){return this.idbdb!==null},qn.prototype.hasBeenClosed=function(){var b=this._state.dbOpenError;return b&&b.name==="DatabaseClosed"},qn.prototype.hasFailed=function(){return this._state.dbOpenError!==null},qn.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(qn.prototype,"tables",{get:function(){var b=this;return s(this._allTables).map(function(w){return b._allTables[w]})},enumerable:!1,configurable:!0}),qn.prototype.transaction=function(){var b=(function(w,T,N){var B=arguments.length;if(B<2)throw new Ie.InvalidArgument("Too few arguments");for(var K=new Array(B-1);--B;)K[B-1]=arguments[B];return N=K.pop(),[w,D(K),N]}).apply(this,arguments);return this._transaction.apply(this,b)},qn.prototype._transaction=function(b,w,T){var N=this,B=Je.trans;B&&B.db===this&&b.indexOf("!")===-1||(B=null);var K,ne,he=b.indexOf("?")!==-1;b=b.replace("!","").replace("?","");try{if(ne=w.map(function(ke){if(ke=ke instanceof N.Table?ke.name:ke,typeof ke!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ke}),b=="r"||b===Sd)K=Sd;else{if(b!="rw"&&b!=ft)throw new Ie.InvalidArgument("Invalid transaction mode: "+b);K=ft}if(B){if(B.mode===Sd&&K===ft){if(!he)throw new Ie.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");B=null}B&&ne.forEach(function(ke){if(B&&B.storeNames.indexOf(ke)===-1){if(!he)throw new Ie.SubTransaction("Table "+ke+" not included in parent transaction.");B=null}}),he&&B&&!B.active&&(B=null)}}catch(ke){return B?B._promise(null,function(Ee,de){de(ke)}):Tn(ke)}var ye=(function ke(Ee,de,Oe,xe,Ce){return tt.resolve().then(function(){var Me=Je.transless||Je,Ae=Ee._createTransaction(de,Oe,Ee._dbSchema,xe);if(Ae.explicit=!0,Me={trans:Ae,transless:Me},xe)Ae.idbtrans=xe.idbtrans;else try{Ae.create(),Ae.idbtrans._explicit=!0,Ee._state.PR1398_maxLoop=3}catch(je){return je.name===Le.InvalidState&&Ee.isOpen()&&0<--Ee._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Ee.close({disableAutoOpen:!1}),Ee.open().then(function(){return ke(Ee,de,Oe,null,Ce)})):Tn(je)}var Pe,Ue=be(Ce);return Ue&&Fs(),Me=tt.follow(function(){var je;(Pe=Ce.call(Ae,Ae))&&(Ue?(je=Ga.bind(null,null),Pe.then(je,je)):typeof Pe.next=="function"&&typeof Pe.throw=="function"&&(Pe=N5(Pe)))},Me),(Pe&&typeof Pe.then=="function"?tt.resolve(Pe).then(function(je){return Ae.active?je:Tn(new Ie.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):Me.then(function(){return Pe})).then(function(je){return xe&&Ae._resolve(),Ae._completion.then(function(){return je})}).catch(function(je){return Ae._reject(je),Tn(je)})})}).bind(null,this,K,ne,B,T);return B?B._promise(K,ye,"lock"):Je.trans?ka(Je.transless,function(){return N._whenReady(ye)}):this._whenReady(ye)},qn.prototype.table=function(b){if(!h(this._allTables,b))throw new Ie.InvalidTable("Table ".concat(b," does not exist"));return this._allTables[b]},qn);function qn(b,w){var T=this;this._middlewares={},this.verno=0;var N=qn.dependencies;this._options=w=n({addons:qn.addons,autoOpen:!0,indexedDB:N.indexedDB,IDBKeyRange:N.IDBKeyRange,cache:"cloned"},w),this._deps={indexedDB:w.indexedDB,IDBKeyRange:w.IDBKeyRange},N=w.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var B,K,ne,he,ye,ke={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Qe,dbReadyPromise:null,cancelOpen:Qe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:w.autoOpen};ke.dbReadyPromise=new tt(function(de){ke.dbReadyResolve=de}),ke.openCanceller=new tt(function(de,Oe){ke.cancelOpen=Oe}),this._state=ke,this.name=b,this.on=gl(this,"populate","blocked","versionchange","close",{ready:[Ct,Qe]}),this.on.ready.subscribe=S(this.on.ready.subscribe,function(de){return function(Oe,xe){qn.vip(function(){var Ce,Me=T._state;Me.openComplete?(Me.dbOpenError||tt.resolve().then(Oe),xe&&de(Oe)):Me.onReadyBeingFired?(Me.onReadyBeingFired.push(Oe),xe&&de(Oe)):(de(Oe),Ce=T,xe||de(function Ae(){Ce.on.ready.unsubscribe(Oe),Ce.on.ready.unsubscribe(Ae)}))})}}),this.Collection=(B=this,pl(Cd.prototype,function(Pe,Ae){this.db=B;var xe=qr,Ce=null;if(Ae)try{xe=Ae()}catch(Ue){Ce=Ue}var Me=Pe._ctx,Ae=Me.table,Pe=Ae.hook.reading.fire;this._ctx={table:Ae,index:Me.index,isPrimKey:!Me.index||Ae.schema.primKey.keyPath&&Me.index===Ae.schema.primKey.name,range:xe,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Ce,or:Me.or,valueMapper:Pe!==mt?Pe:null}})),this.Table=(K=this,pl(Ti.prototype,function(de,Oe,xe){this.db=K,this._tx=xe,this.name=de,this.schema=Oe,this.hook=K._allTables[de]?K._allTables[de].hook:gl(null,{creating:[Ge,Qe],reading:[Ke,mt],updating:[lt,Qe],deleting:[ot,Qe]})})),this.Transaction=(ne=this,pl(Tne.prototype,function(de,Oe,xe,Ce,Me){var Ae=this;this.db=ne,this.mode=de,this.storeNames=Oe,this.schema=xe,this.chromeTransactionDurability=Ce,this.idbtrans=null,this.on=gl(this,"complete","error","abort"),this.parent=Me||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new tt(function(Pe,Ue){Ae._resolve=Pe,Ae._reject=Ue}),this._completion.then(function(){Ae.active=!1,Ae.on.complete.fire()},function(Pe){var Ue=Ae.active;return Ae.active=!1,Ae.on.error.fire(Pe),Ae.parent?Ae.parent._reject(Pe):Ue&&Ae.idbtrans&&Ae.idbtrans.abort(),Tn(Pe)})})),this.Version=(he=this,pl(Fne.prototype,function(de){this.db=he,this._cfg={version:de,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(ye=this,pl(Kt.prototype,function(de,Oe,xe){if(this.db=ye,this._ctx={table:de,index:Oe===":id"?null:Oe,or:xe},this._cmp=this._ascending=vr,this._descending=function(Ce,Me){return vr(Me,Ce)},this._max=function(Ce,Me){return 0<vr(Ce,Me)?Ce:Me},this._min=function(Ce,Me){return vr(Ce,Me)<0?Ce:Me},this._IDBKeyRange=ye._deps.IDBKeyRange,!this._IDBKeyRange)throw new Ie.MissingAPI})),this.on("versionchange",function(de){0<de.newVersion?console.warn("Another connection wants to upgrade database '".concat(T.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(T.name,"'. Closing db now to resume the delete request.")),T.close({disableAutoOpen:!1})}),this.on("blocked",function(de){!de.newVersion||de.newVersion<de.oldVersion?console.warn("Dexie.delete('".concat(T.name,"') was blocked")):console.warn("Upgrade '".concat(T.name,"' blocked by other connection holding version ").concat(de.oldVersion/10))}),this._maxKey=Td(w.IDBKeyRange),this._createTransaction=function(de,Oe,xe,Ce){return new T.Transaction(de,Oe,xe,T._options.chromeTransactionDurability,Ce)},this._fireOnBlocked=function(de){T.on("blocked").fire(de),fl.filter(function(Oe){return Oe.name===T.name&&Oe!==T&&!Oe._state.vcFired}).map(function(Oe){return Oe.on("versionchange").fire(de)})},this.use(Une),this.use(qne),this.use(zne),this.use(Lne),this.use(Bne);var Ee=new Proxy(this,{get:function(de,Oe,xe){if(Oe==="_vip")return!0;if(Oe==="table")return function(Me){return K1(T.table(Me),Ee)};var Ce=Reflect.get(de,Oe,xe);return Ce instanceof Ti?K1(Ce,Ee):Oe==="tables"?Ce.map(function(Me){return K1(Me,Ee)}):Oe==="_createTransaction"?function(){return K1(Ce.apply(this,arguments),Ee)}:Ce}});this.vip=Ee,N.forEach(function(de){return de(T)})}var Y1,Va=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Gne=(D5.prototype.subscribe=function(b,w,T){return this._subscribe(b&&typeof b!="function"?b:{next:b,error:w,complete:T})},D5.prototype[Va]=function(){return this},D5);function D5(b){this._subscribe=b}try{Y1={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{Y1={indexedDB:null,IDBKeyRange:null}}function aA(b){var w,T=!1,N=new Gne(function(B){var K=be(b),ne,he=!1,ye={},ke={},Ee={get closed(){return he},unsubscribe:function(){he||(he=!0,ne&&ne.abort(),de&&Bs.storagemutated.unsubscribe(xe))}};B.start&&B.start(Ee);var de=!1,Oe=function(){return aa(Ce)},xe=function(Me){V1(ye,Me),T5(ke,ye)&&Oe()},Ce=function(){var Me,Ae,Pe;!he&&Y1.indexedDB&&(ye={},Me={},ne&&ne.abort(),ne=new AbortController,Pe=function(Ue){var je=wr();try{K&&Fs();var Ye=Ei(b,Ue);return Ye=K?Ye.finally(Ga):Ye}finally{je&&en()}}(Ae={subscr:Me,signal:ne.signal,requery:Oe,querier:b,trans:null}),Promise.resolve(Pe).then(function(Ue){T=!0,w=Ue,he||Ae.signal.aborted||(ye={},function(je){for(var Ye in je)if(h(je,Ye))return;return 1}(ke=Me)||de||(Bs(Vi,xe),de=!0),aa(function(){return!he&&B.next&&B.next(Ue)}))},function(Ue){T=!1,["DatabaseClosedError","AbortError"].includes(Ue?.name)||he||aa(function(){he||B.error&&B.error(Ue)})}))};return setTimeout(Oe,0),Ee});return N.hasValue=function(){return T},N.getValue=function(){return w},N}var vc=Co;function L5(b){var w=bl;try{bl=!0,Bs.storagemutated.fire(b),O5(b,!0)}finally{bl=w}}d(vc,n(n({},We),{delete:function(b){return new vc(b,{addons:[]}).delete()},exists:function(b){return new vc(b,{addons:[]}).open().then(function(w){return w.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(b){try{return w=vc.dependencies,T=w.indexedDB,w=w.IDBKeyRange,(_5(T)?Promise.resolve(T.databases()).then(function(N){return N.map(function(B){return B.name}).filter(function(B){return B!==ko})}):A5(T,w).toCollection().primaryKeys()).then(b)}catch{return Tn(new Ie.MissingAPI)}var w,T},defineClass:function(){return function(b){l(this,b)}},ignoreTransaction:function(b){return Je.trans?ka(Je.transless,b):b()},vip:C5,async:function(b){return function(){try{var w=N5(b.apply(this,arguments));return w&&typeof w.then=="function"?w:tt.resolve(w)}catch(T){return Tn(T)}}},spawn:function(b,w,T){try{var N=N5(b.apply(T,w||[]));return N&&typeof N.then=="function"?N:tt.resolve(N)}catch(B){return Tn(B)}},currentTransaction:{get:function(){return Je.trans||null}},waitFor:function(b,w){return w=tt.resolve(typeof b=="function"?vc.ignoreTransaction(b):b).timeout(w||6e4),Je.trans?Je.trans.waitFor(w):w},Promise:tt,debug:{get:function(){return St},set:function(b){Ze(b)}},derive:m,extend:l,props:d,override:S,Events:gl,on:Bs,liveQuery:aA,extendObservabilitySet:V1,getByKeyPath:k,setByKeyPath:I,delByKeyPath:function(b,w){typeof w=="string"?I(b,w,void 0):"length"in w&&[].map.call(w,function(T){I(b,T,void 0)})},shallowClone:R,deepClone:V,getObjectDiff:R5,cmp:vr,asap:C,minKey:-1/0,addons:[],connections:fl,errnames:Le,dependencies:Y1,cache:bc,semVer:"4.0.11",version:"4.0.11".split(".").map(function(b){return parseInt(b)}).reduce(function(b,w,T){return b+w/Math.pow(10,2*T)})})),vc.maxKey=Td(vc.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Bs(Vi,function(b){bl||(b=new CustomEvent(Ed,{detail:b}),bl=!0,dispatchEvent(b),bl=!1)}),addEventListener(Ed,function(b){b=b.detail,bl||L5(b)}));var Fu,bl=!1,sA=function(){};return typeof BroadcastChannel<"u"&&((sA=function(){(Fu=new BroadcastChannel(Ed)).onmessage=function(b){return b.data&&L5(b.data)}})(),typeof Fu.unref=="function"&&Fu.unref(),Bs(Vi,function(b){bl||Fu.postMessage(b)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(b){if(!Co.disableBfCache&&b.persisted){St&&console.debug("Dexie: handling persisted pagehide"),Fu?.close();for(var w=0,T=fl;w<T.length;w++)T[w].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(b){!Co.disableBfCache&&b.persisted&&(St&&console.debug("Dexie: handling persisted pageshow"),sA(),L5({all:new Mi(-1/0,[[]])}))})),tt.rejectionMapper=function(b,w){return!b||b instanceof W||b instanceof TypeError||b instanceof SyntaxError||!b.name||!Ve[b.name]?b:(w=new Ve[b.name](w||b.message,b),"stack"in b&&p(w,"stack",{get:function(){return this.inner.stack}}),w)},Ze(St),n(Co,Object.freeze({__proto__:null,Dexie:Co,liveQuery:aA,Entity:Dn,cmp:vr,PropModification:Ii,replacePrefix:function(b,w){return new Ii({replacePrefix:[b,w]})},add:function(b){return new Ii({add:b})},remove:function(b){return new Ii({remove:b})},default:Co,RangeSet:Mi,mergeRanges:Od,rangesOverlap:Kk}),{default:Co}),Co})}(Ef)),Ef.exports}var JB=YB();const lb=x0(JB),x7=Symbol.for("Dexie"),Tf=globalThis[x7]||(globalThis[x7]=lb);if(lb.semVer!==Tf.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${lb.semVer} and ${Tf.semVer}`);const{liveQuery:tie,mergeRanges:rie,rangesOverlap:nie,RangeSet:iie,cmp:aie,Entity:sie,PropModification:oie,replacePrefix:lie,add:cie,remove:uie}=Tf;function gu(r,e,t=!1){const n=[],i=new Map;for(const o of r)i.set(o.id,o);let a=i.get(e);if(!a){let o=-1;for(const l of r)l.timestamp>o&&(a=l,o=l.timestamp)}let s=a;for(;s&&((s.type!=="root"||t)&&n.push(s),s.parent!==null);)s=i.get(s.parent);return n.sort((o,l)=>o.timestamp-l.timestamp),n}function If(r,e){const t=new Map;for(const i of r)t.set(i.id,i);let n=t.get(e);for(;n&&n.children.length>0;){const i=n.children[n.children.length-1];n=t.get(i)}return n?.id??e}function S7(r,e){const t=new Map;for(const a of r)t.set(a.id,a);const n=[],i=[e];for(;i.length>0;){const a=i.shift(),s=t.get(a);if(s)for(const o of s.children)n.push(o),i.push(o)}return n}function QB(r,e){const t=new Map;for(const l of r)t.set(l.id,l);const n=t.get(e);if(!n)return null;if(n.parent===null)return{message:n,siblingIds:[e],currentIndex:0,totalSiblings:1};const i=t.get(n.parent);if(!i)return{message:n,siblingIds:[e],currentIndex:0,totalSiblings:1};const a=i.children,s=a.map(l=>If(r,l)),o=a.indexOf(e);return{message:n,siblingIds:s,currentIndex:o,totalSiblings:a.length}}const mi=[];for(let r=0;r<256;++r)mi.push((r+256).toString(16).slice(1));function ZB(r,e=0){return(mi[r[e+0]]+mi[r[e+1]]+mi[r[e+2]]+mi[r[e+3]]+"-"+mi[r[e+4]]+mi[r[e+5]]+"-"+mi[r[e+6]]+mi[r[e+7]]+"-"+mi[r[e+8]]+mi[r[e+9]]+"-"+mi[r[e+10]]+mi[r[e+11]]+mi[r[e+12]]+mi[r[e+13]]+mi[r[e+14]]+mi[r[e+15]]).toLowerCase()}let cb;const eU=new Uint8Array(16);function tU(){if(!cb){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");cb=crypto.getRandomValues.bind(crypto)}return cb(eU)}const k7={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function rU(r,e,t){r=r||{};const n=r.random??r.rng?.()??tU();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,ZB(n)}function Mf(r,e,t){return k7.randomUUID&&!r?k7.randomUUID():rU(r)}class nU extends Tf{conversations;messages;constructor(){super("LlamacppWebui"),this.version(1).stores({conversations:"id, lastModified, currNode, name",messages:"id, convId, type, role, timestamp, parent, children"})}}const Br=new nU;class ir{static async addMessage(e){const t={...e,id:Mf()};return await Br.messages.add(t),t}static async createConversation(e){const t={id:Mf(),name:e,lastModified:Date.now(),currNode:""};return await Br.conversations.add(t),t}static async createMessageBranch(e,t){return await Br.transaction("rw",[Br.conversations,Br.messages],async()=>{if(t!==null&&!await Br.messages.get(t))throw new Error(`Parent message ${t} not found`);const n={...e,id:Mf(),parent:t,children:[]};if(await Br.messages.add(n),t!==null){const i=await Br.messages.get(t);i&&await Br.messages.update(t,{children:[...i.children,n.id]})}return await this.updateConversation(e.convId,{currNode:n.id}),n})}static async createRootMessage(e){const t={id:Mf(),convId:e,type:"root",timestamp:Date.now(),role:"system",content:"",parent:null,thinking:"",children:[]};return await Br.messages.add(t),t.id}static async deleteConversation(e){await Br.transaction("rw",[Br.conversations,Br.messages],async()=>{await Br.conversations.delete(e),await Br.messages.where("convId").equals(e).delete()})}static async deleteMessage(e){await Br.transaction("rw",Br.messages,async()=>{const t=await Br.messages.get(e);if(t){if(t.parent){const n=await Br.messages.get(t.parent);n&&(n.children=n.children.filter(i=>i!==e),await Br.messages.put(n))}await Br.messages.delete(e)}})}static async deleteMessageCascading(e,t){return await Br.transaction("rw",Br.messages,async()=>{const n=await Br.messages.where("convId").equals(e).toArray(),i=S7(n,t),a=[t,...i],s=await Br.messages.get(t);if(s&&s.parent){const o=await Br.messages.get(s.parent);o&&(o.children=o.children.filter(l=>l!==t),await Br.messages.put(o))}return await Br.messages.bulkDelete(a),a})}static async getAllConversations(){return await Br.conversations.orderBy("lastModified").reverse().toArray()}static async getConversation(e){return await Br.conversations.get(e)}static async getConversationLeafNodes(e){return(await this.getConversationMessages(e)).filter(n=>n.children.length===0).map(n=>n.id)}static async getConversationMessages(e){return await Br.messages.where("convId").equals(e).sortBy("timestamp")}static async getConversationPath(e){const t=await this.getConversation(e);if(!t)return[];const n=await this.getConversationMessages(e);if(n.length===0)return[];const i=t.currNode||n.reduce((a,s)=>s.timestamp>a.timestamp?s:a).id;return gu(n,i,!1)}static async updateConversation(e,t){await Br.conversations.update(e,{...t,lastModified:Date.now()})}static async updateCurrentNode(e,t){await this.updateConversation(e,{currNode:t})}static async updateMessage(e,t){await Br.messages.update(e,t)}static async importConversations(e){let t=0,n=0;return await Br.transaction("rw",[Br.conversations,Br.messages],async()=>{for(const i of e){const{conv:a,messages:s}=i;if(await Br.conversations.get(a.id)){console.warn(`Conversation "${a.name}" already exists, skipping...`),n++;continue}await Br.conversations.add(a);for(const l of s)await Br.messages.put(l);t++}return{imported:t,skipped:n}})}}function iU(r){const e=r.trim();if(!e)return"";const i=e.split(/[\\/]/).pop()?.trim();return i&&i.length>0?i:e}const aU=Array(12).fill(0);var sU=ee('<div class="sonner-loading-bar"></div>'),oU=ee('<div><div class="sonner-spinner"></div></div>');function lU(r,e){ge(e,!0);var t=oU(),n=te(t);_n(n,23,()=>aU,(i,a)=>`spinner-bar-${a}`,(i,a)=>{var s=sU();_(i,s)}),Q(n),Q(t),qe(i=>{tr(t,1,i),Jt(t,"data-visible",e.visible)},[()=>ai(["sonner-loading-wrapper",e.class].filter(Boolean).join(" "))]),_(r,t),pe()}function lo(...r){return r.filter(Boolean).join(" ")}const cU=typeof document<"u",uU=typeof window<"u"?window:void 0;function hU(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}let dU=class{#e;#t;constructor(e={}){const{window:t=uU,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Cl(i=>{const a=$r(t,"focusin",i),s=$r(t,"focusout",i);return()=>{a(),s()}}))}get current(){return this.#t?.(),this.#e?hU(this.#e):null}};new dU;class fU{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return gg(this.#t)}get(){const e=Ac(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=Ac(this.#t);return t===void 0?e:t}set(e){return qd(this.#t,e)}}const gU=new fU("<Toaster/>");let A7=0;class pU{#e=oe(Mr([]));get toasts(){return g(this.#e)}set toasts(e){O(this.#e,e,!0)}#t=oe(Mr([]));get heights(){return g(this.#t)}set heights(e){O(this.#t,e,!0)}#r=e=>{const t=this.toasts.findIndex(n=>n.id===e);return t===-1?null:t};addToast=e=>{cU&&this.toasts.unshift(e)};updateToast=({id:e,data:t,type:n,message:i})=>{const a=this.toasts.findIndex(o=>o.id===e),s=this.toasts[a];this.toasts[a]={...s,...t,id:e,title:i,type:n,updated:!0}};create=e=>{const{message:t,...n}=e,i=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:A7++,a=e.dismissable===void 0?!0:e.dismissable,s=e.type===void 0?"default":e.type;return dn(()=>{this.toasts.find(l=>l.id===i)?this.updateToast({id:i,data:e,type:s,message:t,dismissable:a}):this.addToast({...n,id:i,title:t,dismissable:a,type:s})}),i};dismiss=e=>(dn(()=>{if(e===void 0){this.toasts=this.toasts.map(n=>({...n,dismiss:!0}));return}const t=this.toasts.findIndex(n=>n.id===e);this.toasts[t]&&(this.toasts[t]={...this.toasts[t],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const t=this.#r(e);if(t!==null)return this.toasts.splice(t,1),e};message=(e,t)=>this.create({...t,type:"default",message:e});error=(e,t)=>this.create({...t,type:"error",message:e});success=(e,t)=>this.create({...t,type:"success",message:e});info=(e,t)=>this.create({...t,type:"info",message:e});warning=(e,t)=>this.create({...t,type:"warning",message:e});loading=(e,t)=>this.create({...t,type:"loading",message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:typeof t.loading=="string"?t.loading:t.loading()}));const i=e instanceof Promise?e:e();let a=n!==void 0;return i.then(s=>{if(typeof s=="object"&&s&&"ok"in s&&typeof s.ok=="boolean"&&!s.ok){a=!1;const o=mU(s);this.create({id:n,type:"error",message:o})}else if(t.success!==void 0){a=!1;const o=typeof t.success=="function"?t.success(s):t.success;this.create({id:n,type:"success",message:o})}}).catch(s=>{if(t.error!==void 0){a=!1;const o=typeof t.error=="function"?t.error(s):t.error;this.create({id:n,type:"error",message:o})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),t.finally?.()}),n};custom=(e,t)=>{const n=t?.id||A7++;return this.create({component:e,id:n,...t}),n};removeHeight=e=>{this.heights=this.heights.filter(t=>t.toastId!==e)};setHeight=e=>{const t=this.#r(e.toastId);if(t===null){this.heights.push(e);return}this.heights[t]=e};reset=()=>{this.toasts=[],this.heights=[]}}function mU(r){return r&&typeof r=="object"&&"status"in r?`HTTP error! Status: ${r.status}`:`Error! ${r}`}const gn=new pU;function bU(r,e){return gn.create({message:r,...e})}class vU{#e=j(()=>gn.toasts.filter(e=>!e.dismiss));get toasts(){return g(this.#e)}}const es=Object.assign(bU,{success:gn.success,info:gn.info,warning:gn.warning,error:gn.error,custom:gn.custom,message:gn.message,promise:gn.promise,dismiss:gn.dismiss,loading:gn.loading,getActiveToasts:()=>gn.toasts.filter(r=>!r.dismiss)});function Of(r){return r.label!==void 0}function yU(){let r=oe(Mr(typeof document<"u"?document.hidden:!1));return Ft(()=>$r(document,"visibilitychange",()=>{O(r,document.hidden,!0)})),{get current(){return g(r)}}}const _7=4e3,wU=14,xU=45,SU=200,kU=.05,AU={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function _U(r){const[e,t]=r.split("-"),n=[];return e&&n.push(e),t&&n.push(t),n}function C7(r){return 1/(1.5+Math.abs(r)/20)}var CU=ee("<div><!></div>"),EU=(r,e,t,n,i)=>{g(e)||!g(t)||(n(),i.toast.onDismiss?.(i.toast))},TU=ee('<button data-close-button=""><!></button>'),IU=ee('<div data-icon=""><!> <!></div>'),MU=ee('<div data-description=""><!></div>'),OU=(r,e,t,n)=>{Of(e.toast.cancel)&&g(t)&&(e.toast.cancel?.onClick?.(r),n())},NU=ee('<button data-button="" data-cancel=""> </button>'),RU=(r,e,t)=>{Of(e.toast.action)&&(e.toast.action?.onClick(r),!r.defaultPrevented&&t())},PU=ee('<button data-button=""> </button>'),FU=ee('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),DU=ee('<li data-sonner-toast=""><!> <!></li>');function LU(r,e){ge(e,!0);const t=Ze=>{var nt=J(),ht=F(nt);{var kt=Fe=>{var it=CU(),yt=te(it);Te(yt,()=>e.loadingIcon),Q(it),qe($t=>{tr(it,1,$t),Jt(it,"data-visible",g(k)==="loading")},[()=>ai(lo(g(ie)?.loader,e.toast?.classes?.loader,"sonner-loader"))]),_(Fe,it)},Se=Fe=>{{let it=j(()=>lo(g(ie)?.loader,e.toast.classes?.loader)),yt=j(()=>g(k)==="loading");lU(Fe,{get class(){return g(it)},get visible(){return g(yt)}})}};ce(ht,Fe=>{e.loadingIcon?Fe(kt):Fe(Se,!1)})}_(Ze,nt)};let n=L(e,"cancelButtonStyle",3,""),i=L(e,"actionButtonStyle",3,""),a=L(e,"descriptionClass",3,""),s=L(e,"unstyled",3,!1),o=L(e,"defaultRichColors",3,!1);const l={...AU};let c=oe(!1),u=oe(!1),h=oe(!1),d=oe(!1),f=oe(!1),p=oe(0),m=oe(0),y=e.toast.duration||e.duration||_7,v=oe(void 0),x=oe(null),S=oe(null);const A=j(()=>e.index===0),C=j(()=>e.index+1<=e.visibleToasts),k=j(()=>e.toast.type),I=j(()=>e.toast.dismissable!==!1),R=j(()=>e.toast.class||""),U=j(()=>e.toast.descriptionClass||""),D=j(()=>gn.heights.findIndex(Ze=>Ze.toastId===e.toast.id)||0),$=j(()=>e.toast.closeButton??e.closeButton),H=j(()=>e.toast.duration??e.duration??_7);let V=null;const z=j(()=>e.position.split("-")),Z=j(()=>gn.heights.reduce((Ze,nt,ht)=>ht>=g(D)?Ze:Ze+nt.height,0)),q=yU(),re=j(()=>e.toast.invert||e.invert),X=j(()=>g(k)==="loading"),ie=j(()=>({...l,...e.classes})),P=j(()=>e.toast.title),be=j(()=>e.toast.description);let _e=oe(0),W=oe(0);const me=j(()=>Math.round(g(D)*wU+g(Z)));Ft(()=>{g(P),g(be);let Ze;e.expanded||e.expandByDefault?Ze=1:Ze=1-e.index*kU;const nt=dn(()=>g(v));if(nt===void 0)return;nt.style.setProperty("height","auto");const ht=nt.offsetHeight,kt=nt.getBoundingClientRect().height,Se=Math.round(kt/Ze+Number.EPSILON&100)/100;nt.style.removeProperty("height");let Fe;Math.abs(Se-ht)<1?Fe=Se:Fe=ht,O(m,Fe,!0),dn(()=>{gn.setHeight({toastId:e.toast.id,height:Fe})})});function He(){O(u,!0),O(p,g(me),!0),gn.removeHeight(e.toast.id),setTimeout(()=>{gn.remove(e.toast.id)},SU)}let Xe;const Le=j(()=>e.toast.promise&&g(k)==="loading"||e.toast.duration===Number.POSITIVE_INFINITY);function bt(){O(_e,new Date().getTime(),!0),Xe=setTimeout(()=>{e.toast.onAutoClose?.(e.toast),He()},y)}function Ie(){if(g(W)<g(_e)){const Ze=new Date().getTime()-g(_e);y=y-Ze}O(W,new Date().getTime(),!0)}Ft(()=>{e.toast.updated&&(clearTimeout(Xe),y=g(H),bt())}),Ft(()=>(g(Le)||(e.expanded||e.interacting||q.current?Ie():bt()),()=>clearTimeout(Xe))),Si(()=>{O(c,!0);const Ze=g(v)?.getBoundingClientRect().height;return O(m,Ze,!0),gn.setHeight({toastId:e.toast.id,height:Ze}),()=>{gn.removeHeight(e.toast.id)}}),Ft(()=>{e.toast.delete&&dn(()=>{He(),e.toast.onDismiss?.(e.toast)})});const Ve=Ze=>{if(g(X))return;O(p,g(me),!0);const nt=Ze.target;nt.setPointerCapture(Ze.pointerId),nt.tagName!=="BUTTON"&&(O(h,!0),V={x:Ze.clientX,y:Ze.clientY})},We=()=>{if(g(d)||!g(I))return;V=null;const Ze=Number(g(v)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),nt=Number(g(v)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),ht=new Date().getTime()-0,kt=g(x)==="x"?Ze:nt,Se=Math.abs(kt)/ht;if(Math.abs(kt)>=xU||Se>.11){O(p,g(me),!0),e.toast.onDismiss?.(e.toast),g(x)==="x"?O(S,Ze>0?"right":"left",!0):O(S,nt>0?"down":"up",!0),He(),O(d,!0);return}else g(v)?.style.setProperty("--swipe-amount-x","0px"),g(v)?.style.setProperty("--swipe-amount-y","0px");O(f,!1),O(h,!1),O(x,null)},Qe=Ze=>{if(!V||!g(I)||(window.getSelection()?.toString().length??-1)>0)return;const ht=Ze.clientY-V.y,kt=Ze.clientX-V.x,Se=e.swipeDirections??_U(e.position);!g(x)&&(Math.abs(kt)>1||Math.abs(ht)>1)&&O(x,Math.abs(kt)>Math.abs(ht)?"x":"y",!0);let Fe={x:0,y:0};if(g(x)==="y"){if(Se.includes("top")||Se.includes("bottom"))if(Se.includes("top")&&ht<0||Se.includes("bottom")&&ht>0)Fe.y=ht;else{const it=ht*C7(ht);Fe.y=Math.abs(it)<Math.abs(ht)?it:ht}}else if(g(x)==="x"&&(Se.includes("left")||Se.includes("right")))if(Se.includes("left")&&kt<0||Se.includes("right")&&kt>0)Fe.x=kt;else{const it=kt*C7(kt);Fe.x=Math.abs(it)<Math.abs(kt)?it:kt}(Math.abs(Fe.x)>0||Math.abs(Fe.y)>0)&&O(f,!0),g(v)?.style.setProperty("--swipe-amount-x",`${Fe.x}px`),g(v)?.style.setProperty("--swipe-amount-y",`${Fe.y}px`)},mt=()=>{O(h,!1),O(x,null),V=null},Ke=j(()=>e.toast.icon?e.toast.icon:g(k)==="success"?e.successIcon:g(k)==="error"?e.errorIcon:g(k)==="warning"?e.warningIcon:g(k)==="info"?e.infoIcon:g(k)==="loading"?e.loadingIcon:null);var ze=DU();Jt(ze,"tabindex",0);let Ge;ze.__pointermove=Qe,ze.__pointerup=We,ze.__pointerdown=Ve;var ot=te(ze);{var lt=Ze=>{var nt=TU();nt.__click=[EU,X,I,He,e];var ht=te(nt);Te(ht,()=>e.closeIcon??Re),Q(nt),qe(kt=>{Jt(nt,"aria-label",e.closeButtonAriaLabel),Jt(nt,"data-disabled",g(X)),tr(nt,1,kt)},[()=>ai(lo(g(ie)?.closeButton,e.toast?.classes?.closeButton))]),_(Ze,nt)};ce(ot,Ze=>{g($)&&!e.toast.component&&g(k)!=="loading"&&e.closeIcon!==null&&Ze(lt)})}var ct=ae(ot,2);{var Ct=Ze=>{var nt=J();const ht=j(()=>e.toast.component);var kt=F(nt);ve(kt,()=>g(ht),(Se,Fe)=>{Fe(Se,$e(()=>e.toast.componentProps,{closeToast:He}))}),_(Ze,nt)},St=Ze=>{var nt=FU(),ht=F(nt);{var kt=Je=>{var wt=IU(),Et=te(wt);{var hr=ur=>{var Ur=J(),le=F(Ur);{var Be=zt=>{var wr=J(),en=F(wr);ve(en,()=>e.toast.icon,(Dt,Mt)=>{Mt(Dt,{})}),_(zt,wr)},et=zt=>{t(zt)};ce(le,zt=>{e.toast.icon?zt(Be):zt(et,!1)})}_(ur,Ur)};ce(Et,ur=>{(e.toast.promise||g(k)==="loading")&&ur(hr)})}var tt=ae(Et,2);{var Ut=ur=>{var Ur=J(),le=F(Ur);{var Be=zt=>{var wr=J(),en=F(wr);ve(en,()=>e.toast.icon,(Dt,Mt)=>{Mt(Dt,{})}),_(zt,wr)},et=zt=>{var wr=J(),en=F(wr);{var Dt=Tt=>{var Cr=J(),Sn=F(Cr);Te(Sn,()=>e.successIcon??Re),_(Tt,Cr)},Mt=Tt=>{var Cr=J(),Sn=F(Cr);{var qa=Wi=>{var So=J(),Ei=F(So);Te(Ei,()=>e.errorIcon??Re),_(Wi,So)},Ps=Wi=>{var So=J(),Ei=F(So);{var Fs=Sa=>{var Ds=J(),bi=F(Ds);Te(bi,()=>e.warningIcon??Re),_(Sa,Ds)},Ga=Sa=>{var Ds=J(),bi=F(Ds);{var Nu=ka=>{var pc=J(),aa=F(pc);Te(aa,()=>e.infoIcon??Re),_(ka,pc)};ce(bi,ka=>{g(k)==="info"&&ka(Nu)},!0)}_(Sa,Ds)};ce(Ei,Sa=>{g(k)==="warning"?Sa(Fs):Sa(Ga,!1)},!0)}_(Wi,So)};ce(Sn,Wi=>{g(k)==="error"?Wi(qa):Wi(Ps,!1)},!0)}_(Tt,Cr)};ce(en,Tt=>{g(k)==="success"?Tt(Dt):Tt(Mt,!1)},!0)}_(zt,wr)};ce(le,zt=>{e.toast.icon?zt(Be):zt(et,!1)})}_(ur,Ur)};ce(tt,ur=>{e.toast.type!=="loading"&&ur(Ut)})}Q(wt),qe(ur=>tr(wt,1,ur),[()=>ai(lo(g(ie)?.icon,e.toast?.classes?.icon))]),_(Je,wt)};ce(ht,Je=>{(g(k)||e.toast.icon||e.toast.promise)&&e.toast.icon!==null&&(g(Ke)!==null||e.toast.icon)&&Je(kt)})}var Se=ae(ht,2),Fe=te(Se),it=te(Fe);{var yt=Je=>{var wt=J(),Et=F(wt);{var hr=Ut=>{var ur=J();const Ur=j(()=>e.toast.title);var le=F(ur);ve(le,()=>g(Ur),(Be,et)=>{et(Be,$e(()=>e.toast.componentProps))}),_(Ut,ur)},tt=Ut=>{var ur=sr();qe(()=>at(ur,e.toast.title)),_(Ut,ur)};ce(Et,Ut=>{typeof e.toast.title!="string"?Ut(hr):Ut(tt,!1)})}_(Je,wt)};ce(it,Je=>{e.toast.title&&Je(yt)})}Q(Fe);var $t=ae(Fe,2);{var kr=Je=>{var wt=MU(),Et=te(wt);{var hr=Ut=>{var ur=J();const Ur=j(()=>e.toast.description);var le=F(ur);ve(le,()=>g(Ur),(Be,et)=>{et(Be,$e(()=>e.toast.componentProps))}),_(Ut,ur)},tt=Ut=>{var ur=sr();qe(()=>at(ur,e.toast.description)),_(Ut,ur)};ce(Et,Ut=>{typeof e.toast.description!="string"?Ut(hr):Ut(tt,!1)})}Q(wt),qe(Ut=>tr(wt,1,Ut),[()=>ai(lo(a(),g(U),g(ie)?.description,e.toast.classes?.description))]),_(Je,wt)};ce($t,Je=>{e.toast.description&&Je(kr)})}Q(Se);var Ar=ae(Se,2);{var mr=Je=>{var wt=J(),Et=F(wt);{var hr=Ut=>{var ur=J(),Ur=F(ur);ve(Ur,()=>e.toast.cancel,(le,Be)=>{Be(le,{})}),_(Ut,ur)},tt=Ut=>{var ur=J(),Ur=F(ur);{var le=Be=>{var et=NU();et.__click=[OU,e,I,He];var zt=te(et,!0);Q(et),qe(wr=>{Ol(et,e.toast.cancelButtonStyle??n()),tr(et,1,wr),at(zt,e.toast.cancel.label)},[()=>ai(lo(g(ie)?.cancelButton,e.toast?.classes?.cancelButton))]),_(Be,et)};ce(Ur,Be=>{Of(e.toast.cancel)&&Be(le)},!0)}_(Ut,ur)};ce(Et,Ut=>{typeof e.toast.cancel=="function"?Ut(hr):Ut(tt,!1)})}_(Je,wt)};ce(Ar,Je=>{e.toast.cancel&&Je(mr)})}var sn=ae(Ar,2);{var Zr=Je=>{var wt=J(),Et=F(wt);{var hr=Ut=>{var ur=J(),Ur=F(ur);ve(Ur,()=>e.toast.action,(le,Be)=>{Be(le,{})}),_(Ut,ur)},tt=Ut=>{var ur=J(),Ur=F(ur);{var le=Be=>{var et=PU();et.__click=[RU,e,He];var zt=te(et,!0);Q(et),qe(wr=>{Ol(et,e.toast.actionButtonStyle??i()),tr(et,1,wr),at(zt,e.toast.action.label)},[()=>ai(lo(g(ie)?.actionButton,e.toast?.classes?.actionButton))]),_(Be,et)};ce(Ur,Be=>{Of(e.toast.action)&&Be(le)},!0)}_(Ut,ur)};ce(Et,Ut=>{typeof e.toast.action=="function"?Ut(hr):Ut(tt,!1)})}_(Je,wt)};ce(sn,Je=>{e.toast.action&&Je(Zr)})}qe(Je=>tr(Fe,1,Je),[()=>ai(lo(g(ie)?.title,e.toast?.classes?.title))]),_(Ze,nt)};ce(ct,Ze=>{e.toast.component?Ze(Ct):Ze(St,!1)})}Q(ze),Tr(ze,Ze=>O(v,Ze),()=>g(v)),qe((Ze,nt,ht,kt)=>{tr(ze,1,Ze),Jt(ze,"data-rich-colors",e.toast.richColors??o()),Jt(ze,"data-styled",!(e.toast.component||e.toast.unstyled||s())),Jt(ze,"data-mounted",g(c)),Jt(ze,"data-promise",nt),Jt(ze,"data-swiped",g(f)),Jt(ze,"data-removed",g(u)),Jt(ze,"data-visible",g(C)),Jt(ze,"data-y-position",g(z)[0]),Jt(ze,"data-x-position",g(z)[1]),Jt(ze,"data-index",e.index),Jt(ze,"data-front",g(A)),Jt(ze,"data-swiping",g(h)),Jt(ze,"data-dismissable",g(I)),Jt(ze,"data-type",g(k)),Jt(ze,"data-invert",g(re)),Jt(ze,"data-swipe-out",g(d)),Jt(ze,"data-swipe-direction",g(S)),Jt(ze,"data-expanded",ht),Ge=Ol(ze,`${e.style} ${e.toast.style}`,Ge,kt)},[()=>ai(lo(e.class,g(R),g(ie)?.toast,e.toast?.classes?.toast,g(ie)?.[g(k)],e.toast?.classes?.[g(k)])),()=>!!e.toast.promise,()=>!!(e.expanded||e.expandByDefault&&g(c)),()=>({"--index":e.index,"--toasts-before":e.index,"--z-index":gn.toasts.length-e.index,"--offset":`${g(u)?g(p):g(me)}px`,"--initial-height":e.expandByDefault?"auto":`${g(m)}px`})]),Rn("dragend",ze,mt),_(r,ze),pe()}wi(["pointermove","pointerup","pointerdown","click"]);var BU=Ml('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function UU(r){var e=BU();_(r,e)}var zU=Ml('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function jU(r){var e=zU();_(r,e)}var HU=Ml('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function qU(r){var e=HU();_(r,e)}var GU=Ml('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function WU(r){var e=GU();_(r,e)}var VU=Ml('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function XU(r){var e=VU();_(r,e)}const $U=3,E7="24px",T7="16px",KU=4e3,YU=356,JU=14,ub="dark",Nf="light";function QU(r,e){const t={};return[r,e].forEach((n,i)=>{const a=i===1,s=a?"--mobile-offset":"--offset",o=a?T7:E7;function l(c){["top","right","bottom","left"].forEach(u=>{t[`${s}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{const u=n[c];u===void 0?t[`${s}-${c}`]=o:t[`${s}-${c}`]=typeof u=="number"?`${u}px`:u}):l(o)}),t}var ZU=ee("<ol></ol>"),ez=ee('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-tppj9g"><!></section>');function tz(r,e){ge(e,!0);function t(me){return me!=="system"?me:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ub:Nf}let n=L(e,"invert",3,!1),i=L(e,"position",3,"bottom-right"),a=L(e,"hotkey",19,()=>["altKey","KeyT"]),s=L(e,"expand",3,!1),o=L(e,"closeButton",3,!1),l=L(e,"offset",3,E7),c=L(e,"mobileOffset",3,T7),u=L(e,"theme",3,"light"),h=L(e,"richColors",3,!1),d=L(e,"duration",3,KU),f=L(e,"visibleToasts",3,$U),p=L(e,"toastOptions",19,()=>({})),m=L(e,"dir",7,"auto"),y=L(e,"gap",3,JU),v=L(e,"containerAriaLabel",3,"Notifications"),x=L(e,"closeButtonAriaLabel",3,"Close toast"),S=De(e,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function A(){if(m()!=="auto")return m();if(typeof window>"u"||typeof document>"u")return"ltr";const me=document.documentElement.getAttribute("dir");return me==="auto"||!me?(dn(()=>m(window.getComputedStyle(document.documentElement).direction??"ltr")),m()):(dn(()=>m(me)),me)}const C=j(()=>Array.from(new Set([i(),...gn.toasts.filter(me=>me.position).map(me=>me.position)].filter(Boolean))));let k=oe(!1),I=oe(!1),R=oe(Mr(t(u()))),U=oe(void 0),D=oe(null),$=oe(!1);const H=j(()=>a().join("+").replace(/Key/g,"").replace(/Digit/g,""));Ft(()=>{gn.toasts.length<=1&&O(k,!1)}),Ft(()=>{const me=gn.toasts.filter(He=>He.dismiss&&!He.delete);if(me.length>0){const He=gn.toasts.map(Xe=>me.find(bt=>bt.id===Xe.id)?{...Xe,delete:!0}:Xe);gn.toasts=He}}),Ft(()=>()=>{g(U)&&g(D)&&(g(D).focus({preventScroll:!0}),O(D,null),O($,!1))}),Si(()=>(gn.reset(),$r(document,"keydown",He=>{a().every(Le=>He[Le]||He.code===Le)&&(O(k,!0),g(U)?.focus()),He.code==="Escape"&&(document.activeElement===g(U)||g(U)?.contains(document.activeElement))&&O(k,!1)}))),Ft(()=>{if(u()!=="system"&&O(R,u()),typeof window<"u"){u()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O(R,ub):O(R,Nf));const me=window.matchMedia("(prefers-color-scheme: dark)"),He=({matches:Xe})=>{O(R,Xe?ub:Nf,!0)};"addEventListener"in me?me.addEventListener("change",He):me.addListener(He)}});const V=me=>{e.onblur?.(me),g($)&&!me.currentTarget.contains(me.relatedTarget)&&(O($,!1),g(D)&&(g(D).focus({preventScroll:!0}),O(D,null)))},z=me=>{e.onfocus?.(me),!(me.target instanceof HTMLElement&&me.target.dataset.dismissable==="false")&&(g($)||(O($,!0),O(D,me.relatedTarget,!0)))},Z=me=>{e.onpointerdown?.(me),!(me.target instanceof HTMLElement&&me.target.dataset.dismissable==="false")&&O(I,!0)},q=me=>{e.onmouseenter?.(me),O(k,!0)},re=me=>{e.onmouseleave?.(me),g(I)||O(k,!1)},X=me=>{e.onmousemove?.(me),O(k,!0)},ie=me=>{e.ondragend?.(me),O(k,!1)},P=me=>{e.onpointerup?.(me),O(I,!1)};gU.set(new vU);var be=ez();Jt(be,"tabindex",-1);var _e=te(be);{var W=me=>{var He=J(),Xe=F(He);_n(Xe,18,()=>g(C),Le=>Le,(Le,bt,Ie,Ve)=>{var We=ZU();const Qe=j(()=>{const[Ke,ze]=bt.split("-");return{y:Ke,x:ze}}),mt=j(()=>QU(l(),c()));Lt(We,(Ke,ze)=>({tabindex:-1,dir:Ke,class:e.class,"data-sonner-toaster":!0,"data-sonner-theme":g(R),"data-y-position":g(Qe).y,"data-x-position":g(Qe).x,style:e.style,onblur:V,onfocus:z,onmouseenter:q,onmousemove:X,onmouseleave:re,ondragend:ie,onpointerdown:Z,onpointerup:P,...S,[Rc]:ze}),[A,()=>({"--front-toast-height":`${gn.heights[0]?.height}px`,"--width":`${YU}px`,"--gap":`${y()}px`,"--offset-top":g(mt)["--offset-top"],"--offset-right":g(mt)["--offset-right"],"--offset-bottom":g(mt)["--offset-bottom"],"--offset-left":g(mt)["--offset-left"],"--mobile-offset-top":g(mt)["--mobile-offset-top"],"--mobile-offset-right":g(mt)["--mobile-offset-right"],"--mobile-offset-bottom":g(mt)["--mobile-offset-bottom"],"--mobile-offset-left":g(mt)["--mobile-offset-left"]})],void 0,"svelte-tppj9g"),_n(We,23,()=>gn.toasts.filter(Ke=>!Ke.position&&g(Ie)===0||Ke.position===bt),Ke=>Ke.id,(Ke,ze,Ge,ot)=>{{const lt=Ar=>{var mr=J(),sn=F(mr);{var Zr=wt=>{var Et=J(),hr=F(Et);Te(hr,()=>e.successIcon??Re),_(wt,Et)},Je=wt=>{var Et=J(),hr=F(Et);{var tt=Ut=>{UU(Ut)};ce(hr,Ut=>{e.successIcon!==null&&Ut(tt)},!0)}_(wt,Et)};ce(sn,wt=>{e.successIcon?wt(Zr):wt(Je,!1)})}_(Ar,mr)},ct=Ar=>{var mr=J(),sn=F(mr);{var Zr=wt=>{var Et=J(),hr=F(Et);Te(hr,()=>e.errorIcon??Re),_(wt,Et)},Je=wt=>{var Et=J(),hr=F(Et);{var tt=Ut=>{jU(Ut)};ce(hr,Ut=>{e.errorIcon!==null&&Ut(tt)},!0)}_(wt,Et)};ce(sn,wt=>{e.errorIcon?wt(Zr):wt(Je,!1)})}_(Ar,mr)},Ct=Ar=>{var mr=J(),sn=F(mr);{var Zr=wt=>{var Et=J(),hr=F(Et);Te(hr,()=>e.warningIcon??Re),_(wt,Et)},Je=wt=>{var Et=J(),hr=F(Et);{var tt=Ut=>{qU(Ut)};ce(hr,Ut=>{e.warningIcon!==null&&Ut(tt)},!0)}_(wt,Et)};ce(sn,wt=>{e.warningIcon?wt(Zr):wt(Je,!1)})}_(Ar,mr)},St=Ar=>{var mr=J(),sn=F(mr);{var Zr=wt=>{var Et=J(),hr=F(Et);Te(hr,()=>e.infoIcon??Re),_(wt,Et)},Je=wt=>{var Et=J(),hr=F(Et);{var tt=Ut=>{WU(Ut)};ce(hr,Ut=>{e.infoIcon!==null&&Ut(tt)},!0)}_(wt,Et)};ce(sn,wt=>{e.infoIcon?wt(Zr):wt(Je,!1)})}_(Ar,mr)},Ze=Ar=>{var mr=J(),sn=F(mr);{var Zr=wt=>{var Et=J(),hr=F(Et);Te(hr,()=>e.closeIcon??Re),_(wt,Et)},Je=wt=>{var Et=J(),hr=F(Et);{var tt=Ut=>{XU(Ut)};ce(hr,Ut=>{e.closeIcon!==null&&Ut(tt)},!0)}_(wt,Et)};ce(sn,wt=>{e.closeIcon?wt(Zr):wt(Je,!1)})}_(Ar,mr)};let nt=j(()=>p()?.duration??d()),ht=j(()=>p()?.class??""),kt=j(()=>p()?.descriptionClass||""),Se=j(()=>p()?.style??""),Fe=j(()=>p().classes||{}),it=j(()=>p().unstyled??!1),yt=j(()=>p()?.cancelButtonStyle??""),$t=j(()=>p()?.actionButtonStyle??""),kr=j(()=>p()?.closeButtonAriaLabel??x());LU(Ke,{get index(){return g(Ge)},get toast(){return g(ze)},get defaultRichColors(){return h()},get duration(){return g(nt)},get class(){return g(ht)},get descriptionClass(){return g(kt)},get invert(){return n()},get visibleToasts(){return f()},get closeButton(){return o()},get interacting(){return g(I)},get position(){return bt},get style(){return g(Se)},get classes(){return g(Fe)},get unstyled(){return g(it)},get cancelButtonStyle(){return g(yt)},get actionButtonStyle(){return g($t)},get closeButtonAriaLabel(){return g(kr)},get expandByDefault(){return s()},get expanded(){return g(k)},get loadingIcon(){return e.loadingIcon},successIcon:lt,errorIcon:ct,warningIcon:Ct,infoIcon:St,closeIcon:Ze,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),Q(We),Tr(We,Ke=>O(U,Ke),()=>g(U)),qe(()=>We.dir=We.dir),_(Le,We)}),_(me,He)};ce(_e,me=>{gn.toasts.length>0&&me(W)})}Q(be),qe(()=>Jt(be,"aria-label",`${v()??""} ${g(H)??""}`)),_(r,be),pe()}class rz{#e=oe(null);get activeConversation(){return g(this.#e)}set activeConversation(e){O(this.#e,e,!0)}#t=oe(Mr([]));get activeMessages(){return g(this.#t)}set activeMessages(e){O(this.#t,e,!0)}#r=oe(Mr([]));get conversations(){return g(this.#r)}set conversations(e){O(this.#r,e,!0)}#n=oe("");get currentResponse(){return g(this.#n)}set currentResponse(e){O(this.#n,e,!0)}#a=oe(null);get errorDialogState(){return g(this.#a)}set errorDialogState(e){O(this.#a,e,!0)}#i=oe(!1);get isInitialized(){return g(this.#i)}set isInitialized(e){O(this.#i,e,!0)}#s=oe(!1);get isLoading(){return g(this.#s)}set isLoading(e){O(this.#s,e,!0)}conversationLoadingStates=new hp;conversationStreamingStates=new hp;titleUpdateConfirmationCallback;constructor(){this.initialize()}async initialize(){try{await this.loadConversations(),this.isInitialized=!0}catch(e){console.error("Failed to initialize chat store:",e)}}async loadConversations(){this.conversations=await ir.getAllConversations()}async createConversation(e){const t=e||`Chat ${new Date().toLocaleString()}`,n=await ir.createConversation(t);this.conversations.unshift(n),this.activeConversation=n,this.activeMessages=[],Pn.setActiveConversation(n.id);const i=this.isConversationLoading(n.id);return this.isLoading=i,this.currentResponse="",await Do(`#/chat/${n.id}`),n.id}async loadConversation(e){try{const t=await ir.getConversation(e);if(!t)return!1;this.activeConversation=t,Pn.setActiveConversation(e);const n=this.isConversationLoading(e);this.isLoading=n;const i=this.getConversationStreaming(e);if(this.currentResponse=i?.response||"",t.currNode){const a=await ir.getConversationMessages(e);this.activeMessages=gu(a,t.currNode,!1)}else this.activeMessages=await ir.getConversationMessages(e);return!0}catch(t){return console.error("Failed to load conversation:",t),!1}}async addMessage(e,t,n="text",i="-1",a){if(!this.activeConversation)return console.error("No active conversation when trying to add message"),null;try{let s=null;if(i==="-1")if(this.activeMessages.length>0)s=this.activeMessages[this.activeMessages.length-1].id;else{const c=(await ir.getConversationMessages(this.activeConversation.id)).find(u=>u.parent===null&&u.type==="root");c?s=c.id:s=await ir.createRootMessage(this.activeConversation.id)}else s=i;const o=await ir.createMessageBranch({convId:this.activeConversation.id,role:e,content:t,type:n,timestamp:Date.now(),thinking:"",children:[],extra:a},s);return this.activeMessages.push(o),await ir.updateCurrentNode(this.activeConversation.id,o.id),this.activeConversation.currNode=o.id,this.updateConversationTimestamp(),o}catch(s){return console.error("Failed to add message:",s),null}}getApiOptions(){const e=fn(),t=i=>i!=null&&i!=="",n={stream:!0,timings_per_token:!0};return t(e.temperature)&&(n.temperature=Number(e.temperature)),t(e.max_tokens)&&(n.max_tokens=Number(e.max_tokens)),t(e.dynatemp_range)&&(n.dynatemp_range=Number(e.dynatemp_range)),t(e.dynatemp_exponent)&&(n.dynatemp_exponent=Number(e.dynatemp_exponent)),t(e.top_k)&&(n.top_k=Number(e.top_k)),t(e.top_p)&&(n.top_p=Number(e.top_p)),t(e.min_p)&&(n.min_p=Number(e.min_p)),t(e.xtc_probability)&&(n.xtc_probability=Number(e.xtc_probability)),t(e.xtc_threshold)&&(n.xtc_threshold=Number(e.xtc_threshold)),t(e.typ_p)&&(n.typ_p=Number(e.typ_p)),t(e.repeat_last_n)&&(n.repeat_last_n=Number(e.repeat_last_n)),t(e.repeat_penalty)&&(n.repeat_penalty=Number(e.repeat_penalty)),t(e.presence_penalty)&&(n.presence_penalty=Number(e.presence_penalty)),t(e.frequency_penalty)&&(n.frequency_penalty=Number(e.frequency_penalty)),t(e.dry_multiplier)&&(n.dry_multiplier=Number(e.dry_multiplier)),t(e.dry_base)&&(n.dry_base=Number(e.dry_base)),t(e.dry_allowed_length)&&(n.dry_allowed_length=Number(e.dry_allowed_length)),t(e.dry_penalty_last_n)&&(n.dry_penalty_last_n=Number(e.dry_penalty_last_n)),e.samplers&&(n.samplers=e.samplers),e.custom&&(n.custom=e.custom),n}setConversationLoading(e,t){t?(this.conversationLoadingStates.set(e,!0),this.activeConversation?.id===e&&(this.isLoading=!0)):(this.conversationLoadingStates.delete(e),this.activeConversation?.id===e&&(this.isLoading=!1))}isConversationLoading(e){return this.conversationLoadingStates.get(e)||!1}setConversationStreaming(e,t,n){this.conversationStreamingStates.set(e,{response:t,messageId:n}),this.activeConversation?.id===e&&(this.currentResponse=t)}clearConversationStreaming(e){this.conversationStreamingStates.delete(e),this.activeConversation?.id===e&&(this.currentResponse="")}getConversationStreaming(e){return this.conversationStreamingStates.get(e)}async streamChatCompletion(e,t,n,i){let a="",s="",o=null,l=!1;const c=(u,h=!0)=>{const d=iU(u);if(!d||d===o)return;o=d;const f=this.findMessageIndex(t.id);this.updateMessageAtIndex(f,{model:d}),h&&!l&&(l=!0,ir.updateMessage(t.id,{model:d}).catch(p=>{console.error("Failed to persist model name:",p),l=!1,o=null}))};Pn.startStreaming(),Pn.setActiveConversation(t.convId),await ob.sendMessage(e,{...this.getApiOptions(),onChunk:u=>{a+=u,this.setConversationStreaming(t.convId,a,t.id);const h=this.findMessageIndex(t.id);this.updateMessageAtIndex(h,{content:a})},onReasoningChunk:u=>{s+=u;const h=this.findMessageIndex(t.id);this.updateMessageAtIndex(h,{thinking:s})},onModel:u=>{c(u)},onComplete:async(u,h,d)=>{Pn.stopStreaming();const f={content:u||a,thinking:h||s,timings:d};o&&!l&&(f.model=o,l=!0),await ir.updateMessage(t.id,f);const p=this.findMessageIndex(t.id),m={timings:d};f.model&&(m.model=f.model),this.updateMessageAtIndex(p,m),await ir.updateCurrentNode(t.convId,t.id),this.activeConversation?.id===t.convId&&(this.activeConversation.currNode=t.id,await this.refreshActiveMessages()),n&&await n(a),this.setConversationLoading(t.convId,!1),this.clearConversationStreaming(t.convId),Pn.clearConversationState(t.convId)},onError:u=>{if(Pn.stopStreaming(),this.isAbortError(u)){this.setConversationLoading(t.convId,!1),this.clearConversationStreaming(t.convId),Pn.clearConversationState(t.convId);return}console.error("Streaming error:",u),this.setConversationLoading(t.convId,!1),this.clearConversationStreaming(t.convId),Pn.clearConversationState(t.convId);const h=this.activeMessages.findIndex(f=>f.id===t.id);if(h!==-1){const[f]=this.activeMessages.splice(h,1);f&&ir.deleteMessage(f.id).catch(p=>{console.error("Failed to remove assistant message after error:",p)})}const d=u.name==="TimeoutError"?"timeout":"server";this.showErrorDialog(d,u.message),i&&i(u)}},t.convId)}isAbortError(e){return e instanceof Error&&(e.name==="AbortError"||e instanceof DOMException)}showErrorDialog(e,t){this.errorDialogState={type:e,message:t}}dismissErrorDialog(){this.errorDialogState=null}findMessageIndex(e){return this.activeMessages.findIndex(t=>t.id===e)}updateMessageAtIndex(e,t){e!==-1&&Object.assign(this.activeMessages[e],t)}async createAssistantMessage(e){return this.activeConversation?await ir.createMessageBranch({convId:this.activeConversation.id,type:"text",role:"assistant",content:"",timestamp:Date.now(),thinking:"",children:[],model:null},e||null):null}updateConversationTimestamp(){if(!this.activeConversation)return;const e=this.conversations.findIndex(t=>t.id===this.activeConversation.id);if(e!==-1){this.conversations[e].lastModified=Date.now();const t=this.conversations.splice(e,1)[0];this.conversations.unshift(t)}}async sendMessage(e,t){if(!e.trim()&&(!t||t.length===0))return;if(this.activeConversation&&this.isConversationLoading(this.activeConversation.id)){console.log("Cannot send message: current conversation is already processing a message");return}let n=!1;if(this.activeConversation||(await this.createConversation(),n=!0),!this.activeConversation){console.error("No active conversation available for sending message");return}this.errorDialogState=null,this.setConversationLoading(this.activeConversation.id,!0),this.clearConversationStreaming(this.activeConversation.id);let i=null;try{if(i=await this.addMessage("user",e,"text","-1",t),!i)throw new Error("Failed to add user message");if(n&&e){const o=e.trim();await this.updateConversationName(this.activeConversation.id,o)}const a=await this.createAssistantMessage(i.id);if(!a)throw new Error("Failed to create assistant message");this.activeMessages.push(a);const s=this.activeMessages.slice(0,-1);await this.streamChatCompletion(s,a)}catch(a){if(this.isAbortError(a)){this.setConversationLoading(this.activeConversation.id,!1);return}if(console.error("Failed to send message:",a),this.setConversationLoading(this.activeConversation.id,!1),!this.errorDialogState)if(a instanceof Error){const s=a.name==="TimeoutError"?"timeout":"server";this.showErrorDialog(s,a.message)}else this.showErrorDialog("server","Unknown error occurred while sending message")}}async stopGeneration(){if(!this.activeConversation)return;const e=this.activeConversation.id;await this.savePartialResponseIfNeeded(e),Pn.stopStreaming(),ob.abort(e),this.setConversationLoading(e,!1),this.clearConversationStreaming(e),Pn.clearConversationState(e)}async gracefulStop(){this.isLoading&&(Pn.stopStreaming(),ob.abort(),await this.savePartialResponseIfNeeded(),this.conversationLoadingStates.clear(),this.conversationStreamingStates.clear(),this.isLoading=!1,this.currentResponse="")}async savePartialResponseIfNeeded(e){const t=e||this.activeConversation?.id;if(!t)return;const n=this.conversationStreamingStates.get(t);if(!n||!n.response.trim())return;const i=t===this.activeConversation?.id?this.activeMessages:await ir.getConversationMessages(t);if(!i.length)return;const a=i[i.length-1];if(a&&a.role==="assistant")try{const s={content:n.response};a.thinking?.trim()&&(s.thinking=a.thinking);const o=await Pn.getCurrentState();o&&(s.timings={prompt_n:o.promptTokens||0,predicted_n:o.tokensDecoded||0,cache_n:o.cacheTokens||0,predicted_ms:o.tokensPerSecond&&o.tokensDecoded?o.tokensDecoded/o.tokensPerSecond*1e3:void 0}),await ir.updateMessage(a.id,s),a.content=this.currentResponse,s.thinking!==void 0&&(a.thinking=s.thinking),s.timings&&(a.timings=s.timings)}catch(s){a.content=this.currentResponse,console.error("Failed to save partial response:",s)}else console.error("Last message is not an assistant message")}async updateMessage(e,t){if(this.activeConversation){this.isLoading&&this.stopGeneration();try{const n=this.findMessageIndex(e);if(n===-1){console.error("Message not found for update");return}const i=this.activeMessages[n],a=i.content;if(i.role!=="user"){console.error("Only user messages can be edited");return}const o=(await ir.getConversationMessages(this.activeConversation.id)).find(u=>u.type==="root"&&u.parent===null),l=o&&i.parent===o.id&&i.role==="user";this.updateMessageAtIndex(n,{content:t}),await ir.updateMessage(e,{content:t}),l&&t.trim()&&await this.updateConversationTitleWithConfirmation(this.activeConversation.id,t.trim(),this.titleUpdateConfirmationCallback);const c=this.activeMessages.slice(n+1);for(const u of c)await ir.deleteMessage(u.id);this.activeMessages=this.activeMessages.slice(0,n+1),this.updateConversationTimestamp(),this.setConversationLoading(this.activeConversation.id,!0),this.clearConversationStreaming(this.activeConversation.id);try{const u=await this.createAssistantMessage();if(!u)throw new Error("Failed to create assistant message");this.activeMessages.push(u),await ir.updateCurrentNode(this.activeConversation.id,u.id),this.activeConversation.currNode=u.id,await this.streamChatCompletion(this.activeMessages.slice(0,-1),u,void 0,()=>{const h=this.findMessageIndex(e);this.updateMessageAtIndex(h,{content:a})})}catch(u){console.error("Failed to regenerate response:",u),this.setConversationLoading(this.activeConversation.id,!1);const h=this.findMessageIndex(e);this.updateMessageAtIndex(h,{content:a})}}catch(n){if(this.isAbortError(n))return;console.error("Failed to update message:",n)}}}async regenerateMessage(e){if(!(!this.activeConversation||this.isLoading))try{const t=this.findMessageIndex(e);if(t===-1){console.error("Message not found for regeneration");return}if(this.activeMessages[t].role!=="assistant"){console.error("Only assistant messages can be regenerated");return}const i=this.activeMessages.slice(t);for(const a of i)await ir.deleteMessage(a.id);this.activeMessages=this.activeMessages.slice(0,t),this.updateConversationTimestamp(),this.setConversationLoading(this.activeConversation.id,!0),this.clearConversationStreaming(this.activeConversation.id);try{const a=this.activeMessages.length>0?this.activeMessages[this.activeMessages.length-1].id:null,s=await this.createAssistantMessage(a);if(!s)throw new Error("Failed to create assistant message");this.activeMessages.push(s);const o=this.activeMessages.slice(0,-1);await this.streamChatCompletion(o,s)}catch(a){console.error("Failed to regenerate response:",a),this.setConversationLoading(this.activeConversation.id,!1)}}catch(t){if(this.isAbortError(t))return;console.error("Failed to regenerate message:",t)}}async updateConversationName(e,t){try{await ir.updateConversation(e,{name:t});const n=this.conversations.findIndex(i=>i.id===e);n!==-1&&(this.conversations[n].name=t),this.activeConversation?.id===e&&(this.activeConversation.name=t)}catch(n){console.error("Failed to update conversation name:",n)}}setTitleUpdateConfirmationCallback(e){this.titleUpdateConfirmationCallback=e}async updateConversationTitleWithConfirmation(e,t,n){try{if(fn().askForTitleConfirmation&&n){const a=await ir.getConversation(e);if(!a||!await n(a.name,t))return!1}return await this.updateConversationName(e,t),!0}catch(i){return console.error("Failed to update conversation title with confirmation:",i),!1}}async downloadConversation(e){if(!this.activeConversation||this.activeConversation.id!==e){const t=await ir.getConversation(e);if(!t)return;const n=await ir.getConversationMessages(e),i={conv:t,messages:n};this.triggerDownload(i)}else{const t={conv:this.activeConversation,messages:this.activeMessages};this.triggerDownload(t)}}triggerDownload(e,t){const n="conv"in e?e.conv:Array.isArray(e)?e[0]?.conv:void 0;if(!n){console.error("Invalid data: missing conversation");return}const i=n.name?n.name.trim():"",a=n.id||"unknown",s=i.toLowerCase().replace(/[^a-z0-9]/gi,"_").replace(/_+/g,"_").substring(0,20),o=t||`conversation_${a}_${s}.json`,l=JSON.stringify(e,null,2),c=new Blob([l],{type:"application/json"}),u=URL.createObjectURL(c),h=document.createElement("a");h.href=u,h.download=o,document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(u)}async exportAllConversations(){try{const e=await ir.getAllConversations();if(e.length===0)throw new Error("No conversations to export");const t=await Promise.all(e.map(async s=>{const o=await ir.getConversationMessages(s.id);return{conv:s,messages:o}})),n=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),i=URL.createObjectURL(n),a=document.createElement("a");return a.href=i,a.download=`all_conversations_${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i),es.success(`All conversations (${e.length}) prepared for download`),e}catch(e){throw console.error("Failed to export conversations:",e),e}}async importConversations(){return new Promise((e,t)=>{const n=document.createElement("input");n.type="file",n.accept=".json",n.onchange=async i=>{const a=i.target?.files?.[0];if(!a){t(new Error("No file selected"));return}try{const s=await a.text(),o=JSON.parse(s);let l;if(Array.isArray(o))l=o;else if(o&&typeof o=="object"&&"conv"in o&&"messages"in o)l=[o];else throw new Error("Invalid file format: expected array of conversations or single conversation object");const c=await ir.importConversations(l);await this.loadConversations(),es.success(`Imported ${c.imported} conversation(s), skipped ${c.skipped}`);const u=l.map(h=>h.conv);e(u)}catch(s){const o=s instanceof Error?s.message:"Unknown error";console.error("Failed to import conversations:",s),es.error("Import failed",{description:o}),t(new Error(`Import failed: ${o}`))}},n.click()})}async deleteConversation(e){try{await ir.deleteConversation(e),this.conversations=this.conversations.filter(t=>t.id!==e),this.activeConversation?.id===e&&(this.activeConversation=null,this.activeMessages=[],await Do("?new_chat=true#/"))}catch(t){console.error("Failed to delete conversation:",t)}}async getDeletionInfo(e){if(!this.activeConversation)return{totalCount:0,userMessages:0,assistantMessages:0,messageTypes:[]};const t=await ir.getConversationMessages(this.activeConversation.id),n=S7(t,e),i=[e,...n],a=t.filter(c=>i.includes(c.id));let s=0,o=0;const l=[];for(const c of a)c.role==="user"?(s++,l.includes("user message")||l.push("user message")):c.role==="assistant"&&(o++,l.includes("assistant response")||l.push("assistant response"));return{totalCount:i.length,userMessages:s,assistantMessages:o,messageTypes:l}}async deleteMessage(e){try{if(!this.activeConversation)return;const t=await ir.getConversationMessages(this.activeConversation.id),n=t.find(s=>s.id===e);if(!n){console.error("Message to delete not found");return}if(gu(t,this.activeConversation.currNode||"",!1).some(s=>s.id===e)&&n.parent){const s=t.filter(o=>o.parent===n.parent&&o.id!==e);if(s.length>0){const o=s.reduce((c,u)=>u.timestamp>c.timestamp?u:c),l=If(t,o.id);await ir.updateCurrentNode(this.activeConversation.id,l),this.activeConversation.currNode=l}else if(n.parent){const o=If(t,n.parent);await ir.updateCurrentNode(this.activeConversation.id,o),this.activeConversation.currNode=o}}await ir.deleteMessageCascading(this.activeConversation.id,e),await this.refreshActiveMessages(),this.updateConversationTimestamp()}catch(t){console.error("Failed to delete message:",t)}}clearActiveConversation(){this.activeConversation=null,this.activeMessages=[],this.isLoading=!1,this.currentResponse="",Pn.setActiveConversation(null)}async refreshActiveMessages(){if(!this.activeConversation)return;const e=await ir.getConversationMessages(this.activeConversation.id);if(e.length===0){this.activeMessages=[];return}const t=this.activeConversation.currNode||e.reduce((i,a)=>a.timestamp>i.timestamp?a:i).id,n=gu(e,t,!1);this.activeMessages.length=0,this.activeMessages.push(...n)}async navigateToSibling(e){if(!this.activeConversation)return;const t=await ir.getConversationMessages(this.activeConversation.id),n=t.find(s=>s.type==="root"&&s.parent===null),i=this.activeMessages.find(s=>s.role==="user"&&s.parent===n?.id),a=If(t,e);if(await ir.updateCurrentNode(this.activeConversation.id,a),this.activeConversation.currNode=a,await this.refreshActiveMessages(),n&&this.activeMessages.length>0){const s=this.activeMessages.find(o=>o.role==="user"&&o.parent===n.id);s&&s.content.trim()&&(!i||s.id!==i.id||s.content.trim()!==i.content.trim())&&await this.updateConversationTitleWithConfirmation(this.activeConversation.id,s.content.trim(),this.titleUpdateConfirmationCallback)}}async editAssistantMessage(e,t,n){if(!(!this.activeConversation||this.isLoading))try{const i=this.findMessageIndex(e);if(i===-1){console.error("Message not found for editing");return}const a=this.activeMessages[i];if(a.role!=="assistant"){console.error("Only assistant messages can be edited with this method");return}if(n){const s=await ir.createMessageBranch({convId:a.convId,type:a.type,timestamp:Date.now(),role:a.role,content:t,thinking:a.thinking||"",children:[],model:a.model},a.parent);await ir.updateCurrentNode(this.activeConversation.id,s.id),this.activeConversation.currNode=s.id}else await ir.updateMessage(a.id,{content:t,timestamp:Date.now()}),this.updateMessageAtIndex(i,{content:t,timestamp:Date.now()});this.updateConversationTimestamp(),await this.refreshActiveMessages()}catch(i){console.error("Failed to edit assistant message:",i)}}async editMessageWithBranching(e,t){if(!(!this.activeConversation||this.isLoading))try{const n=this.findMessageIndex(e);if(n===-1){console.error("Message not found for editing");return}const i=this.activeMessages[n];if(i.role!=="user"){console.error("Only user messages can be edited");return}const a=await ir.getConversationMessages(this.activeConversation.id),s=a.find(u=>u.type==="root"&&u.parent===null),o=s&&i.parent===s.id&&i.role==="user";let l=i.parent;if(l==null){const u=a.find(h=>h.type==="root"&&h.parent===null);if(u)l=u.id;else{console.error("No root message found for editing");return}}const c=await ir.createMessageBranch({convId:i.convId,type:i.type,timestamp:Date.now(),role:i.role,content:t,thinking:i.thinking||"",children:[],extra:i.extra?JSON.parse(JSON.stringify(i.extra)):void 0,model:i.model},l);await ir.updateCurrentNode(this.activeConversation.id,c.id),this.activeConversation.currNode=c.id,this.updateConversationTimestamp(),o&&t.trim()&&await this.updateConversationTitleWithConfirmation(this.activeConversation.id,t.trim(),this.titleUpdateConfirmationCallback),await this.refreshActiveMessages(),i.role==="user"&&await this.generateResponseForMessage(c.id)}catch(n){console.error("Failed to edit message with branching:",n)}}async regenerateMessageWithBranching(e){if(!(!this.activeConversation||this.isLoading))try{const t=this.findMessageIndex(e);if(t===-1){console.error("Message not found for regeneration");return}const n=this.activeMessages[t];if(n.role!=="assistant"){console.error("Only assistant messages can be regenerated");return}const a=(await ir.getConversationMessages(this.activeConversation.id)).find(c=>c.id===n.parent);if(!a){console.error("Parent message not found for regeneration");return}this.setConversationLoading(this.activeConversation.id,!0),this.clearConversationStreaming(this.activeConversation.id);const s=await ir.createMessageBranch({convId:this.activeConversation.id,type:"text",timestamp:Date.now(),role:"assistant",content:"",thinking:"",children:[],model:null},a.id);await ir.updateCurrentNode(this.activeConversation.id,s.id),this.activeConversation.currNode=s.id,this.updateConversationTimestamp(),await this.refreshActiveMessages();const o=await ir.getConversationMessages(this.activeConversation.id),l=gu(o,a.id,!1);await this.streamChatCompletion(l,s)}catch(t){if(this.isAbortError(t))return;console.error("Failed to regenerate message with branching:",t),this.setConversationLoading(this.activeConversation.id,!1)}}async generateResponseForMessage(e){if(this.activeConversation){this.errorDialogState=null,this.setConversationLoading(this.activeConversation.id,!0),this.clearConversationStreaming(this.activeConversation.id);try{const t=await ir.getConversationMessages(this.activeConversation.id),n=gu(t,e,!1),i=await ir.createMessageBranch({convId:this.activeConversation.id,type:"text",timestamp:Date.now(),role:"assistant",content:"",thinking:"",children:[],model:null},e);this.activeMessages.push(i),await this.streamChatCompletion(n,i)}catch(t){console.error("Failed to generate response:",t),this.setConversationLoading(this.activeConversation.id,!1)}}}isConversationLoadingPublic(e){return this.isConversationLoading(e)}getConversationStreamingPublic(e){return this.getConversationStreaming(e)}getAllLoadingConversations(){return Array.from(this.conversationLoadingStates.keys())}getAllStreamingConversations(){return Array.from(this.conversationStreamingStates.keys())}}const fr=new rz,Qh=()=>fr.conversations,co=()=>fr.activeConversation,Zh=()=>fr.activeMessages,Kl=()=>fr.isLoading,I7=()=>fr.isInitialized,M7=()=>fr.errorDialogState;fr.createConversation.bind(fr);const O7=fr.downloadConversation.bind(fr);fr.exportAllConversations.bind(fr),fr.importConversations.bind(fr);const hb=fr.deleteConversation.bind(fr),N7=fr.sendMessage.bind(fr),R7=fr.dismissErrorDialog.bind(fr);fr.gracefulStop.bind(fr),fr.refreshActiveMessages.bind(fr);const P7=fr.navigateToSibling.bind(fr),F7=fr.editAssistantMessage.bind(fr),D7=fr.editMessageWithBranching.bind(fr),L7=fr.regenerateMessageWithBranching.bind(fr),B7=fr.deleteMessage.bind(fr),U7=fr.getDeletionInfo.bind(fr),z7=fr.updateConversationName.bind(fr),j7=fr.setTitleUpdateConfirmationCallback.bind(fr);function Rf(){fr.stopGeneration()}const H7=()=>fr.getAllLoadingConversations(),nz=Object.freeze(Object.defineProperty({__proto__:null,activeConversation:co,activeMessages:Zh,chatStore:fr,conversations:Qh,deleteConversation:hb,deleteMessage:B7,dismissErrorDialog:R7,downloadConversation:O7,editAssistantMessage:F7,editMessageWithBranching:D7,errorDialog:M7,getAllLoadingConversations:H7,getDeletionInfo:U7,isInitialized:I7,isLoading:Kl,navigateToSibling:P7,regenerateMessageWithBranching:L7,sendMessage:N7,setTitleUpdateConfirmationCallback:j7,stopGeneration:Rf,updateConversationName:z7},Symbol.toStringTag,{value:"Module"}));async function db(r,e="Copied to clipboard",t="Failed to copy to clipboard"){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(r),es.success(e),!0;const n=document.createElement("textarea");n.value=r,n.style.position="fixed",n.style.left="-999999px",n.style.top="-999999px",document.body.appendChild(n),n.focus(),n.select();const i=document.execCommand("copy");if(document.body.removeChild(n),i)return es.success(e),!0;throw new Error("execCommand failed")}catch(n){return console.error("Failed to copy to clipboard:",n),es.error(t),!1}}async function iz(r,e="Code copied to clipboard",t="Failed to copy code"){const n=r.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'");return db(n,e,t)}function q7(){let r=oe(!1),e=oe(null),t=oe(null),n=null;async function i(){if(!g(r)){O(r,!0),n=Pn.subscribe(c=>{O(e,c,!0),c?O(t,c,!0):O(t,null)});try{const c=await Pn.getCurrentState();c&&(O(e,c,!0),O(t,c,!0)),Pn.isStreaming()&&Pn.startStreaming()}catch(c){console.warn("Failed to start slots monitoring:",c)}}}function a(){if(!g(r))return;O(r,!1),fn().keepStatsVisible?g(t)&&O(e,g(t),!0):O(e,null),n&&(n(),n=null)}function s(){if(!g(e))return"Processing...";switch(g(e).status){case"initializing":return"Initializing...";case"preparing":return g(e).progressPercent!==void 0?`Processing (${g(e).progressPercent}%)`:"Preparing response...";case"generating":return g(e).tokensDecoded>0?`Generating... (${g(e).tokensDecoded} tokens)`:"Generating...";default:return"Processing..."}}function o(){const c=g(e)||g(t);if(!c)return[];const u=[],h=fn();if(c.contextUsed>=0&&c.contextTotal>0){const d=Math.round(c.contextUsed/c.contextTotal*100);u.push(`Context: ${c.contextUsed}/${c.contextTotal} (${d}%)`)}if(c.outputTokensUsed>0)if(c.outputTokensMax<=0)u.push(`Output: ${c.outputTokensUsed}/∞`);else{const d=Math.round(c.outputTokensUsed/c.outputTokensMax*100);u.push(`Output: ${c.outputTokensUsed}/${c.outputTokensMax} (${d}%)`)}return h.showTokensPerSecond&&c.tokensPerSecond&&c.tokensPerSecond>0&&u.push(`${c.tokensPerSecond.toFixed(1)} tokens/sec`),c.speculative&&u.push("Speculative decoding enabled"),u}function l(){return g(e)!==null&&g(e).status!=="idle"}return{get processingState(){return g(e)},getProcessingDetails:o,getProcessingMessage:s,shouldShowDetails:l,startMonitoring:i,stopMonitoring:a}}const az=r=>r;function fb(r){const e=r-1;return e*e*e+1}function G7(r){const e=typeof r=="string"&&r.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[r,"px"]}function Pf(r,{delay:e=0,duration:t=400,easing:n=az}={}){const i=+getComputedStyle(r).opacity;return{delay:e,duration:t,easing:n,css:a=>`opacity: ${a*i}`}}function uo(r,{delay:e=0,duration:t=400,easing:n=fb,x:i=0,y:a=0,opacity:s=0}={}){const o=getComputedStyle(r),l=+o.opacity,c=o.transform==="none"?"":o.transform,u=l*(1-s),[h,d]=G7(i),[f,p]=G7(a);return{delay:e,duration:t,easing:n,css:(m,y)=>`
transform: ${c} translate(${(1-m)*h}${d}, ${(1-m)*f}${p});
opacity: ${l-u*y}`}}function sz(r,{delay:e=0,duration:t=400,easing:n=fb,axis:i="y"}={}){const a=getComputedStyle(r),s=+a.opacity,o=i==="y"?"height":"width",l=parseFloat(a[o]),c=i==="y"?["top","bottom"]:["left","right"],u=c.map(v=>`${v[0].toUpperCase()}${v.slice(1)}`),h=parseFloat(a[`padding${u[0]}`]),d=parseFloat(a[`padding${u[1]}`]),f=parseFloat(a[`margin${u[0]}`]),p=parseFloat(a[`margin${u[1]}`]),m=parseFloat(a[`border${u[0]}Width`]),y=parseFloat(a[`border${u[1]}Width`]);return{delay:e,duration:t,easing:n,css:v=>`overflow: hidden;opacity: ${Math.min(v*20,1)*s};${o}: ${v*l}px;padding-${c[0]}: ${v*h}px;padding-${c[1]}: ${v*d}px;margin-${c[0]}: ${v*f}px;margin-${c[1]}: ${v*p}px;border-${c[0]}-width: ${v*m}px;border-${c[1]}-width: ${v*y}px;min-${o}: 0`}}function W7(r,{delay:e=0,duration:t=400,easing:n=fb,start:i=0,opacity:a=0}={}){const s=getComputedStyle(r),o=+s.opacity,l=s.transform==="none"?"":s.transform,c=1-i,u=o*(1-a);return{delay:e,duration:t,easing:n,css:(h,d)=>`
transform: ${l} scale(${1-c*d});
opacity: ${o-u*d}
`}}var oz=ee('<div data-slot="checkbox-indicator" class="text-current transition-none"><!></div>');function Ff(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"checked",15,!1),i=L(e,"indeterminate",15,!1),a=De(e,["$$slots","$$events","$$legacy","ref","checked","indeterminate","class"]);var s=J(),o=F(s);{const l=(u,h)=>{let d=()=>h?.().checked,f=()=>h?.().indeterminate;var p=oz(),m=te(p);{var y=x=>{Z0(x,{class:"size-3.5"})},v=x=>{var S=J(),A=F(S);{var C=k=>{qR(k,{class:"size-3.5"})};ce(A,k=>{f()&&k(C)},!0)}_(x,S)};ce(m,x=>{d()?x(y):x(v,!1)})}Q(p),_(u,p)};let c=j(()=>Qt("peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",e.class));ve(o,()=>qI,(u,h)=>{h(u,$e({"data-slot":"checkbox",get class(){return g(c)}},()=>a,{get ref(){return t()},set ref(d){t(d)},get checked(){return n()},set checked(d){n(d)},get indeterminate(){return i()},set indeterminate(d){i(d)},children:l,$$slots:{default:!0}}))})}_(r,s),pe()}var lz=ee("<p>Previous version</p>"),cz=ee("<!> <!>",1),uz=ee("<p>Next version</p>"),hz=ee("<!> <!>",1),dz=ee('<div role="navigation"><!> <span class="px-1 font-mono text-xs"> </span> <!></div>');function fz(r,e){ge(e,!0);let t=L(e,"class",3,""),n=j(()=>e.siblingInfo&&e.siblingInfo.currentIndex>0),i=j(()=>e.siblingInfo&&e.siblingInfo.currentIndex<e.siblingInfo.totalSiblings-1),a=j(()=>g(i)?e.siblingInfo.siblingIds[e.siblingInfo.currentIndex+1]:null),s=j(()=>g(n)?e.siblingInfo.siblingIds[e.siblingInfo.currentIndex-1]:null);function o(){g(a)&&e.onNavigateToSibling?.(g(a))}function l(){g(s)&&e.onNavigateToSibling?.(g(s))}var c=J(),u=F(c);{var h=d=>{var f=dz(),p=te(f);ve(p,()=>oo,(x,S)=>{S(x,{children:(A,C)=>{var k=cz(),I=F(k);ve(I,()=>ao,(U,D)=>{D(U,{children:($,H)=>{{let V=j(()=>g(n)?"":"cursor-not-allowed opacity-30"),z=j(()=>!g(n));Qr($,{"aria-label":"Previous message version",get class(){return`h-5 w-5 p-0 ${g(V)??""}`},get disabled(){return g(z)},onclick:l,size:"sm",variant:"ghost",children:(Z,q)=>{O6(Z,{class:"h-3 w-3"})},$$slots:{default:!0}})}},$$slots:{default:!0}})});var R=ae(I,2);ve(R,()=>so,(U,D)=>{D(U,{children:($,H)=>{var V=lz();_($,V)},$$slots:{default:!0}})}),_(A,k)},$$slots:{default:!0}})});var m=ae(p,2),y=te(m);Q(m);var v=ae(m,2);ve(v,()=>oo,(x,S)=>{S(x,{children:(A,C)=>{var k=hz(),I=F(k);ve(I,()=>ao,(U,D)=>{D(U,{children:($,H)=>{{let V=j(()=>g(i)?"":"cursor-not-allowed opacity-30"),z=j(()=>!g(i));Qr($,{"aria-label":"Next message version",get class(){return`h-5 w-5 p-0 ${g(V)??""}`},get disabled(){return g(z)},onclick:o,size:"sm",variant:"ghost",children:(Z,q)=>{N6(Z,{class:"h-3 w-3"})},$$slots:{default:!0}})}},$$slots:{default:!0}})});var R=ae(I,2);ve(R,()=>so,(U,D)=>{D(U,{children:($,H)=>{var V=uz();_($,V)},$$slots:{default:!0}})}),_(A,k)},$$slots:{default:!0}})}),Q(f),qe(()=>{Jt(f,"aria-label",`Message version ${e.siblingInfo.currentIndex+1} of ${e.siblingInfo.totalSiblings??""}`),tr(f,1,`flex items-center gap-1 text-xs text-muted-foreground ${t()??""}`),at(y,`${e.siblingInfo.currentIndex+1}/${e.siblingInfo.totalSiblings??""}`)}),_(d,f)};ce(u,d=>{e.siblingInfo&&e.siblingInfo.totalSiblings>1&&d(h)})}_(r,c),pe()}var gz=ee('<div><div><!> <div class="pointer-events-auto inset-0 flex items-center gap-1 opacity-100 transition-all duration-150"><!> <!> <!> <!></div></div></div> <!>',1);function V7(r,e){ge(e,!0);let t=L(e,"siblingInfo",3,null),n=L(e,"showDeleteDialog",7);function i(){e.onConfirmDelete(),e.onShowDeleteDialogChange(!1)}var a=gz(),s=F(a),o=te(s),l=te(o);{var c=x=>{fz(x,{get siblingInfo(){return t()},get onNavigateToSibling(){return e.onNavigateToSibling}})};ce(l,x=>{t()&&t().totalSiblings>1&&x(c)})}var u=ae(l,2),h=te(u);P1(h,{get icon(){return R6},tooltip:"Copy",get onclick(){return e.onCopy}});var d=ae(h,2);{var f=x=>{P1(x,{get icon(){return j6},tooltip:"Edit",get onclick(){return e.onEdit}})};ce(d,x=>{e.onEdit&&x(f)})}var p=ae(d,2);{var m=x=>{P1(x,{get icon(){return eu},tooltip:"Regenerate",get onclick(){return e.onRegenerate}})};ce(p,x=>{e.role==="assistant"&&e.onRegenerate&&x(m)})}var y=ae(p,2);P1(y,{get icon(){return Eh},tooltip:"Delete",get onclick(){return e.onDelete}}),Q(u),Q(o),Q(s);var v=ae(s,2);{let x=j(()=>e.deletionInfo&&e.deletionInfo.totalCount>1?`This will delete ${e.deletionInfo.totalCount} messages including: ${e.deletionInfo.userMessages} user message${e.deletionInfo.userMessages>1?"s":""} and ${e.deletionInfo.assistantMessages} assistant response${e.deletionInfo.assistantMessages>1?"s":""}. All messages in this branch and their responses will be permanently removed. This action cannot be undone.`:"Are you sure you want to delete this message? This action cannot be undone."),S=j(()=>e.deletionInfo&&e.deletionInfo.totalCount>1?`Delete ${e.deletionInfo.totalCount} Messages`:"Delete");b5(v,{title:"Delete Message",get description(){return g(x)},get confirmText(){return g(S)},cancelText:"Cancel",variant:"destructive",get icon(){return Eh},onConfirm:i,onCancel:()=>e.onShowDeleteDialogChange(!1),get open(){return n()},set open(A){n(A)}})}qe(()=>{tr(s,1,`relative ${e.justify==="start"?"mt-2":""} flex h-6 items-center justify-${e.justify??""}`),tr(o,1,`absolute top-0 ${e.actionsPosition==="left"?"left-0":"right-0"} flex items-center gap-2 opacity-100 transition-opacity`)}),_(r,a),pe()}function ed(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e.class));ve(a,()=>cN,(o,l)=>{l(o,$e({"data-slot":"label",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}function pz(r,e){const t=g(e)();db(t??"")}var mz=ee('<div class="mt-6 w-full max-w-[48rem]"><div class="processing-container svelte-16qxm4u"><span class="processing-text svelte-16qxm4u"> </span></div></div>'),bz=(r,e)=>e.onEditedContentChange?.(r.currentTarget.value),vz=ee("<!> Cancel",1),yz=ee("<!> Save",1),wz=ee('<div class="w-full"><textarea placeholder="Edit assistant message..."></textarea> <div class="mt-2 flex items-center justify-between"><div class="flex items-center space-x-2"><!> <!></div> <div class="flex gap-2"><!> <!></div></div></div>'),xz=ee('<pre class="raw-output svelte-16qxm4u"> </pre>'),Sz=ee('<div class="text-sm whitespace-pre-wrap"> </div>'),kz=ee('<span class="mt-6 mb-4 inline-flex items-center gap-1 text-xs text-muted-foreground"><!> <span>Model used:</span> <button class="inline-flex cursor-pointer items-center gap-1 rounded-sm bg-muted-foreground/15 px-1.5 py-0.75"> <!></button></span>'),Az=ee('<div role="group" aria-label="Assistant message with actions"><!> <!> <!> <!> <!></div>');function _z(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"editedContent",7,""),i=L(e,"isEditing",3,!1),a=L(e,"shouldBranchAfterEdit",7,!1),s=L(e,"siblingInfo",3,null),o=L(e,"textareaElement",15);const l=q7();let c=j(fn),u=j(f7),h=j(()=>()=>g(c).showModelInfo?g(c).modelSelectorEnabled?e.message.model??null:g(u):null);var d=Az(),f=te(d);{var p=R=>{{let U=j(()=>!e.message.timestamp),D=j(()=>!!e.messageContent?.trim());Xz(R,{get reasoningContent(){return e.thinkingContent},get isStreaming(){return g(U)},get hasRegularContent(){return g(D)}})}};ce(f,R=>{e.thinkingContent&&R(p)})}var m=ae(f,2);{var y=R=>{var U=mz(),D=te(U),$=te(D),H=te($,!0);Q($),Q(D),Q(U),qe(V=>at(H,V),[()=>l.getProcessingMessage()]),xi(1,U,()=>Pf),_(R,U)};ce(m,R=>{e.message?.role==="assistant"&&Kl()&&!e.message?.content?.trim()&&R(y)})}var v=ae(m,2);{var x=R=>{var U=wz(),D=te(U);e0(D),D.__keydown=function(...X){e.onEditKeydown?.apply(this,X)},D.__input=[bz,e],Tr(D,X=>o(X),()=>o());var $=ae(D,2),H=te($),V=te(H);Ff(V,{id:"branch-after-edit",onCheckedChange:X=>e.onShouldBranchAfterEditChange?.(X===!0),get checked(){return a()},set checked(X){a(X)}});var z=ae(V,2);ed(z,{for:"branch-after-edit",class:"cursor-pointer text-sm text-muted-foreground",children:(X,ie)=>{Rt();var P=sr("Branch conversation after edit");_(X,P)},$$slots:{default:!0}}),Q(H);var Z=ae(H,2),q=te(Z);Qr(q,{class:"h-8 px-3",get onclick(){return e.onCancelEdit},size:"sm",variant:"outline",children:(X,ie)=>{var P=vz(),be=F(P);eo(be,{class:"mr-1 h-3 w-3"}),Rt(),_(X,P)},$$slots:{default:!0}});var re=ae(q,2);{let X=j(()=>!n()?.trim());Qr(re,{class:"h-8 px-3",get onclick(){return e.onSaveEdit},get disabled(){return g(X)},size:"sm",children:(ie,P)=>{var be=yz(),_e=F(be);Z0(_e,{class:"mr-1 h-3 w-3"}),Rt(),_(ie,be)},$$slots:{default:!0}})}Q(Z),Q($),Q(U),qe(()=>tr(D,1,`min-h-[50vh] w-full resize-y rounded-2xl px-3 py-2 text-sm ${ab}`,"svelte-16qxm4u")),Nl(D,n),_(R,U)},S=R=>{var U=J(),D=F(U);{var $=V=>{var z=J(),Z=F(z);{var q=X=>{var ie=xz(),P=te(ie,!0);Q(ie),qe(()=>at(P,e.messageContent||"")),_(X,ie)},re=X=>{{let ie=j(()=>e.messageContent||"");Hk(X,{get content(){return g(ie)}})}};ce(Z,X=>{fn().disableReasoningFormat?X(q):X(re,!1)})}_(V,z)},H=V=>{var z=Sz(),Z=te(z,!0);Q(z),qe(()=>at(Z,e.messageContent)),_(V,z)};ce(D,V=>{e.message.role==="assistant"?V($):V(H,!1)},!0)}_(R,U)};ce(v,R=>{i()?R(x):R(S,!1)})}var A=ae(v,2);{var C=R=>{var U=kz(),D=te(U);VR(D,{class:"h-3.5 w-3.5"});var $=ae(D,4);$.__click=[pz,h];var H=te($),V=ae(H);R6(V,{class:"ml-1 h-3 w-3 "}),Q($),Q(U),qe(z=>at(H,`${z??""} `),[()=>g(h)()]),_(R,U)};ce(A,R=>{g(h)()&&R(C)})}var k=ae(A,2);{var I=R=>{V7(R,{role:"assistant",justify:"start",actionsPosition:"left",get siblingInfo(){return s()},get showDeleteDialog(){return e.showDeleteDialog},get deletionInfo(){return e.deletionInfo},get onCopy(){return e.onCopy},get onEdit(){return e.onEdit},get onRegenerate(){return e.onRegenerate},get onDelete(){return e.onDelete},get onConfirmDelete(){return e.onConfirmDelete},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange}})};ce(k,R=>{e.message.timestamp&&!i()&&R(I)})}Q(d),qe(()=>tr(d,1,`text-md group w-full leading-7.5 ${t()??""}`,"svelte-16qxm4u")),_(r,d),pe()}wi(["keydown","input","click"]);var Cz=ee("<div><!></div>");function X7(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=Cz();Lt(i,s=>({"data-slot":"card",class:s,...n}),[()=>Qt("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}var Ez=(r,e)=>e.onEditedContentChange(r.currentTarget.value),Tz=ee("<!> Cancel",1),Iz=ee("<!> Send",1),Mz=ee('<div class="w-full max-w-[80%]"><textarea placeholder="Edit your message..."></textarea> <div class="mt-2 flex justify-end gap-2"><!> <!></div></div>'),Oz=ee('<div class="mb-2 max-w-[80%]"><!></div>'),Nz=ee('<div class="text-md"><!></div>'),Rz=ee('<span class="text-md whitespace-pre-wrap"> </span>'),Pz=ee('<div class="max-w-[80%]"><!></div>'),Fz=ee("<!> <!> <!>",1),Dz=ee('<div aria-label="User message with actions" role="group"><!></div>');function Lz(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"editedContent",7),i=L(e,"siblingInfo",3,null),a=L(e,"textareaElement",15),s=oe(!1),o=oe(void 0);const l=fn();Ft(()=>{if(!g(o)||!e.message.content.trim())return;if(e.message.content.includes(`
`)){O(s,!0);return}const f=new ResizeObserver(p=>{for(const m of p){const y=m.target;O(s,y.offsetHeight>24*1.5)}});return f.observe(g(o)),()=>{f.disconnect()}});var c=Dz(),u=te(c);{var h=f=>{var p=Mz(),m=te(p);e0(m),m.__keydown=function(...S){e.onEditKeydown?.apply(this,S)},m.__input=[Ez,e],Tr(m,S=>a(S),()=>a());var y=ae(m,2),v=te(y);Qr(v,{class:"h-8 px-3",get onclick(){return e.onCancelEdit},size:"sm",variant:"outline",children:(S,A)=>{var C=Tz(),k=F(C);eo(k,{class:"mr-1 h-3 w-3"}),Rt(),_(S,C)},$$slots:{default:!0}});var x=ae(v,2);{let S=j(()=>!n().trim());Qr(x,{class:"h-8 px-3",get onclick(){return e.onSaveEdit},get disabled(){return g(S)},size:"sm",children:(A,C)=>{var k=Iz(),I=F(k);Z0(I,{class:"mr-1 h-3 w-3"}),Rt(),_(A,k)},$$slots:{default:!0}})}Q(y),Q(p),qe(()=>tr(m,1,`min-h-[60px] w-full resize-none rounded-2xl px-3 py-2 text-sm ${ab}`)),Nl(m,n),_(f,p)},d=f=>{var p=Fz(),m=F(p);{var y=C=>{var k=Oz(),I=te(k);u7(I,{get attachments(){return e.message.extra},readonly:!0,imageHeight:"h-80"}),Q(k),_(C,k)};ce(m,C=>{e.message.extra&&e.message.extra.length>0&&C(y)})}var v=ae(m,2);{var x=C=>{{let k=j(()=>g(s)?"":void 0);X7(C,{class:"max-w-[80%] rounded-[1.125rem] bg-primary px-3.75 py-1.5 text-primary-foreground data-[multiline]:py-2.5",get"data-multiline"(){return g(k)},children:(I,R)=>{var U=J(),D=F(U);{var $=V=>{var z=Nz(),Z=te(z);Hk(Z,{class:"markdown-user-content text-primary-foreground",get content(){return e.message.content}}),Q(z),Tr(z,q=>O(o,q),()=>g(o)),_(V,z)},H=V=>{var z=Rz(),Z=te(z,!0);Q(z),Tr(z,q=>O(o,q),()=>g(o)),qe(()=>at(Z,e.message.content)),_(V,z)};ce(D,V=>{l.renderUserContentAsMarkdown?V($):V(H,!1)})}_(I,U)},$$slots:{default:!0}})}};ce(v,C=>{e.message.content.trim()&&C(x)})}var S=ae(v,2);{var A=C=>{var k=Pz(),I=te(k);V7(I,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return i()},get showDeleteDialog(){return e.showDeleteDialog},role:"user"}),Q(k),_(C,k)};ce(S,C=>{e.message.timestamp&&C(A)})}_(f,p)};ce(u,f=>{e.isEditing?f(h):f(d,!1)})}Q(c),qe(()=>tr(c,1,`group flex flex-col items-end gap-3 md:gap-2 ${t()??""}`)),_(r,c),pe()}wi(["keydown","input"]);function Bz(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"siblingInfo",3,null),i=oe(null),a=oe(Mr(e.message.content)),s=oe(!1),o=oe(!1),l=oe(!1),c=oe(void 0),u=j(()=>{if(e.message.role==="assistant"){const U=e.message.thinking?.trim();return U||null}return null});function h(){O(s,!1),O(a,e.message.content,!0)}async function d(){await db(e.message.content,"Message copied to clipboard"),e.onCopy?.(e.message)}function f(){e.onDelete?.(e.message),O(o,!1)}async function p(){O(i,await U7(e.message.id),!0),O(o,!0)}function m(){O(s,!0),O(a,e.message.content,!0),setTimeout(()=>{g(c)&&(g(c).focus(),g(c).setSelectionRange(g(c).value.length,g(c).value.length))},0)}function y(U){O(a,U,!0)}function v(U){U.key==="Enter"&&!U.shiftKey&&!p7(U)?(U.preventDefault(),S()):U.key==="Escape"&&(U.preventDefault(),h())}function x(){e.onRegenerateWithBranching?.(e.message)}function S(){e.message.role==="user"?e.onEditWithBranching?.(e.message,g(a).trim()):e.onEditWithReplacement?.(e.message,g(a).trim(),g(l)),O(s,!1),O(l,!1)}function A(U){O(o,U,!0)}var C=J(),k=F(C);{var I=U=>{Lz(U,{get class(){return t()},get deletionInfo(){return g(i)},get editedContent(){return g(a)},get isEditing(){return g(s)},get message(){return e.message},onCancelEdit:h,onConfirmDelete:f,onCopy:d,onDelete:p,onEdit:m,onEditKeydown:v,onEditedContentChange:y,get onNavigateToSibling(){return e.onNavigateToSibling},onSaveEdit:S,onShowDeleteDialogChange:A,get showDeleteDialog(){return g(o)},get siblingInfo(){return n()},get textareaElement(){return g(c)},set textareaElement(D){O(c,D,!0)}})},R=U=>{_z(U,{get class(){return t()},get deletionInfo(){return g(i)},get editedContent(){return g(a)},get isEditing(){return g(s)},get message(){return e.message},get messageContent(){return e.message.content},onCancelEdit:h,onConfirmDelete:f,onCopy:d,onDelete:p,onEdit:m,onEditKeydown:v,onEditedContentChange:y,get onNavigateToSibling(){return e.onNavigateToSibling},onRegenerate:x,onSaveEdit:S,onShowDeleteDialogChange:A,get shouldBranchAfterEdit(){return g(l)},onShouldBranchAfterEditChange:D=>O(l,D,!0),get showDeleteDialog(){return g(o)},get siblingInfo(){return n()},get thinkingContent(){return g(u)},get textareaElement(){return g(c)},set textareaElement(D){O(c,D,!0)}})};ce(k,U=>{e.message.role==="user"?U(I):U(R,!1)})}_(r,C),pe()}var Uz=ee('<div style="height: auto; "></div>');function zz(r,e){ge(e,!0);let t=L(e,"messages",19,()=>[]),n=oe(Mr([]));function i(){const d=co();d?ir.getConversationMessages(d.id).then(f=>{O(n,f,!0)}):O(n,[],!0)}Ft(()=>{co()&&i()});let a=j(()=>t().length?t().map(d=>{const f=QB(g(n),d.id);return{message:d,siblingInfo:f||{message:d,siblingIds:[d.id],currentIndex:0,totalSiblings:1}}}):[]);async function s(d){await P7(d)}async function o(d,f){e.onUserAction?.(),await D7(d.id,f),i()}async function l(d,f,p){e.onUserAction?.(),await F7(d.id,f,p),i()}async function c(d){e.onUserAction?.(),await L7(d.id),i()}async function u(d){await B7(d.id),i()}var h=Uz();_n(h,21,()=>g(a),({message:d,siblingInfo:f})=>d.id,(d,f)=>{let p=()=>g(f).message,m=()=>g(f).siblingInfo;Bz(d,{class:"mx-auto w-full max-w-[48rem]",get message(){return p()},get siblingInfo(){return m()},onDelete:u,onNavigateToSibling:s,onEditWithBranching:o,onEditWithReplacement:l,onRegenerateWithBranching:c})}),Q(h),qe(()=>tr(h,1,`flex h-full flex-col space-y-10 pt-16 md:pt-24 ${e.class??""}`)),_(r,h),pe()}function jz(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"open",15,!1),i=De(e,["$$slots","$$events","$$legacy","ref","open"]);var a=J(),s=F(a);ve(s,()=>WI,(o,l)=>{l(o,$e({"data-slot":"collapsible"},()=>i,{get ref(){return t()},set ref(c){t(c)},get open(){return n()},set open(c){n(c)}}))}),_(r,a),pe()}function Hz(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref"]);var i=J(),a=F(i);ve(a,()=>KI,(s,o)=>{o(s,$e({"data-slot":"collapsible-trigger"},()=>n,{get ref(){return t()},set ref(l){t(l)}}))}),_(r,i),pe()}function qz(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref"]);var i=J(),a=F(i);ve(a,()=>XI,(s,o)=>{o(s,$e({"data-slot":"collapsible-content"},()=>n,{get ref(){return t()},set ref(l){t(l)}}))}),_(r,i),pe()}var Gz=ee('<div class="flex items-center gap-2 text-muted-foreground"><!> <span class="text-sm font-medium"> </span></div> <div><!> <span class="sr-only">Toggle reasoning content</span></div>',1),Wz=ee('<div class="border-t border-muted px-3 pb-3"><div class="pt-3"><div class="text-xs leading-relaxed break-words whitespace-pre-wrap"> </div></div></div>'),Vz=ee("<!> <!>",1);function Xz(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"hasRegularContent",3,!1),i=L(e,"isStreaming",3,!1);const a=fn();let s=oe(Mr(a.showThoughtInProgress));Ft(()=>{n()&&e.reasoningContent&&a.showThoughtInProgress&&O(s,!1)});var o=J(),l=F(o);ve(l,()=>jz,(c,u)=>{u(c,{get class(){return`mb-6 ${t()??""}`},get open(){return g(s)},set open(h){O(s,h,!0)},children:(h,d)=>{X7(h,{class:"gap-0 border-muted bg-muted/30 py-0",children:(f,p)=>{var m=Vz(),y=F(m);ve(y,()=>Hz,(x,S)=>{S(x,{class:"flex cursor-pointer items-center justify-between p-3",children:(A,C)=>{var k=Gz(),I=F(k),R=te(I);M6(R,{class:"h-4 w-4"});var U=ae(R,2),D=te(U,!0);Q(U),Q(I);var $=ae(I,2),H=te($);PR(H,{class:"h-4 w-4"}),Rt(2),Q($),qe(V=>{at(D,i()?"Reasoning...":"Reasoning"),tr($,1,V)},[()=>ai($h({variant:"ghost",size:"sm",class:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground"}))]),_(A,k)},$$slots:{default:!0}})});var v=ae(y,2);ve(v,()=>qz,(x,S)=>{S(x,{children:(A,C)=>{var k=Wz(),I=te(k),R=te(I),U=te(R,!0);Q(R),Q(I),Q(k),qe(()=>at(U,e.reasoningContent??"")),_(A,k)},$$slots:{default:!0}})}),_(f,m)},$$slots:{default:!0}})},$$slots:{default:!0}})}),_(r,o),pe()}const $z=2e3;var Kz=ee('<span class="chat-processing-info-detail svelte-1m2w9ag"> </span>'),Yz=ee('<div><div class="chat-processing-info-content svelte-1m2w9ag"></div></div>');function Jz(r,e){ge(e,!0);const t=q7();let n=j(Kl),i=j(()=>t.getProcessingDetails()),a=j(()=>g(n)||fn().keepStatsVisible);Ft(()=>{const c=fn().keepStatsVisible;(c||g(n))&&t.startMonitoring(),!g(n)&&!c&&setTimeout(()=>{fn().keepStatsVisible||t.stopMonitoring()},$z)}),Ft(()=>{const c=co(),u=Zh();if(fn().keepStatsVisible&&c){if(u.length===0){Pn.clearConversationState(c.id);return}let d=!1;for(let f=u.length-1;f>=0;f--){const p=u[f];if(p.role==="assistant"&&p.timings){d=!0,Pn.updateFromTimingData({prompt_n:p.timings.prompt_n||0,predicted_n:p.timings.predicted_n||0,predicted_per_second:p.timings.predicted_n&&p.timings.predicted_ms?p.timings.predicted_n/p.timings.predicted_ms*1e3:0,cache_n:p.timings.cache_n||0},c.id).catch(m=>{console.warn("Failed to update processing state from stored timings:",m)});break}}d||Pn.clearConversationState(c.id)}});var s=Yz();let o;var l=te(s);_n(l,20,()=>g(i),c=>c,(c,u)=>{var h=Kz(),d=te(h,!0);Q(h),qe(()=>at(d,u)),_(c,h)}),Q(l),Q(s),qe(c=>o=tr(s,1,"chat-processing-info-container svelte-1m2w9ag",null,o,c),[()=>({visible:g(a)})]),_(r,s),pe()}var Qz=ee('<header class="md:background-transparent pointer-events-none fixed top-0 right-0 left-0 z-50 flex items-center justify-end bg-background/40 p-4 backdrop-blur-xl md:left-[var(--sidebar-width)]"><div class="pointer-events-auto flex items-center space-x-2"><!></div></header> <!>',1);function Zz(r){let e=oe(!1);function t(){O(e,!0)}var n=Qz(),i=F(n),a=te(i),s=te(a);Qr(s,{variant:"ghost",size:"sm",onclick:t,children:(l,c)=>{z6(l,{class:"h-4 w-4"})},$$slots:{default:!0}}),Q(a),Q(i);var o=ae(i,2);jH(o,{get open(){return g(e)},onOpenChange:l=>O(e,l,!0)}),_(r,n)}function ej(){Kn.fetchServerProps()}var tj=ee('<div><div class="rounded-md border border-yellow-200 bg-yellow-50 px-3 py-2 dark:border-yellow-800 dark:bg-yellow-950"><div class="flex items-center justify-between"><div class="flex items-center"><!> <p class="ml-2 text-sm text-yellow-800 dark:text-yellow-200">Server `/props` endpoint not available - using cached data</p></div> <button class="ml-3 flex items-center gap-1.5 rounded bg-yellow-100 px-2 py-1 text-xs font-medium text-yellow-800 hover:bg-yellow-200 disabled:opacity-50 dark:bg-yellow-900 dark:text-yellow-200 dark:hover:bg-yellow-800"><!> </button></div></div></div>');function $7(r,e){ge(e,!0);let t=L(e,"class",3,"");var n=tj(),i=te(n),a=te(i),s=te(a),o=te(s);Th(o,{class:"h-4 w-4 text-yellow-600 dark:text-yellow-400"}),Rt(2),Q(s);var l=ae(s,2);l.__click=[ej];var c=te(l);{let h=j(()=>du()?"animate-spin":"");eu(c,{get class(){return`h-3 w-3 ${g(h)??""}`}})}var u=ae(c);Q(l),Q(a),Q(i),Q(n),qe((h,d)=>{tr(n,1,`mb-3 ${t()??""}`),l.disabled=h,at(u,` ${d??""}`)},[du,()=>du()?"Checking...":"Retry"]),xi(1,n,()=>uo,()=>({y:10,duration:250})),_(r,n),pe()}wi(["click"]);function Yl(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("text-lg font-semibold",e.class));ve(a,()=>Ep,(o,l)=>{l(o,$e({"data-slot":"alert-dialog-title",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}function pu(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt($h(),e.class));ve(a,()=>BT,(o,l)=>{l(o,$e({"data-slot":"alert-dialog-action",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}function gb(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt($h({variant:"outline"}),e.class));ve(a,()=>zT,(o,l)=>{l(o,$e({"data-slot":"alert-dialog-cancel",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}var rj=ee("<div><!></div>");function Jl(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=rj();Lt(i,s=>({"data-slot":"alert-dialog-footer",class:s,...n}),[()=>Qt("mt-6 flex flex-row gap-2 sm:mt-0 sm:justify-end [&>*]:flex-1 sm:[&>*]:flex-none",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}var nj=ee("<div><!></div>");function Ql(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=nj();Lt(i,s=>({"data-slot":"alert-dialog-header",class:s,...n}),[()=>Qt("flex flex-col gap-2 text-center sm:text-left",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}function K7(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e.class));ve(a,()=>Hp,(o,l)=>{l(o,$e({"data-slot":"alert-dialog-overlay",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}var ij=ee("<!> <!>",1);function Zl(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","portalProps"]);var i=J(),a=F(i);ve(a,()=>Ll,(s,o)=>{o(s,$e(()=>e.portalProps,{children:(l,c)=>{var u=ij(),h=F(u);K7(h,{});var d=ae(h,2);{let f=j(()=>Qt("fixed z-[999999] grid w-full gap-4 border bg-background p-6 shadow-lg duration-200","right-0 bottom-0 left-0 max-h-[100dvh] translate-x-0 translate-y-0 overflow-y-auto rounded-t-lg","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-bottom-full","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-full","sm:top-[50%] sm:right-auto sm:bottom-auto sm:left-[50%] sm:max-h-[100vh] sm:max-w-lg sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg","sm:data-[state=closed]:slide-out-to-bottom-0 sm:data-[state=closed]:zoom-out-95","sm:data-[state=open]:slide-in-from-bottom-0 sm:data-[state=open]:zoom-in-95",e.class));ve(d,()=>TI,(p,m)=>{m(p,$e({"data-slot":"alert-dialog-content",get class(){return g(f)}},()=>n,{get ref(){return t()},set ref(y){t(y)}}))})}_(l,u)},$$slots:{default:!0}}))}),_(r,i),pe()}function ec(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("text-sm text-muted-foreground",e.class));ve(a,()=>qp,(o,l)=>{l(o,$e({"data-slot":"alert-dialog-description",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}const tc=FT,aj=Ll,Y7=100,J7=50,sj=10;function Q7(r,e="white"){return new Promise((t,n)=>{try{const i=new Image;i.onload=()=>{const a=document.createElement("canvas"),s=a.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=i.naturalWidth||300,l=i.naturalHeight||300;a.width=o,a.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,a.width,a.height)),s.drawImage(i,0,0,o,l),t(a.toDataURL(ha.PNG))},i.onerror=()=>{n(new Error("Failed to load SVG image. Ensure the SVG data is valid."))},i.src=r}catch(i){const s=`Error converting SVG to PNG: ${i instanceof Error?i.message:String(i)}`;console.error(s,i),n(new Error(s))}})}function Z7(r){return r===ha.SVG}function e8(r,e="white"){return new Promise((t,n)=>{try{const i=new Image;i.onload=()=>{const a=document.createElement("canvas"),s=a.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=i.naturalWidth||300,l=i.naturalHeight||300;a.width=o,a.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,a.width,a.height)),s.drawImage(i,0,0,o,l),t(a.toDataURL(ha.PNG))},i.onerror=()=>{n(new Error("Failed to load WebP image. Ensure the WebP data is valid."))},i.src=r}catch(i){const s=`Error converting WebP to PNG: ${i instanceof Error?i.message:String(i)}`;console.error(s,i),n(new Error(s))}})}function t8(r){return r===ha.WEBP}const oj={prefixLength:1024*10,suspiciousCharThresholdRatio:.15,maxAbsoluteNullBytes:2};function lj(r){return Object.values(Rr).some(t=>r.toLowerCase().endsWith(t))}async function cj(r){return new Promise((e,t)=>{const n=new FileReader;n.onload=i=>{i.target?.result!==null&&i.target?.result!==void 0?e(i.target.result):t(new Error("Failed to read file"))},n.onerror=()=>t(new Error("File reading error")),n.readAsText(r)})}function uj(r,e={}){if(!r)return!0;const t={...oj,...e},n=r.substring(0,t.prefixLength);let i=0,a=0;for(let s=0;s<n.length;s++){const o=n.charCodeAt(s);if(o===0){i++;continue}o<32&&o!==9&&o!==10&&o!==13&&(o<8||o>13&&o<27)&&a++,o===65533&&a++}return!(i>t.maxAbsoluteNullBytes||a/n.length>t.suspiciousCharThresholdRatio)}function r8(r){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>{const a=n.result.split(",")[1];e(a)},n.onerror=()=>t(n.error),n.readAsDataURL(r)})}async function hj(r){const e=[],t=[];for(const n of r)if(da(n.type)===tn.IMAGE){if(n.preview){let i=n.preview;if(Z7(n.type))try{i=await Q7(i)}catch(a){console.error("Failed to convert SVG to PNG for database storage:",a)}else if(t8(n.type))try{i=await e8(i)}catch(a){console.error("Failed to convert WebP to PNG for database storage:",a)}e.push({type:"imageFile",name:n.name,base64Url:i})}}else if(da(n.type)===tn.AUDIO)try{const i=await r8(n.file);e.push({type:"audioFile",name:n.name,base64Data:i,mimeType:n.type})}catch(i){console.error(`Failed to process audio file ${n.name}:`,i)}else if(da(n.type)===tn.PDF)try{const i=await r8(n.file),a=fn(),s=Za();let o=!!a.pdfAsImage&&s;if(a.pdfAsImage&&!s&&(console.log("Non-vision model detected: forcing PDF-to-text mode and updating settings"),nn.updateConfig("pdfAsImage",!1),es.warning("PDF setting changed: Non-vision model detected, PDFs will be processed as text instead of images.",{duration:5e3}),o=!1),o)try{const l=await Hy(n.file);es.success(`PDF "${n.name}" processed as ${l.length} images for vision model.`,{duration:3e3}),e.push({type:"pdfFile",name:n.name,content:`PDF file with ${l.length} pages`,images:l,processedAsImages:!0,base64Data:i})}catch(l){console.warn(`Failed to process PDF ${n.name} as images, falling back to text:`,l);const c=await jy(n.file);e.push({type:"pdfFile",name:n.name,content:c,processedAsImages:!1,base64Data:i})}else{const l=await jy(n.file);es.success(`PDF "${n.name}" processed as text content.`,{duration:3e3}),e.push({type:"pdfFile",name:n.name,content:l,processedAsImages:!1,base64Data:i})}}catch(i){console.error(`Failed to process PDF file ${n.name}:`,i)}else try{const i=await cj(n.file);i.trim()===""?(console.warn(`File ${n.name} is empty and will be skipped`),t.push(n.name)):uj(i)?e.push({type:"textFile",name:n.name,content:i}):console.warn(`File ${n.name} appears to be binary and will be skipped`)}catch(i){console.error(`Failed to read file ${n.name}:`,i)}return{extras:e,emptyFiles:t}}function n8(r){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>e(n.result),n.onerror=()=>t(n.error),n.readAsDataURL(r)})}function dj(r){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>e(n.result),n.onerror=()=>t(n.error),n.readAsText(r)})}async function fj(r){const e=[];for(const t of r){const i={id:Date.now().toString()+Math.random().toString(36).substr(2,9),name:t.name,size:t.size,type:t.type,file:t};try{if(da(t.type)===tn.IMAGE){let a=await n8(t);if(Z7(t.type))try{a=await Q7(a)}catch(s){console.error("Failed to convert SVG to PNG:",s)}else if(t8(t.type))try{a=await e8(a)}catch(s){console.error("Failed to convert WebP to PNG:",s)}e.push({...i,preview:a})}else if(da(t.type)===tn.TEXT||lj(t.name))try{const a=await dj(t);e.push({...i,textContent:a})}catch(a){console.warn("Failed to read text file, adding without content:",a),e.push(i)}else if(da(t.type)===tn.PDF){e.push(i);const a=Za(),s=nn.config;a&&!s.pdfAsImage&&es.info("You can enable parsing PDF as images with vision models.",{duration:8e3,action:{label:"Enable PDF as Images",onClick:()=>{nn.updateConfig("pdfAsImage",!0),es.success("PDF parsing as images enabled!",{duration:3e3})}}})}else if(da(t.type)===tn.AUDIO){const a=await n8(t);e.push({...i,preview:a})}else e.push(i)}catch(a){console.error("Error processing file",t.name,a),e.push(i)}}return e}var gj=ee('<div class="pointer-events-none fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm"><div class="flex flex-col items-center justify-center rounded-2xl border-2 border-dashed border-border bg-background p-12 shadow-lg"><!> <p class="text-lg font-medium text-foreground">Attach a file</p> <p class="text-sm text-muted-foreground">Drop your files here to upload</p></div></div>');function pj(r){var e=gj(),t=te(e),n=te(t);H6(n,{class:"mb-4 h-12 w-12 text-muted-foreground"}),Rt(4),Q(t),Q(e),_(r,e)}var mj=ee('<div aria-label="Chat interface with file drop zone" class="flex h-full flex-col overflow-y-auto px-4 md:px-6" role="main"><!> <div class="pointer-events-none sticky right-0 bottom-0 left-0 mt-auto"><!> <!> <div class="conversation-chat-form pointer-events-auto rounded-t-3xl pb-4 svelte-sn2p3p"><!></div></div></div>'),bj=ee('<div aria-label="Welcome screen with file drop zone" class="flex h-full items-center justify-center" role="main"><div class="w-full max-w-2xl px-4"><div class="mb-8 text-center"><h1 class="mb-2 text-3xl font-semibold tracking-tight">llama.cpp</h1> <p class="text-lg text-muted-foreground">How can I help you today?</p></div> <div class="mb-6 flex justify-center"><!></div> <!> <div><!></div></div></div>'),vj=ee("<!> <!>",1),yj=ee('<div class="rounded-md bg-destructive/10 px-3 py-2"><p class="font-mono text-sm break-all text-destructive"> </p> <p class="mt-1 text-xs text-muted-foreground">File type not supported</p></div>'),wj=ee('<div class="space-y-2"><h4 class="text-sm font-medium text-destructive">Unsupported File Types</h4> <div class="space-y-1"></div></div>'),xj=ee('<div class="rounded-md bg-destructive/10 px-3 py-2"><p class="font-mono text-sm break-all text-destructive"> </p> <p class="mt-1 text-xs text-muted-foreground"> </p></div>'),Sj=ee('<div class="space-y-2"><h4 class="text-sm font-medium text-destructive">Model Compatibility Issues</h4> <div class="space-y-1"></div></div>'),kj=ee('<!> <div class="space-y-4"><!> <!> <div class="rounded-md bg-muted/50 p-3"><h4 class="mb-2 text-sm font-medium">This model supports:</h4> <p class="text-sm text-muted-foreground"> </p></div></div> <!>',1),Aj=ee("<!> <!>",1),_j=ee("<!> <!> <!> <!> <!> <!> <!>",1);function i8(r,e){ge(e,!0);let t=L(e,"showCenteredEmpty",3,!1),n=oe(!0),i=oe(void 0),a=oe(0),s=oe(!1),o=oe(0),l,c,u=oe(!1),h=oe(Mr([])),d=oe(!1),f=oe(Mr({generallyUnsupported:[],modalityUnsupported:[],modalityReasons:{},supportedTypes:[]})),p=oe(!1),m=oe(!1),y=oe(Mr([])),v=j(()=>t()&&!co()&&Zh().length===0&&!Kl()),x=j(M7),S=j(du),A=j(Kl);async function C(){const Ie=co();Ie&&await hb(Ie.id),O(p,!1)}function k(Ie){Ie.preventDefault(),c9(a),Ie.dataTransfer?.types.includes("Files")&&O(s,!0)}function I(Ie){Ie.preventDefault(),c9(a,-1),g(a)===0&&O(s,!1)}function R(Ie){Ie||R7()}function U(Ie){Ie.preventDefault()}function D(Ie){Ie.preventDefault(),O(s,!1),O(a,0),Ie.dataTransfer?.files&&q(Array.from(Ie.dataTransfer.files))}function $(Ie){O(h,g(h).filter(Ve=>Ve.id!==Ie),!0)}function H(Ie){q(Ie)}function V(Ie){(Ie.ctrlKey||Ie.metaKey)&&Ie.shiftKey&&(Ie.key==="d"||Ie.key==="D")&&(Ie.preventDefault(),co()&&O(p,!0))}function z(){if(!g(i))return;const{scrollTop:Ie,scrollHeight:Ve,clientHeight:We}=g(i),mt=Ve-Ie-We<sj;Ie<g(o)&&!mt?(O(d,!0),O(n,!1)):mt&&g(d)&&(O(d,!1),O(n,!0)),c&&clearTimeout(c),c=setTimeout(()=>{mt&&(O(d,!1),O(n,!0))},Y7),O(o,Ie,!0)}async function Z(Ie,Ve){const We=Ve?await hj(Ve):void 0;if(We?.emptyFiles&&We.emptyFiles.length>0){if(O(y,We.emptyFiles,!0),O(m,!0),Ve){const mt=new Set(We.emptyFiles);O(h,g(h).filter(Ke=>!mt.has(Ke.name)),!0)}return!1}const Qe=We?.extras;return O(d,!1),O(n,!0),await N7(Ie,Qe),re(),!0}async function q(Ie){const Ve=[],We=[];for(const Ge of Ie)kE(Ge.name,Ge.type)?Ve.push(Ge):We.push(Ge);const{supportedFiles:Qe,unsupportedFiles:mt,modalityReasons:Ke}=GB(Ve);if([...We,...mt].length>0){const Ge=["text files","PDFs"];Za()&&Ge.push("images"),el()&&Ge.push("audio files"),O(f,{generallyUnsupported:We,modalityUnsupported:mt,modalityReasons:Ke,supportedTypes:Ge},!0),O(u,!0)}if(Qe.length>0){const Ge=await fj(Qe);O(h,[...g(h),...Ge],!0)}}function re(Ie="smooth"){g(i)?.scrollTo({top:g(i)?.scrollHeight,behavior:Ie})}Pv(()=>{setTimeout(()=>re("instant"),J7)}),Si(()=>{setTimeout(()=>re("instant"),J7)}),Ft(()=>{g(A)&&g(n)?l=setInterval(re,Y7):l&&(clearInterval(l),l=void 0)});var X=_j();Rn("keydown",Tl,V);var ie=F(X);{var P=Ie=>{pj(Ie)};ce(ie,Ie=>{g(s)&&Ie(P)})}var be=ae(ie,2);Zz(be);var _e=ae(be,2);{var W=Ie=>{var Ve=mj(),We=te(Ve);{let lt=j(Zh);zz(We,{class:"mb-16 md:mb-24",get messages(){return g(lt)},onUserAction:()=>{O(d,!1),O(n,!0),re()}})}var Qe=ae(We,2),mt=te(Qe);Jz(mt,{});var Ke=ae(mt,2);{var ze=lt=>{$7(lt,{class:"pointer-events-auto mx-auto max-w-[48rem] px-4"})};ce(Ke,lt=>{d7()&&lt(ze)})}var Ge=ae(Ke,2),ot=te(Ge);m7(ot,{get isLoading(){return g(A)},onFileRemove:$,onFileUpload:H,onSend:Z,onStop:()=>Rf(),showHelperText:!1,get uploadedFiles(){return g(h)},set uploadedFiles(lt){O(h,lt,!0)}}),Q(Ge),Q(Qe),Q(Ve),Tr(Ve,lt=>O(i,lt),()=>g(i)),Rn("dragenter",Ve,k),Rn("dragleave",Ve,I),Rn("dragover",Ve,U),Rn("drop",Ve,D),Rn("scroll",Ve,z),xi(1,Qe,()=>sz,()=>({duration:150,axis:"y"})),_(Ie,Ve)},me=Ie=>{var Ve=J(),We=F(Ve);{var Qe=Ke=>{Vre(Ke,{})},mt=Ke=>{var ze=J(),Ge=F(ze);{var ot=ct=>{qk(ct,{get error(){return Kn.error}})},lt=ct=>{var Ct=J(),St=F(Ct);{var Ze=nt=>{var ht=bj(),kt=te(ht),Se=te(kt),Fe=ae(Se,2),it=te(Fe);Yre(it,{}),Q(Fe);var yt=ae(Fe,2);{var $t=mr=>{$7(mr,{})};ce(yt,mr=>{d7()&&mr($t)})}var kr=ae(yt,2),Ar=te(kr);m7(Ar,{get isLoading(){return g(A)},onFileRemove:$,onFileUpload:H,onSend:Z,onStop:()=>Rf(),showHelperText:!0,get uploadedFiles(){return g(h)},set uploadedFiles(mr){O(h,mr,!0)}}),Q(kr),Q(kt),Q(ht),Rn("dragenter",ht,k),Rn("dragleave",ht,I),Rn("dragover",ht,U),Rn("drop",ht,D),xi(1,Se,()=>Pf,()=>({duration:300})),xi(1,Fe,()=>uo,()=>({y:10,duration:300,delay:200})),xi(1,kr,()=>uo,()=>({y:10,duration:250,delay:300})),_(nt,ht)};ce(St,nt=>{Kn.modelName&&nt(Ze)},!0)}_(ct,Ct)};ce(Ge,ct=>{Kn.error&&!Kn.modelName?ct(ot):ct(lt,!1)},!0)}_(Ke,ze)};ce(We,Ke=>{g(S)?Ke(Qe):Ke(mt,!1)},!0)}_(Ie,Ve)};ce(_e,Ie=>{g(v)?Ie(me,!1):Ie(W)})}var He=ae(_e,2);ve(He,()=>tc,(Ie,Ve)=>{Ve(Ie,{get open(){return g(u)},set open(We){O(u,We,!0)},children:(We,Qe)=>{var mt=J(),Ke=F(mt);ve(Ke,()=>aj,(ze,Ge)=>{Ge(ze,{children:(ot,lt)=>{var ct=Aj(),Ct=F(ct);ve(Ct,()=>K7,(Ze,nt)=>{nt(Ze,{})});var St=ae(Ct,2);ve(St,()=>Zl,(Ze,nt)=>{nt(Ze,{class:"max-w-md",children:(ht,kt)=>{var Se=kj(),Fe=F(Se);ve(Fe,()=>Ql,(wt,Et)=>{Et(wt,{children:(hr,tt)=>{var Ut=vj(),ur=F(Ut);ve(ur,()=>Yl,(le,Be)=>{Be(le,{children:(et,zt)=>{Rt();var wr=sr("File Upload Error");_(et,wr)},$$slots:{default:!0}})});var Ur=ae(ur,2);ve(Ur,()=>ec,(le,Be)=>{Be(le,{class:"text-sm text-muted-foreground",children:(et,zt)=>{Rt();var wr=sr("Some files cannot be uploaded with the current model.");_(et,wr)},$$slots:{default:!0}})}),_(hr,Ut)},$$slots:{default:!0}})});var it=ae(Fe,2),yt=te(it);{var $t=wt=>{var Et=wj(),hr=ae(te(Et),2);_n(hr,21,()=>g(f).generallyUnsupported,tt=>tt.name,(tt,Ut)=>{var ur=yj(),Ur=te(ur),le=te(Ur,!0);Q(Ur),Rt(2),Q(ur),qe(()=>at(le,g(Ut).name)),_(tt,ur)}),Q(hr),Q(Et),_(wt,Et)};ce(yt,wt=>{g(f).generallyUnsupported.length>0&&wt($t)})}var kr=ae(yt,2);{var Ar=wt=>{var Et=Sj(),hr=ae(te(Et),2);_n(hr,21,()=>g(f).modalityUnsupported,tt=>tt.name,(tt,Ut)=>{var ur=xj(),Ur=te(ur),le=te(Ur,!0);Q(Ur);var Be=ae(Ur,2),et=te(Be,!0);Q(Be),Q(ur),qe(()=>{at(le,g(Ut).name),at(et,g(f).modalityReasons[g(Ut).name]||"Not supported by current model")}),_(tt,ur)}),Q(hr),Q(Et),_(wt,Et)};ce(kr,wt=>{g(f).modalityUnsupported.length>0&&wt(Ar)})}var mr=ae(kr,2),sn=ae(te(mr),2),Zr=te(sn,!0);Q(sn),Q(mr),Q(it);var Je=ae(it,2);ve(Je,()=>Jl,(wt,Et)=>{Et(wt,{children:(hr,tt)=>{var Ut=J(),ur=F(Ut);ve(ur,()=>pu,(Ur,le)=>{le(Ur,{onclick:()=>O(u,!1),children:(Be,et)=>{Rt();var zt=sr("Got it");_(Be,zt)},$$slots:{default:!0}})}),_(hr,Ut)},$$slots:{default:!0}})}),qe(wt=>at(Zr,wt),[()=>g(f).supportedTypes.join(", ")]),_(ht,Se)},$$slots:{default:!0}})}),_(ot,ct)},$$slots:{default:!0}})}),_(We,mt)},$$slots:{default:!0}})});var Xe=ae(He,2);b5(Xe,{title:"Delete Conversation",description:"Are you sure you want to delete this conversation? This action cannot be undone and will permanently remove all messages in this conversation.",confirmText:"Delete",cancelText:"Cancel",variant:"destructive",get icon(){return Eh},onConfirm:C,onCancel:()=>O(p,!1),get open(){return g(p)},set open(Ie){O(p,Ie,!0)}});var Le=ae(Xe,2);GG(Le,{get emptyFiles(){return g(y)},onOpenChange:Ie=>{Ie||O(y,[],!0)},get open(){return g(m)},set open(Ie){O(m,Ie,!0)}});var bt=ae(Le,2);{let Ie=j(()=>g(x)?.message??""),Ve=j(()=>!!g(x)),We=j(()=>g(x)?.type??"server");UG(bt,{get message(){return g(Ie)},onOpenChange:R,get open(){return g(Ve)},get type(){return g(We)}})}_(r,X),pe()}var Cj=ee("<input/>"),Ej=ee("<input/>");function td(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"value",15),i=L(e,"files",15),a=De(e,["$$slots","$$events","$$legacy","ref","value","type","files","class"]);var s=J(),o=F(s);{var l=u=>{var h=Cj();a0(h),Lt(h,d=>({"data-slot":"input",class:d,type:"file",...a}),[()=>Qt("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)]),Tr(h,d=>t(d),()=>t()),G_(h,i),Nl(h,n),_(u,h)},c=u=>{var h=Ej();a0(h),Lt(h,d=>({"data-slot":"input",class:d,type:e.type,...a}),[()=>Qt("flex h-9 w-full min-w-0 rounded-md border border-input bg-background px-3 py-1 text-base shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)]),Tr(h,d=>t(d),()=>t()),Nl(h,n),_(u,h)};ce(o,u=>{e.type==="file"?u(l):u(c,!1)})}_(r,s),pe()}var Tj=ee("<!> <!>",1);function a8(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"orientation",3,"vertical"),i=De(e,["$$slots","$$events","$$legacy","ref","class","orientation","children"]);var a=J(),s=F(a);{let o=j(()=>Qt("flex touch-none p-px transition-colors select-none",n()==="vertical"&&"h-full w-2.5 border-l border-l-transparent",n()==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e.class));ve(s,()=>kN,(l,c)=>{c(l,$e({"data-slot":"scroll-area-scrollbar",get orientation(){return n()},get class(){return g(o)}},()=>i,{get ref(){return t()},set ref(u){t(u)},children:(u,h)=>{var d=Tj(),f=F(d);Te(f,()=>e.children??Re);var p=ae(f,2);ve(p,()=>CN,(m,y)=>{y(m,{"data-slot":"scroll-area-thumb",class:"relative flex-1 rounded-full bg-border"})}),_(u,d)},$$slots:{default:!0}}))})}_(r,a),pe()}var Ij=ee("<!> <!> <!> <!>",1);function pb(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"orientation",3,"vertical"),i=L(e,"scrollbarXClasses",3,""),a=L(e,"scrollbarYClasses",3,""),s=De(e,["$$slots","$$events","$$legacy","ref","class","orientation","scrollbarXClasses","scrollbarYClasses","children"]);var o=J(),l=F(o);{let c=j(()=>Qt("relative",e.class));ve(l,()=>gN,(u,h)=>{h(u,$e({"data-slot":"scroll-area",get class(){return g(c)}},()=>s,{get ref(){return t()},set ref(d){t(d)},children:(d,f)=>{var p=Ij(),m=F(p);ve(m,()=>mN,(C,k)=>{k(C,{"data-slot":"scroll-area-viewport",class:"size-full rounded-[inherit] ring-ring/10 outline-ring/50 transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 dark:ring-ring/20 dark:outline-ring/40",children:(I,R)=>{var U=J(),D=F(U);Te(D,()=>e.children??Re),_(I,U)},$$slots:{default:!0}})});var y=ae(m,2);{var v=C=>{a8(C,{orientation:"vertical",get class(){return a()}})};ce(y,C=>{(n()==="vertical"||n()==="both")&&C(v)})}var x=ae(y,2);{var S=C=>{a8(C,{orientation:"horizontal",get class(){return i()}})};ce(x,C=>{(n()==="horizontal"||n()==="both")&&C(S)})}var A=ae(x,2);ve(A,()=>IN,(C,k)=>{k(C,{})}),_(d,p)},$$slots:{default:!0}}))})}_(r,o),pe()}var Mj=ee("<!> <!>",1),Oj=(r,e)=>O(e,""),Nj=ee('<button class="absolute top-1/2 right-3 -translate-y-1/2 text-muted-foreground hover:text-foreground" type="button"><!></button>'),Rj=ee('<tr><td colspan="3" class="p-8 text-center text-sm text-muted-foreground"><!></td></tr>'),Pj=(r,e,t)=>e(g(t).id,r.shiftKey),Fj=ee('<tr class="cursor-pointer border-b transition-colors hover:bg-muted/50"><td class="p-3"><!></td><td class="p-3 text-sm"><div class="max-w-[17rem] truncate"> </div></td><td class="p-3 text-sm text-muted-foreground"> </td></tr>'),Dj=ee('<table class="w-full"><thead class="sticky top-0 z-10 bg-muted"><tr class="border-b"><th class="w-12 p-3 text-left"><!></th><th class="p-3 text-left text-sm font-medium">Conversation Name</th><th class="w-32 p-3 text-left text-sm font-medium">Messages</th></tr></thead><tbody><!></tbody></table>'),Lj=ee("<!> <!>",1),Bj=ee('<!> <div class="space-y-4"><div class="relative"><!> <!> <!></div> <div class="flex items-center justify-between text-sm text-muted-foreground"><span> <!></span></div> <div class="overflow-hidden rounded-md border"><!></div></div> <!>',1),Uj=ee("<!> <!>",1);function s8(r,e){ge(e,!0);let t=L(e,"messageCountMap",19,()=>new Map),n=L(e,"open",15,!1),i=oe(""),a=oe(new Ks(e.conversations.map(v=>v.id))),s=oe(null),o=j(()=>e.conversations.filter(v=>(v.name||"Untitled conversation").toLowerCase().includes(g(i).toLowerCase()))),l=j(()=>g(o).length>0&&g(o).every(v=>g(a).has(v.id))),c=j(()=>g(o).some(v=>g(a).has(v.id))&&!g(l));function u(v,x=!1){const S=new Ks(g(a));if(x&&g(s)!==null){const A=g(o).findIndex(k=>k.id===g(s)),C=g(o).findIndex(k=>k.id===v);if(A!==-1&&C!==-1){const k=Math.min(A,C),I=Math.max(A,C),R=!S.has(v);for(let U=k;U<=I;U++)R?S.add(g(o)[U].id):S.delete(g(o)[U].id);O(a,S);return}}S.has(v)?S.delete(v):S.add(v),O(a,S),O(s,v,!0)}function h(){if(g(l)){const v=new Ks(g(a));g(o).forEach(x=>v.delete(x.id)),O(a,v)}else{const v=new Ks(g(a));g(o).forEach(x=>v.add(x.id)),O(a,v)}}function d(){const v=e.conversations.filter(x=>g(a).has(x.id));e.onConfirm(v)}function f(){O(a,new Ks(e.conversations.map(v=>v.id))),O(i,""),O(s,null),e.onCancel()}let p=oe(!1);Ft(()=>{n()&&!g(p)?(O(a,new Ks(e.conversations.map(v=>v.id))),O(i,""),O(s,null)):!n()&&g(p)&&e.onCancel(),O(p,n(),!0)});var m=J(),y=F(m);ve(y,()=>s2,(v,x)=>{x(v,{get open(){return n()},set open(S){n(S)},children:(S,A)=>{var C=J(),k=F(C);ve(k,()=>I6,(I,R)=>{R(I,{children:(U,D)=>{var $=Uj(),H=F($);ve(H,()=>T6,(z,Z)=>{Z(z,{class:"z-[1000000]"})});var V=ae(H,2);ve(V,()=>a2,(z,Z)=>{Z(z,{class:"z-[1000001] max-w-2xl",children:(q,re)=>{var X=Bj(),ie=F(X);ve(ie,()=>E6,(Ke,ze)=>{ze(Ke,{children:(Ge,ot)=>{var lt=Mj(),ct=F(lt);ve(ct,()=>Q0,(St,Ze)=>{Ze(St,{children:(nt,ht)=>{Rt();var kt=sr();qe(()=>at(kt,`Select Conversations to ${e.mode==="export"?"Export":"Import"}`)),_(nt,kt)},$$slots:{default:!0}})});var Ct=ae(ct,2);ve(Ct,()=>MR,(St,Ze)=>{Ze(St,{children:(nt,ht)=>{var kt=J(),Se=F(kt);{var Fe=yt=>{var $t=sr(`Choose which conversations you want to export. Selected conversations will be downloaded\r
as a JSON file.`);_(yt,$t)},it=yt=>{var $t=sr(`Choose which conversations you want to import. Selected conversations will be merged\r
with your existing conversations.`);_(yt,$t)};ce(Se,yt=>{e.mode==="export"?yt(Fe):yt(it,!1)})}_(nt,kt)},$$slots:{default:!0}})}),_(Ge,lt)},$$slots:{default:!0}})});var P=ae(ie,2),be=te(P),_e=te(be);u2(_e,{class:"absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-muted-foreground"});var W=ae(_e,2);td(W,{placeholder:"Search conversations...",class:"pr-9 pl-9",get value(){return g(i)},set value(Ke){O(i,Ke,!0)}});var me=ae(W,2);{var He=Ke=>{var ze=Nj();ze.__click=[Oj,i];var Ge=te(ze);eo(Ge,{class:"h-4 w-4"}),Q(ze),_(Ke,ze)};ce(me,Ke=>{g(i)&&Ke(He)})}Q(be);var Xe=ae(be,2),Le=te(Xe),bt=te(Le),Ie=ae(bt);{var Ve=Ke=>{var ze=sr();qe(()=>at(ze,`(${g(o).length??""} shown)`)),_(Ke,ze)};ce(Ie,Ke=>{g(i)&&Ke(Ve)})}Q(Le),Q(Xe);var We=ae(Xe,2),Qe=te(We);pb(Qe,{class:"h-[400px]",children:(Ke,ze)=>{var Ge=Dj(),ot=te(Ge),lt=te(ot),ct=te(lt),Ct=te(ct);Ff(Ct,{get checked(){return g(l)},get indeterminate(){return g(c)},onCheckedChange:h}),Q(ct),Rt(2),Q(lt),Q(ot);var St=ae(ot),Ze=te(St);{var nt=kt=>{var Se=Rj(),Fe=te(Se),it=te(Fe);{var yt=kr=>{var Ar=sr();qe(()=>at(Ar,`No conversations found matching "${g(i)??""}"`)),_(kr,Ar)},$t=kr=>{var Ar=sr("No conversations available");_(kr,Ar)};ce(it,kr=>{g(i)?kr(yt):kr($t,!1)})}Q(Fe),Q(Se),_(kt,Se)},ht=kt=>{var Se=J(),Fe=F(Se);_n(Fe,17,()=>g(o),it=>it.id,(it,yt)=>{var $t=Fj();$t.__click=[Pj,u,yt];var kr=te($t),Ar=te(kr);{let Et=j(()=>g(a).has(g(yt).id));Ff(Ar,{get checked(){return g(Et)},onclick:hr=>{hr.preventDefault(),hr.stopPropagation(),u(g(yt).id,hr.shiftKey)}})}Q(kr);var mr=ae(kr),sn=te(mr),Zr=te(sn,!0);Q(sn),Q(mr);var Je=ae(mr),wt=te(Je,!0);Q(Je),Q($t),qe(Et=>{Jt(sn,"title",g(yt).name||"Untitled conversation"),at(Zr,g(yt).name||"Untitled conversation"),at(wt,Et)},[()=>t().get(g(yt).id)??0]),_(it,$t)}),_(kt,Se)};ce(Ze,kt=>{g(o).length===0?kt(nt):kt(ht,!1)})}Q(St),Q(Ge),_(Ke,Ge)},$$slots:{default:!0}}),Q(We),Q(P);var mt=ae(P,2);ve(mt,()=>kR,(Ke,ze)=>{ze(Ke,{children:(Ge,ot)=>{var lt=Lj(),ct=F(lt);Qr(ct,{variant:"outline",onclick:f,children:(St,Ze)=>{Rt();var nt=sr("Cancel");_(St,nt)},$$slots:{default:!0}});var Ct=ae(ct,2);{let St=j(()=>g(a).size===0);Qr(Ct,{onclick:d,get disabled(){return g(St)},children:(Ze,nt)=>{Rt();var ht=sr();qe(()=>at(ht,`${e.mode==="export"?"Export":"Import"} (${g(a).size??""})`)),_(Ze,ht)},$$slots:{default:!0}})}_(Ge,lt)},$$slots:{default:!0}})}),qe(()=>at(bt,`${g(a).size??""} of ${e.conversations.length??""} selected `)),_(q,X)},$$slots:{default:!0}})}),_(U,$)},$$slots:{default:!0}})}),_(S,C)},$$slots:{default:!0}})}),_(r,m),pe()}wi(["click"]);function o8(r){const e=new Map;for(const t of r)e.set(t.conv.id,t.messages.length);return e}var zj=ee("<!> Export conversations",1),jj=ee('<li class="truncate"> </li>'),Hj=ee('<li class="italic"> </li>'),qj=ee('<div class="mt-4 grid overflow-x-auto rounded-lg border border-border/50 bg-muted/30 p-4"><h5 class="mb-2 text-sm font-medium"> </h5> <ul class="space-y-1 text-sm text-muted-foreground"><!> <!></ul></div>'),Gj=ee("<!> Import conversations",1),Wj=ee('<li class="truncate"> </li>'),Vj=ee('<li class="italic"> </li>'),Xj=ee('<div class="mt-4 grid overflow-x-auto rounded-lg border border-border/50 bg-muted/30 p-4"><h5 class="mb-2 text-sm font-medium"> </h5> <ul class="space-y-1 text-sm text-muted-foreground"><!> <!></ul></div>'),$j=ee(`<div class="space-y-6"><div class="space-y-4"><div class="grid"><h4 class="mb-2 text-sm font-medium">Export Conversations</h4> <p class="mb-4 text-sm text-muted-foreground">Download all your conversations as a JSON file. This includes all messages, attachments, and
conversation history.</p> <!> <!></div> <div class="grid border-t border-border/30 pt-4"><h4 class="mb-2 text-sm font-medium">Import Conversations</h4> <p class="mb-4 text-sm text-muted-foreground">Import one or more conversations from a previously exported JSON file. This will merge with
your existing conversations.</p> <!> <!></div></div></div> <!> <!>`,1);function Kj(r,e){ge(e,!0);let t=oe(Mr([])),n=oe(Mr([])),i=oe(!1),a=oe(!1),s=oe(!1),o=oe(!1),l=oe(Mr([])),c=oe(Mr(new Map)),u=oe(Mr([]));async function h(){try{const H=await ir.getAllConversations();if(H.length===0){alert("No conversations to export");return}const V=await Promise.all(H.map(async z=>{const Z=await ir.getConversationMessages(z.id);return{conv:z,messages:Z}}));O(c,o8(V),!0),O(l,H,!0),O(s,!0)}catch(H){console.error("Failed to load conversations:",H),alert("Failed to load conversations")}}async function d(H){try{const V=await Promise.all(H.map(async re=>{const X=await ir.getConversationMessages(re.id);return{conv:zd(re),messages:zd(X)}})),z=new Blob([JSON.stringify(V,null,2)],{type:"application/json"}),Z=URL.createObjectURL(z),q=document.createElement("a");q.href=Z,q.download=`conversations_${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(q),q.click(),document.body.removeChild(q),URL.revokeObjectURL(Z),O(t,H,!0),O(i,!0),O(a,!1),O(s,!1)}catch(V){console.error("Export failed:",V),alert("Failed to export conversations")}}async function f(){try{const H=document.createElement("input");H.type="file",H.accept=".json",H.onchange=async V=>{const z=V.target?.files?.[0];if(z)try{const Z=await z.text(),q=JSON.parse(Z);let re;if(Array.isArray(q))re=q;else if(q&&typeof q=="object"&&"conv"in q&&"messages"in q)re=[q];else throw new Error("Invalid file format: expected array of conversations or single conversation object");O(u,re,!0),O(l,re.map(X=>X.conv),!0),O(c,o8(re),!0),O(o,!0)}catch(Z){const q=Z instanceof Error?Z.message:"Unknown error";console.error("Failed to parse file:",Z),alert(`Failed to parse file: ${q}`)}},H.click()}catch(H){console.error("Import failed:",H),alert("Failed to import conversations")}}async function p(H){try{const V=new Set(H.map(Z=>Z.id)),z=zd(g(u)).filter(Z=>V.has(Z.conv.id));await ir.importConversations(z),await fr.loadConversations(),O(n,H,!0),O(a,!0),O(i,!1),O(o,!1)}catch(V){console.error("Import failed:",V),alert("Failed to import conversations. Please check the file format.")}}var m=$j(),y=F(m),v=te(y),x=te(v),S=ae(te(x),4);Qr(S,{class:"w-full justify-start justify-self-start md:w-auto",onclick:h,variant:"outline",children:(H,V)=>{var z=zj(),Z=F(z);P6(Z,{class:"mr-2 h-4 w-4"}),Rt(),_(H,z)},$$slots:{default:!0}});var A=ae(S,2);{var C=H=>{var V=qj(),z=te(V),Z=te(z);Q(z);var q=ae(z,2),re=te(q);_n(re,17,()=>g(t).slice(0,10),P=>P.id,(P,be)=>{var _e=jj(),W=te(_e);Q(_e),qe(()=>at(W,`• ${g(be).name||"Untitled conversation"}`)),_(P,_e)});var X=ae(re,2);{var ie=P=>{var be=Hj(),_e=te(be);Q(be),qe(()=>at(_e,`... and ${g(t).length-10} more`)),_(P,be)};ce(X,P=>{g(t).length>10&&P(ie)})}Q(q),Q(V),qe(()=>at(Z,`Exported ${g(t).length??""} conversation${g(t).length===1?"":"s"}`)),_(H,V)};ce(A,H=>{g(i)&&g(t).length>0&&H(C)})}Q(x);var k=ae(x,2),I=ae(te(k),4);Qr(I,{class:"w-full justify-start justify-self-start md:w-auto",onclick:f,variant:"outline",children:(H,V)=>{var z=Gj(),Z=F(z);H6(Z,{class:"mr-2 h-4 w-4"}),Rt(),_(H,z)},$$slots:{default:!0}});var R=ae(I,2);{var U=H=>{var V=Xj(),z=te(V),Z=te(z);Q(z);var q=ae(z,2),re=te(q);_n(re,17,()=>g(n).slice(0,10),P=>P.id,(P,be)=>{var _e=Wj(),W=te(_e);Q(_e),qe(()=>at(W,`• ${g(be).name||"Untitled conversation"}`)),_(P,_e)});var X=ae(re,2);{var ie=P=>{var be=Vj(),_e=te(be);Q(be),qe(()=>at(_e,`... and ${g(n).length-10} more`)),_(P,be)};ce(X,P=>{g(n).length>10&&P(ie)})}Q(q),Q(V),qe(()=>at(Z,`Imported ${g(n).length??""} conversation${g(n).length===1?"":"s"}`)),_(H,V)};ce(R,H=>{g(a)&&g(n).length>0&&H(U)})}Q(k),Q(v),Q(y);var D=ae(y,2);s8(D,{get conversations(){return g(l)},get messageCountMap(){return g(c)},mode:"export",onCancel:()=>O(s,!1),onConfirm:d,get open(){return g(s)},set open(H){O(s,H,!0)}});var $=ae(D,2);s8($,{get conversations(){return g(l)},get messageCountMap(){return g(c)},mode:"import",onCancel:()=>O(o,!1),onConfirm:p,get open(){return g(o)},set open(H){O(o,H,!0)}}),_(r,m),pe()}const l8=typeof window<"u"?window:void 0;function Yj(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}let Jj=class{#e;#t;constructor(e={}){const{window:t=l8,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Cl(i=>{const a=$r(t,"focusin",i),s=$r(t,"focusout",i);return()=>{a(),s()}}))}get current(){return this.#t?.(),this.#e?Yj(this.#e):null}};new Jj;function Qj(r,e){switch(r){case"post":Ft(e);break;case"pre":yi(e);break}}function c8(r,e,t,n={}){const{lazy:i=!1}=n;let a=!i,s=Array.isArray(r)?[]:void 0;Qj(e,()=>{const o=Array.isArray(r)?r.map(c=>c()):r();if(!a){a=!0,s=o;return}const l=dn(()=>t(o,s));return s=o,l})}function mb(r,e,t){c8(r,"post",e,t)}function Zj(r,e,t){c8(r,"pre",e,t)}mb.pre=Zj;function eH(r,e){switch(r){case"local":return e.localStorage;case"session":return e.sessionStorage}}class u8{#e;#t;#r;#n;#a;#i=oe(0);constructor(e,t,n={}){const{storage:i="local",serializer:a={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:s=!0,window:o=l8}=n;if(this.#e=t,this.#t=e,this.#r=a,o===void 0)return;const l=eH(i,o);this.#n=l;const c=l.getItem(e);c!==null?this.#e=this.#o(c):this.#l(t),s&&i==="local"&&(this.#a=Cl(()=>$r(o,"storage",this.#s)))}get current(){this.#a?.(),g(this.#i);const e=this.#o(this.#n?.getItem(this.#t))??this.#e,t=new WeakMap,n=i=>{if(i===null||i?.constructor.name==="Date"||typeof i!="object")return i;let a=t.get(i);return a||(a=new Proxy(i,{get:(s,o)=>(g(this.#i),n(Reflect.get(s,o))),set:(s,o,l)=>(O(this.#i,g(this.#i)+1),Reflect.set(s,o,l),this.#l(e),!0)}),t.set(i,a)),a};return n(e)}set current(e){this.#l(e),O(this.#i,g(this.#i)+1)}#s=e=>{e.key!==this.#t||e.newValue===null||(this.#e=this.#o(e.newValue),O(this.#i,g(this.#i)+1))};#o(e){try{return this.#r.deserialize(e)}catch(t){console.error(`Error when parsing "${e}" from persisted store "${this.#t}"`,t);return}}#l(e){try{e!=null&&this.#n?.setItem(this.#t,this.#r.serialize(e))}catch(t){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,t)}}}function h8(r){return r.filter(e=>e.length>0)}const d8={getItem:r=>null,setItem:(r,e)=>{}},rd=typeof document<"u";function tH(r){return typeof r=="function"}function rH(r){return r!==null&&typeof r=="object"}const nd=Symbol("box"),bb=Symbol("is-writable");function nH(r){return rH(r)&&nd in r}function iH(r){return Yn.isBox(r)&&bb in r}function Yn(r){let e=oe(Mr(r));return{[nd]:!0,[bb]:!0,get current(){return g(e)},set current(t){O(e,t,!0)}}}function aH(r,e){const t=j(r);return e?{[nd]:!0,[bb]:!0,get current(){return g(t)},set current(n){e(n)}}:{[nd]:!0,get current(){return r()}}}function sH(r){return Yn.isBox(r)?r:tH(r)?Yn.with(r):Yn(r)}function oH(r){return Object.entries(r).reduce((e,[t,n])=>Yn.isBox(n)?(Yn.isWritableBox(n)?Object.defineProperty(e,t,{get(){return n.current},set(i){n.current=i}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function lH(r){return Yn.isWritableBox(r)?{[nd]:!0,get current(){return r.current}}:r}Yn.from=sH,Yn.with=aH,Yn.flatten=oH,Yn.readonly=lH,Yn.isBox=nH,Yn.isWritableBox=iH;function cH(r,e){const t=RegExp(r,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(t)?n.replace(t,e):n}}const uH=cH(/[A-Z]/,r=>`-${r.toLowerCase()}`);function hH(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError(`expected an argument of type object, but got ${typeof r}`);return Object.keys(r).map(e=>`${uH(e)}: ${r[e]};`).join(`
`)}function dH(r={}){return hH(r).replace(`
`," ")}dH({position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"});const fH=typeof window<"u"?window:void 0;function gH(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class pH{#e;#t;constructor(e={}){const{window:t=fH,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Cl(i=>{const a=$r(t,"focusin",i),s=$r(t,"focusout",i);return()=>{a(),s()}}))}get current(){return this.#t?.(),this.#e?gH(this.#e):null}}new pH;const rc=Yn("mode-watcher-mode"),nc=Yn("mode-watcher-theme"),mH=["dark","light","system"];function vb(r){return typeof r!="string"?!1:mH.includes(r)}class bH{#e="system";#t=rd?localStorage:d8;#r=this.#t.getItem(rc.current);#n=vb(this.#r)?this.#r:this.#e;#a=oe(Mr(this.#i()));#i(e=this.#n){return new u8(rc.current,e,{serializer:{serialize:t=>t,deserialize:t=>vb(t)?t:this.#e}})}constructor(){qu(()=>mb.pre(()=>rc.current,(e,t)=>{const n=g(this.#a).current;O(this.#a,this.#i(n),!0),t&&localStorage.removeItem(t)}))}get current(){return g(this.#a).current}set current(e){g(this.#a).current=e}}class vH{#e=void 0;#t=!0;#r=oe(Mr(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new Zv("prefers-color-scheme: light"):{current:!1};query(){rd&&O(this.#r,this.#n.current?"light":"dark",!0)}tracking(e){this.#t=e}constructor(){qu(()=>{yi(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return g(this.#r)}}const yb=new bH,wb=new vH;class yH{#e=rd?localStorage:d8;#t=this.#e.getItem(nc.current);#r=this.#t===null||this.#t===void 0?"":this.#t;#n=oe(Mr(this.#a()));#a(e=this.#r){return new u8(nc.current,e,{serializer:{serialize:t=>typeof t!="string"?"":t,deserialize:t=>t}})}constructor(){qu(()=>mb.pre(()=>nc.current,(e,t)=>{const n=g(this.#n).current;O(this.#n,this.#a(n),!0),t&&localStorage.removeItem(t)}))}get current(){return g(this.#n).current}set current(e){g(this.#n).current=e}}const Df=new yH;let f8,g8,p8=!1,id=null;function wH(){return id||(id=document.createElement("style"),id.appendChild(document.createTextNode(`* {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}`)),id)}function m8(r,e=!1){if(typeof document>"u")return;if(!p8){p8=!0,r();return}if(typeof window<"u"&&window.__vitest_worker__){r();return}clearTimeout(f8),clearTimeout(g8);const n=wH(),i=()=>document.head.appendChild(n),a=()=>{n.parentNode&&document.head.removeChild(n)};function s(){r(),window.requestAnimationFrame(a)}if(typeof window.requestAnimationFrame<"u"){i(),e?s():window.requestAnimationFrame(()=>{s()});return}i(),f8=window.setTimeout(()=>{r(),g8=window.setTimeout(a,16)},16)}const tl=Yn(void 0),Lf=Yn(!0),Bf=Yn(!1),xb=Yn([]),Sb=Yn([]);function xH(){const r=j(()=>{if(!rd)return;const e=yb.current==="system"?wb.current:yb.current,t=h8(xb.current),n=h8(Sb.current);function i(){const a=document.documentElement,s=document.querySelector('meta[name="theme-color"]');e==="light"?(t.length&&a.classList.remove(...t),n.length&&a.classList.add(...n),a.style.colorScheme="light",s&&tl.current&&s.setAttribute("content",tl.current.light)):(n.length&&a.classList.remove(...n),t.length&&a.classList.add(...t),a.style.colorScheme="dark",s&&tl.current&&s.setAttribute("content",tl.current.dark))}return Lf.current?m8(i,Bf.current):i(),e});return{get current(){return g(r)}}}function SH(){const r=j(()=>{if(Df.current,!rd)return;function e(){document.documentElement.setAttribute("data-theme",Df.current)}return Lf.current?m8(e,dn(()=>Bf.current)):e(),Df.current});return{get current(){return g(r)}}}const b8=xH(),kH=SH();function Uf(r){yb.current=r}function AH(r){Df.current=r}function gie(r){return r}function _H({defaultMode:r="system",themeColors:e,darkClassNames:t=["dark"],lightClassNames:n=[],defaultTheme:i="",modeStorageKey:a="mode-watcher-mode",themeStorageKey:s="mode-watcher-theme"}){const o=document.documentElement,l=localStorage.getItem(a)??r,c=localStorage.getItem(s)??i,u=l==="light"||l==="system"&&window.matchMedia("(prefers-color-scheme: light)").matches;if(u?(t.length&&o.classList.remove(...t.filter(Boolean)),n.length&&o.classList.add(...n.filter(Boolean))):(n.length&&o.classList.remove(...n.filter(Boolean)),t.length&&o.classList.add(...t.filter(Boolean))),o.style.colorScheme=u?"light":"dark",e){const h=document.querySelector('meta[name="theme-color"]');h&&h.setAttribute("content",l==="light"?e.light:e.dark)}c&&(o.setAttribute("data-theme",c),localStorage.setItem(s,c)),localStorage.setItem(a,l)}var CH=ee('<meta name="theme-color"/>');function EH(r,e){ge(e,!0);var t=J(),n=F(t);{var i=a=>{var s=CH();qe(()=>Jt(s,"content",e.themeColors.dark)),_(a,s)};ce(n,a=>{e.themeColors&&a(i)})}_(r,t),pe()}var TH=ee('<meta name="theme-color"/>'),IH=ee("<!> <!>",1);function MH(r,e){ge(e,!0);let t=L(e,"trueNonce",3,"");t0(n=>{var i=IH(),a=F(i);{var s=l=>{var c=TH();qe(()=>Jt(c,"content",e.themeColors.dark)),_(l,c)};ce(a,l=>{e.themeColors&&l(s)})}var o=ae(a,2);z9(o,()=>`<script${t()?` nonce=${t()}`:""}>(`+_H.toString()+")("+JSON.stringify(e.initConfig)+");<\/script>"),_(n,i)}),pe()}function OH(r,e){ge(e,!0);let t=L(e,"track",3,!0),n=L(e,"defaultMode",3,"system"),i=L(e,"disableTransitions",3,!0),a=L(e,"darkClassNames",19,()=>["dark"]),s=L(e,"lightClassNames",19,()=>[]),o=L(e,"defaultTheme",3,""),l=L(e,"nonce",3,""),c=L(e,"themeStorageKey",3,"mode-watcher-theme"),u=L(e,"modeStorageKey",3,"mode-watcher-mode"),h=L(e,"disableHeadScriptInjection",3,!1),d=L(e,"synchronousModeChanges",3,!1);rc.current=u(),nc.current=c(),xb.current=a(),Sb.current=s(),Lf.current=i(),tl.current=e.themeColors,Bf.current=d(),yi(()=>{Bf.current=d()}),yi(()=>{Lf.current=i()}),yi(()=>{tl.current=e.themeColors}),yi(()=>{xb.current=a()}),yi(()=>{Sb.current=s()}),yi(()=>{rc.current=u()}),yi(()=>{nc.current=c()}),yi(()=>{b8.current,rc.current,nc.current,kH.current}),Si(()=>{wb.tracking(t()),wb.query();const S=localStorage.getItem(rc.current);Uf(vb(S)?S:n());const A=localStorage.getItem(nc.current);AH(A||o())});const f={defaultMode:n(),themeColors:e.themeColors,darkClassNames:a(),lightClassNames:s(),defaultTheme:o(),modeStorageKey:u(),themeStorageKey:c()},p=j(()=>typeof window>"u"?l():"");var m=J(),y=F(m);{var v=S=>{EH(S,{get themeColors(){return tl.current}})},x=S=>{MH(S,{get trueNonce(){return g(p)},get initConfig(){return f},get themeColors(){return tl.current}})};ce(y,S=>{h()?S(v):S(x,!1)})}_(r,m),pe()}function NH(r,e){g(e)&&g(e).scrollBy({left:-250,behavior:"smooth"})}function RH(r,e){g(e)&&g(e).scrollBy({left:250,behavior:"smooth"})}var PH=(r,e,t)=>O(e,g(t).title,!0),FH=ee('<button><!> <span class="ml-2"> </span></button>'),DH=(r,e,t,n)=>{O(e,g(t).title,!0),n(r.currentTarget)},LH=ee("<button><!> <span> </span></button>"),BH=ee('<div class="space-y-6"><!></div>'),UH=ee(`<div class="space-y-6 p-4 md:p-6"><div class="grid"><div class="mb-6 flex hidden items-center gap-2 border-b border-border/30 pb-6 md:flex"><!> <h3 class="text-lg font-semibold"> </h3></div> <!></div> <div class="mt-8 border-t pt-6"><p class="text-xs text-muted-foreground">Settings are saved in browser's localStorage</p></div></div>`),zH=ee('<div class="flex flex-1 flex-col overflow-hidden md:flex-row"><div class="hidden w-64 border-r border-border/30 p-6 md:block"><nav class="space-y-1 py-2"><!> <!></nav></div> <div class="flex flex-col md:hidden"><div class="border-b border-border/30 py-4"><!> <div class="relative flex items-center" style="scroll-padding: 1rem;"><button aria-label="Scroll left"><!></button> <div class="scrollbar-hide overflow-x-auto py-2"><div class="flex min-w-max gap-2"></div></div> <button aria-label="Scroll right"><!></button></div></div></div> <!></div> <!>',1);function jH(r,e){ge(e,!0);let t=L(e,"open",3,!1);const n=[{title:"General",icon:z6,fields:[{key:"apiKey",label:"API Key",type:"input"},{key:"systemMessage",label:"System Message (will be disabled if left empty)",type:"textarea"},{key:"theme",label:"Theme",type:"select",options:[{value:"system",label:"System",icon:GR},{value:"light",label:"Light",icon:JR},{value:"dark",label:"Dark",icon:WR}]},{key:"showTokensPerSecond",label:"Show tokens per second",type:"checkbox"},{key:"keepStatsVisible",label:"Keep stats visible after generation",type:"checkbox"},{key:"askForTitleConfirmation",label:"Ask for confirmation before changing conversation title",type:"checkbox"},{key:"pasteLongTextToFileLen",label:"Paste long text to file length",type:"input"},{key:"pdfAsImage",label:"Parse PDF as image",type:"checkbox"},{key:"showModelInfo",label:"Show model information",type:"checkbox"},{key:"renderUserContentAsMarkdown",label:"Render user content as Markdown",type:"checkbox"}]},{title:"Sampling",icon:jR,fields:[{key:"temperature",label:"Temperature",type:"input"},{key:"dynatemp_range",label:"Dynamic temperature range",type:"input"},{key:"dynatemp_exponent",label:"Dynamic temperature exponent",type:"input"},{key:"top_k",label:"Top K",type:"input"},{key:"top_p",label:"Top P",type:"input"},{key:"min_p",label:"Min P",type:"input"},{key:"xtc_probability",label:"XTC probability",type:"input"},{key:"xtc_threshold",label:"XTC threshold",type:"input"},{key:"typ_p",label:"Typical P",type:"input"},{key:"max_tokens",label:"Max tokens",type:"input"},{key:"samplers",label:"Samplers",type:"input"}]},{title:"Penalties",icon:Th,fields:[{key:"repeat_last_n",label:"Repeat last N",type:"input"},{key:"repeat_penalty",label:"Repeat penalty",type:"input"},{key:"presence_penalty",label:"Presence penalty",type:"input"},{key:"frequency_penalty",label:"Frequency penalty",type:"input"},{key:"dry_multiplier",label:"DRY multiplier",type:"input"},{key:"dry_base",label:"DRY base",type:"input"},{key:"dry_allowed_length",label:"DRY allowed length",type:"input"},{key:"dry_penalty_last_n",label:"DRY penalty last N",type:"input"}]},{title:"Reasoning",icon:M6,fields:[{key:"showThoughtInProgress",label:"Show thought in progress",type:"checkbox"}]},{title:"Import/Export",icon:BR,fields:[]},{title:"Developer",icon:LR,fields:[{key:"modelSelectorEnabled",label:"Enable model selector",type:"checkbox"},{key:"disableReasoningFormat",label:"Show raw LLM output",type:"checkbox"},{key:"custom",label:"Custom JSON",type:"textarea"}]}];let i=oe("General"),a=j(()=>n.find(A=>A.title===g(i))||n[0]),s=oe(Mr({...fn()})),o=oe(""),l=oe(!1),c=oe(!1),u=oe(void 0);function h(A){g(s).theme=A,Uf(A)}function d(A,C){g(s)[A]=C}function f(){g(s).theme!==g(o)&&Uf(g(o)),e.onOpenChange?.(!1)}function p(){O(s,{...fn()},!0),Uf(g(s).theme),O(o,g(s).theme,!0)}function m(){if(g(s).custom&&typeof g(s).custom=="string"&&g(s).custom.trim())try{JSON.parse(g(s).custom)}catch(k){alert("Invalid JSON in custom parameters. Please check the format and try again."),console.error(k);return}const A={...g(s)},C=["temperature","top_k","top_p","min_p","max_tokens","pasteLongTextToFileLen","dynatemp_range","dynatemp_exponent","typ_p","xtc_probability","xtc_threshold","repeat_last_n","repeat_penalty","presence_penalty","frequency_penalty","dry_multiplier","dry_base","dry_allowed_length","dry_penalty_last_n"];for(const k of C)if(A[k]!==void 0&&A[k]!==""){const I=Number(A[k]);if(!isNaN(I))A[k]=I;else{alert(`Invalid numeric value for ${k}. Please enter a valid number.`);return}}zL(A),e.onOpenChange?.(!1)}function y(A){if(!g(u))return;const C=g(u).getBoundingClientRect(),k=A.getBoundingClientRect(),I=k.left+k.width/2,R=C.left+C.width/2,U=I-R;g(u).scrollBy({left:U,behavior:"smooth"})}function v(){if(!g(u))return;const{scrollLeft:A,scrollWidth:C,clientWidth:k}=g(u);O(l,A>0),O(c,A<C-k-1)}Ft(()=>{t()&&(O(s,{...fn()},!0),O(o,fn().theme,!0),setTimeout(v,100))}),Ft(()=>{g(u)&&v()});var x=J(),S=F(x);ve(S,()=>s2,(A,C)=>{C(A,{get open(){return t()},onOpenChange:f,children:(k,I)=>{var R=J(),U=F(R);ve(U,()=>a2,(D,$)=>{$(D,{class:`z-999999 flex h-[100dvh] max-h-[100dvh] min-h-[100dvh] flex-col gap-0 rounded-none p-0\r
md:h-[64vh] md:max-h-[64vh] md:min-h-0 md:rounded-lg`,style:"max-width: 48rem;",children:(H,V)=>{var z=zH(),Z=F(z),q=te(Z),re=te(q),X=te(re);ve(X,()=>Q0,(Qe,mt)=>{mt(Qe,{class:"mb-6 flex items-center gap-2",children:(Ke,ze)=>{Rt();var Ge=sr("Settings");_(Ke,Ge)},$$slots:{default:!0}})});var ie=ae(X,2);_n(ie,17,()=>n,Qe=>Qe.title,(Qe,mt)=>{var Ke=FH();Ke.__click=[PH,i,mt];var ze=te(Ke);ve(ze,()=>g(mt).icon,(lt,ct)=>{ct(lt,{class:"h-4 w-4"})});var Ge=ae(ze,2),ot=te(Ge,!0);Q(Ge),Q(Ke),qe(()=>{tr(Ke,1,`flex w-full cursor-pointer items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors hover:bg-accent ${g(i)===g(mt).title?"bg-accent text-accent-foreground":"text-muted-foreground"}`),at(ot,g(mt).title)}),_(Qe,Ke)}),Q(re),Q(q);var P=ae(q,2),be=te(P),_e=te(be);ve(_e,()=>Q0,(Qe,mt)=>{mt(Qe,{class:"mb-6 flex items-center gap-2 px-4",children:(Ke,ze)=>{Rt();var Ge=sr("Settings");_(Ke,Ge)},$$slots:{default:!0}})});var W=ae(_e,2),me=te(W);me.__click=[NH,u];var He=te(me);O6(He,{class:"h-4 w-4"}),Q(me);var Xe=ae(me,2),Le=te(Xe);_n(Le,21,()=>n,Qe=>Qe.title,(Qe,mt)=>{var Ke=LH();Ke.__click=[DH,i,mt,y];var ze=te(Ke);ve(ze,()=>g(mt).icon,(lt,ct)=>{ct(lt,{class:"h-4 w-4 flex-shrink-0"})});var Ge=ae(ze,2),ot=te(Ge,!0);Q(Ge),Q(Ke),qe(()=>{tr(Ke,1,`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm whitespace-nowrap transition-colors first:ml-4 last:mr-4 hover:bg-accent ${g(i)===g(mt).title?"bg-accent text-accent-foreground":"text-muted-foreground"}`),at(ot,g(mt).title)}),_(Qe,Ke)}),Q(Le),Q(Xe),Tr(Xe,Qe=>O(u,Qe),()=>g(u));var bt=ae(Xe,2);bt.__click=[RH,u];var Ie=te(bt);N6(Ie,{class:"h-4 w-4"}),Q(bt),Q(W),Q(be),Q(P);var Ve=ae(P,2);pb(Ve,{class:"max-h-[calc(100dvh-13.5rem)] flex-1 md:max-h-[calc(100vh-13.5rem)]",children:(Qe,mt)=>{var Ke=UH(),ze=te(Ke),Ge=te(ze),ot=te(Ge);ve(ot,()=>g(a).icon,(nt,ht)=>{ht(nt,{class:"h-5 w-5"})});var lt=ae(ot,2),ct=te(lt,!0);Q(lt),Q(Ge);var Ct=ae(Ge,2);{var St=nt=>{Kj(nt,{})},Ze=nt=>{var ht=BH(),kt=te(ht);Aq(kt,{get fields(){return g(a).fields},get localConfig(){return g(s)},onConfigChange:d,onThemeChange:h}),Q(ht),_(nt,ht)};ce(Ct,nt=>{g(a).title==="Import/Export"?nt(St):nt(Ze,!1)})}Q(ze),Rt(2),Q(Ke),qe(()=>at(ct,g(a).title)),_(Qe,Ke)},$$slots:{default:!0}}),Q(Z);var We=ae(Z,2);XH(We,{onReset:p,onSave:m}),qe(()=>{tr(me,1,`absolute left-2 z-10 flex h-6 w-6 items-center justify-center rounded-full bg-muted shadow-md backdrop-blur-sm transition-opacity hover:bg-accent ${g(l)?"opacity-100":"pointer-events-none opacity-0"}`),tr(bt,1,`absolute right-2 z-10 flex h-6 w-6 items-center justify-center rounded-full bg-muted shadow-md backdrop-blur-sm transition-opacity hover:bg-accent ${g(c)?"opacity-100":"pointer-events-none opacity-0"}`)}),Rn("scroll",Xe,v),_(H,z)},$$slots:{default:!0}})}),_(k,R)},$$slots:{default:!0}})}),_(r,x),pe()}wi(["click"]);var HH=ee("<!> Reset to default",1),qH=ee("<!> <!>",1),GH=ee("<!> <!>",1),WH=ee("<!> <!>",1),VH=ee('<div class="flex justify-between border-t border-border/30 p-6"><div class="flex gap-2"><!></div> <!></div> <!>',1);function XH(r,e){ge(e,!0);let t=oe(!1);function n(){O(t,!0)}function i(){jL(),e.onReset?.(),O(t,!1)}function a(){e.onSave?.()}var s=VH(),o=F(s),l=te(o),c=te(l);Qr(c,{variant:"outline",onclick:n,children:(d,f)=>{var p=HH(),m=F(p);c2(m,{class:"h-3 w-3"}),Rt(),_(d,p)},$$slots:{default:!0}}),Q(l);var u=ae(l,2);Qr(u,{onclick:a,children:(d,f)=>{Rt();var p=sr("Save settings");_(d,p)},$$slots:{default:!0}}),Q(o);var h=ae(o,2);ve(h,()=>tc,(d,f)=>{f(d,{get open(){return g(t)},set open(p){O(t,p,!0)},children:(p,m)=>{var y=J(),v=F(y);ve(v,()=>Zl,(x,S)=>{S(x,{children:(A,C)=>{var k=WH(),I=F(k);ve(I,()=>Ql,(U,D)=>{D(U,{children:($,H)=>{var V=qH(),z=F(V);ve(z,()=>Yl,(q,re)=>{re(q,{children:(X,ie)=>{Rt();var P=sr("Reset Settings to Default");_(X,P)},$$slots:{default:!0}})});var Z=ae(z,2);ve(Z,()=>ec,(q,re)=>{re(q,{children:(X,ie)=>{Rt();var P=sr(`Are you sure you want to reset all settings to their default values? This will reset all\r
parameters to the values provided by the server's /props endpoint and remove all your custom\r
configurations.`);_(X,P)},$$slots:{default:!0}})}),_($,V)},$$slots:{default:!0}})});var R=ae(I,2);ve(R,()=>Jl,(U,D)=>{D(U,{children:($,H)=>{var V=GH(),z=F(V);ve(z,()=>gb,(q,re)=>{re(q,{children:(X,ie)=>{Rt();var P=sr("Cancel");_(X,P)},$$slots:{default:!0}})});var Z=ae(z,2);ve(Z,()=>pu,(q,re)=>{re(q,{onclick:i,children:(X,ie)=>{Rt();var P=sr("Reset to Default");_(X,P)},$$slots:{default:!0}})}),_($,V)},$$slots:{default:!0}})}),_(A,k)},$$slots:{default:!0}})}),_(p,y)},$$slots:{default:!0}})}),_(r,s),pe()}var $H=ee('<span class="absolute right-2 flex size-3.5 items-center justify-center"><!></span> <!>',1);function KH(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","value","label","children"]);var i=J(),a=F(i);{const s=(l,c)=>{let u=()=>c?.().selected,h=()=>c?.().highlighted;var d=$H(),f=F(d),p=te(f);{var m=S=>{Z0(S,{class:"size-4"})};ce(p,S=>{u()&&S(m)})}Q(f);var y=ae(f,2);{var v=S=>{var A=J(),C=F(A);Te(C,()=>e.children,()=>({selected:u(),highlighted:h()})),_(S,A)},x=S=>{var A=sr();qe(()=>at(A,e.label||e.value)),_(S,A)};ce(y,S=>{e.children?S(v):S(x,!1)})}_(l,d)};let o=j(()=>Qt("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e.class));ve(a,()=>kO,(l,c)=>{c(l,$e({get value(){return e.value},"data-slot":"select-item",get class(){return g(o)}},()=>n,{get ref(){return t()},set ref(u){t(u)},children:s,$$slots:{default:!0}}))})}_(r,i),pe()}function YH(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("flex cursor-default items-center justify-center py-1",e.class));ve(a,()=>OO,(o,l)=>{l(o,$e({"data-slot":"select-scroll-up-button",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)},children:(c,u)=>{RR(c,{class:"size-4"})},$$slots:{default:!0}}))})}_(r,i),pe()}function JH(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("flex cursor-default items-center justify-center py-1",e.class));ve(a,()=>TO,(o,l)=>{l(o,$e({"data-slot":"select-scroll-down-button",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)},children:(c,u)=>{o2(c,{class:"size-4"})},$$slots:{default:!0}}))})}_(r,i),pe()}var QH=ee("<!> <!> <!>",1);function ZH(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"sideOffset",3,4),i=De(e,["$$slots","$$events","$$legacy","ref","class","sideOffset","portalProps","children"]),a;Si(()=>{const l={passive:!1},c=h=>{if(!t())return;const d=h.target;(!d||!t().contains(d))&&(h.preventDefault(),h.stopPropagation())},u=h=>{if(!t())return;const d=h.target;(!d||!t().contains(d))&&(h.preventDefault(),h.stopPropagation())};return document.addEventListener("wheel",c,l),document.addEventListener("touchmove",u,l),()=>{document.removeEventListener("wheel",c,l),document.removeEventListener("touchmove",u,l)}}),Ft(()=>{const l=t();if(a?.(),!l)return;const c=h=>{h.stopPropagation()},u=h=>{h.stopPropagation()};l.addEventListener("wheel",c),l.addEventListener("touchmove",u),a=()=>{l.removeEventListener("wheel",c),l.removeEventListener("touchmove",u)}}),iv(()=>{a?.()});var s=J(),o=F(s);ve(o,()=>Ll,(l,c)=>{c(l,$e(()=>e.portalProps,{children:(u,h)=>{var d=J(),f=F(d);{let p=j(()=>Qt("relative z-[var(--layer-popover,1000000)] max-h-(--bits-select-content-available-height) min-w-[8rem] origin-(--bits-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:translate-y-1 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:-translate-x-1 data-[side=left]:slide-in-from-right-2 data-[side=right]:translate-x-1 data-[side=right]:slide-in-from-left-2 data-[side=top]:-translate-y-1 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e.class));ve(f,()=>wO,(m,y)=>{y(m,$e({get sideOffset(){return n()},"data-slot":"select-content",get class(){return g(p)}},()=>i,{get ref(){return t()},set ref(v){t(v)},children:(v,x)=>{var S=QH(),A=F(S);YH(A,{});var C=ae(A,2);{let I=j(()=>Qt("h-(--bits-select-anchor-height) w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1"));ve(C,()=>_O,(R,U)=>{U(R,{get class(){return g(I)},children:(D,$)=>{var H=J(),V=F(H);Te(V,()=>e.children??Re),_(D,H)},$$slots:{default:!0}})})}var k=ae(C,2);JH(k,{}),_(v,S)},$$slots:{default:!0}}))})}_(u,d)},$$slots:{default:!0}}))}),_(r,s),pe()}var eq=ee("<!> <!>",1);function tq(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"size",3,"default"),i=L(e,"variant",3,"default"),a=De(e,["$$slots","$$events","$$legacy","ref","class","children","size","variant"]);const s=j(()=>i()==="plain"?"group inline-flex w-full items-center justify-end gap-2 whitespace-nowrap px-0 py-0 text-sm font-medium text-muted-foreground transition-colors focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3 [&_svg:not([class*='text-'])]:text-muted-foreground":"flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground"),o=j(()=>i()==="plain"?"size-3 opacity-60 transition-transform group-data-[state=open]:-rotate-180":"size-4 opacity-50");var l=J(),c=F(l);{let u=j(()=>Qt(g(s),e.class));ve(c,()=>RN,(h,d)=>{d(h,$e({"data-slot":"select-trigger",get"data-size"(){return n()},get class(){return g(u)}},()=>a,{get ref(){return t()},set ref(f){t(f)},children:(f,p)=>{var m=eq(),y=F(m);Te(y,()=>e.children??Re);var v=ae(y,2);o2(v,{get class(){return g(o)}}),_(f,m)},$$slots:{default:!0}}))})}_(r,l),pe()}const rq=ON;var nq=ee("<textarea></textarea>");function iq(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"value",15),i=De(e,["$$slots","$$events","$$legacy","ref","value","class"]);var a=nq();e0(a),Lt(a,s=>({"data-slot":"textarea",class:s,...i}),[()=>Qt("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e.class)]),Tr(a,s=>t(s),()=>t()),Nl(a,n),_(r,a),pe()}const aq=Af({base:"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",destructive:"bg-destructive [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/70 border-transparent text-white",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function mu(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"variant",3,"default"),i=De(e,["$$slots","$$events","$$legacy","ref","href","class","variant","children"]);var a=J(),s=F(a);j9(s,()=>e.href?"a":"span",!1,(o,l)=>{Tr(o,h=>t(h),()=>t()),Lt(o,h=>({"data-slot":"badge",href:e.href,class:h,...i}),[()=>Qt(aq({variant:n()}),e.class)]);var c=J(),u=F(c);Te(u,()=>e.children??Re),_(l,c)}),_(r,a),pe()}var sq=ee("<!> Custom",1);function v8(r,e){let t=L(e,"class",3,"");mu(r,{variant:"secondary",get class(){return`h-5 bg-orange-100 px-1.5 py-0.5 text-xs text-orange-800 dark:bg-orange-900 dark:text-orange-200 ${t()??""}`},children:(n,i)=>{var a=sq(),s=F(a);eP(s,{class:"mr-1 h-3 w-3"}),Rt(),_(n,a)},$$slots:{default:!0}})}var oq=(r,e,t,n)=>{g7(g(e).key);const i=g(t)??La[g(e).key];n.onConfigChange(g(e).key,String(i))},lq=ee('<button type="button" class="absolute top-1/2 right-2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded transition-colors hover:bg-muted" aria-label="Reset to default" title="Reset to default"><!></button>'),cq=ee('<p class="mt-1 text-xs text-muted-foreground"> </p>'),uq=ee('<div class="flex items-center gap-2"><!> <!></div> <div class="relative w-full md:max-w-md"><!> <!></div> <!>',1),hq=ee('<p class="mt-1 text-xs text-muted-foreground"> </p>'),dq=ee("<!> <!> <!>",1),fq=ee('<div class="flex items-center gap-2"><!> </div>'),gq=(r,e,t,n)=>{g7(g(e).key);const i=g(t)??La[g(e).key];n.onConfigChange(g(e).key,String(i))},pq=ee('<button type="button" class="absolute top-1/2 right-8 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded transition-colors hover:bg-muted" aria-label="Reset to default" title="Reset to default"><!></button>'),mq=ee('<div class="flex items-center gap-2"><!> </div>'),bq=ee('<div class="relative w-full md:w-auto md:max-w-md"><!> <!></div> <!>',1),vq=ee('<p class="mt-1 text-xs text-muted-foreground"> </p>'),yq=ee('<div class="flex items-center gap-2"><!> <!></div> <!> <!>',1),wq=ee('<p class="text-xs text-muted-foreground"> </p>'),xq=ee(`<p class="text-xs text-muted-foreground">PDF-to-image processing requires a vision-capable model. PDFs will be processed as
text.</p>`),Sq=ee('<div class="flex items-start space-x-3"><!> <div class="space-y-1"><label> </label> <!></div></div>'),kq=ee('<div class="space-y-2"><!></div>');function Aq(r,e){ge(e,!0);function t(a){return Zo.canSyncParameter(a)?HL(a):null}var n=J(),i=F(n);_n(i,17,()=>e.fields,a=>a.key,(a,s)=>{var o=kq(),l=te(o);{var c=h=>{var d=uq();const f=j(()=>t(g(s).key)),p=j(()=>String(e.localConfig[g(s).key]??"")),m=j(()=>g(f)?.serverDefault),y=j(()=>(()=>{if(!g(f)||g(m)===void 0)return!1;const $=g(p),H=parseFloat($),V=isNaN(H)?$:Math.round(H*1e6)/1e6,z=typeof g(m)=="number"?Math.round(g(m)*1e6)/1e6:g(m);return V!==z})());var v=F(d),x=te(v);ed(x,{get for(){return g(s).key},class:"text-sm font-medium",children:($,H)=>{Rt();var V=sr();qe(()=>at(V,g(s).label)),_($,V)},$$slots:{default:!0}});var S=ae(x,2);{var A=$=>{v8($,{})};ce(S,$=>{g(y)&&$(A)})}Q(v);var C=ae(v,2),k=te(C);{let $=j(()=>`Default: ${La[g(s).key]??"none"}`),H=j(()=>g(y)?"pr-8":"");td(k,{get id(){return g(s).key},get value(){return g(p)},oninput:V=>{e.onConfigChange(g(s).key,V.currentTarget.value)},get placeholder(){return g($)},get class(){return`w-full ${g(H)??""}`}})}var I=ae(k,2);{var R=$=>{var H=lq();H.__click=[oq,s,m,e];var V=te(H);c2(V,{class:"h-3 w-3"}),Q(H),_($,H)};ce(I,$=>{g(y)&&$(R)})}Q(C);var U=ae(C,2);{var D=$=>{var H=cq(),V=te(H,!0);Q(H),qe(()=>at(V,g(s).help||Qo[g(s).key])),_($,H)};ce(U,$=>{(g(s).help||Qo[g(s).key])&&$(D)})}_(h,d)},u=h=>{var d=J(),f=F(d);{var p=y=>{var v=dq(),x=F(v);ed(x,{get for(){return g(s).key},class:"block text-sm font-medium",children:(k,I)=>{Rt();var R=sr();qe(()=>at(R,g(s).label)),_(k,R)},$$slots:{default:!0}});var S=ae(x,2);{let k=j(()=>String(e.localConfig[g(s).key]??"")),I=j(()=>`Default: ${La[g(s).key]??"none"}`);iq(S,{get id(){return g(s).key},get value(){return g(k)},onchange:R=>e.onConfigChange(g(s).key,R.currentTarget.value),get placeholder(){return g(I)},class:"min-h-[100px] w-full md:max-w-2xl"})}var A=ae(S,2);{var C=k=>{var I=hq(),R=te(I,!0);Q(I),qe(()=>at(R,g(s).help||Qo[g(s).key])),_(k,I)};ce(A,k=>{(g(s).help||Qo[g(s).key])&&k(C)})}_(y,v)},m=y=>{var v=J(),x=F(v);{var S=C=>{var k=yq();const I=j(()=>g(s).options?.find(ie=>ie.value===e.localConfig[g(s).key])),R=j(()=>t(g(s).key)),U=j(()=>e.localConfig[g(s).key]),D=j(()=>g(R)?.serverDefault),$=j(()=>!g(R)||g(D)===void 0?!1:g(U)!==g(D));var H=F(k),V=te(H);ed(V,{get for(){return g(s).key},class:"text-sm font-medium",children:(ie,P)=>{Rt();var be=sr();qe(()=>at(be,g(s).label)),_(ie,be)},$$slots:{default:!0}});var z=ae(V,2);{var Z=ie=>{v8(ie,{})};ce(z,ie=>{g($)&&ie(Z)})}Q(H);var q=ae(H,2);ve(q,()=>rq,(ie,P)=>{P(ie,{type:"single",get value(){return g(U)},onValueChange:be=>{g(s).key==="theme"&&be&&e.onThemeChange?e.onThemeChange(be):e.onConfigChange(g(s).key,be)},children:(be,_e)=>{var W=bq(),me=F(W),He=te(me);ve(He,()=>tq,(Ie,Ve)=>{Ve(Ie,{class:"w-full",children:(We,Qe)=>{var mt=fq(),Ke=te(mt);{var ze=ot=>{var lt=J();const ct=j(()=>g(I).icon);var Ct=F(lt);ve(Ct,()=>g(ct),(St,Ze)=>{Ze(St,{class:"h-4 w-4"})}),_(ot,lt)};ce(Ke,ot=>{g(I)?.icon&&ot(ze)})}var Ge=ae(Ke);Q(mt),qe(ot=>at(Ge,` ${ot??""}`),[()=>g(I)?.label||`Select ${g(s).label.toLowerCase()}`]),_(We,mt)},$$slots:{default:!0}})});var Xe=ae(He,2);{var Le=Ie=>{var Ve=pq();Ve.__click=[gq,s,D,e];var We=te(Ve);c2(We,{class:"h-3 w-3"}),Q(Ve),_(Ie,Ve)};ce(Xe,Ie=>{g($)&&Ie(Le)})}Q(me);var bt=ae(me,2);ve(bt,()=>ZH,(Ie,Ve)=>{Ve(Ie,{children:(We,Qe)=>{var mt=J(),Ke=F(mt);{var ze=Ge=>{var ot=J(),lt=F(ot);_n(lt,17,()=>g(s).options,ct=>ct.value,(ct,Ct)=>{var St=J(),Ze=F(St);ve(Ze,()=>KH,(nt,ht)=>{ht(nt,{get value(){return g(Ct).value},get label(){return g(Ct).label},children:(kt,Se)=>{var Fe=mq(),it=te(Fe);{var yt=kr=>{var Ar=J();const mr=j(()=>g(Ct).icon);var sn=F(Ar);ve(sn,()=>g(mr),(Zr,Je)=>{Je(Zr,{class:"h-4 w-4"})}),_(kr,Ar)};ce(it,kr=>{g(Ct).icon&&kr(yt)})}var $t=ae(it);Q(Fe),qe(()=>at($t,` ${g(Ct).label??""}`)),_(kt,Fe)},$$slots:{default:!0}})}),_(ct,St)}),_(Ge,ot)};ce(Ke,Ge=>{g(s).options&&Ge(ze)})}_(We,mt)},$$slots:{default:!0}})}),_(be,W)},$$slots:{default:!0}})});var re=ae(q,2);{var X=ie=>{var P=vq(),be=te(P,!0);Q(P),qe(()=>at(be,g(s).help||Qo[g(s).key])),_(ie,P)};ce(re,ie=>{(g(s).help||Qo[g(s).key])&&ie(X)})}_(C,k)},A=C=>{var k=J(),I=F(k);{var R=U=>{var D=Sq();const $=j(()=>g(s).key==="pdfAsImage"&&!Za());var H=te(D);{let ie=j(()=>!!e.localConfig[g(s).key]);Ff(H,{get id(){return g(s).key},get checked(){return g(ie)},get disabled(){return g($)},onCheckedChange:P=>e.onConfigChange(g(s).key,P),class:"mt-1"})}var V=ae(H,2),z=te(V),Z=te(z,!0);Q(z);var q=ae(z,2);{var re=ie=>{var P=wq(),be=te(P,!0);Q(P),qe(()=>at(be,g(s).help||Qo[g(s).key])),_(ie,P)},X=ie=>{var P=J(),be=F(P);{var _e=W=>{var me=xq();_(W,me)};ce(be,W=>{g(s).key==="pdfAsImage"&&!Za()&&W(_e)},!0)}_(ie,P)};ce(q,ie=>{g(s).help||Qo[g(s).key]?ie(re):ie(X,!1)})}Q(V),Q(D),qe(()=>{Jt(z,"for",g(s).key),tr(z,1,`cursor-pointer text-sm leading-none font-medium ${g($)?"text-muted-foreground":""}`),at(Z,g(s).label)}),_(U,D)};ce(I,U=>{g(s).type==="checkbox"&&U(R)},!0)}_(C,k)};ce(x,C=>{g(s).type==="select"?C(S):C(A,!1)},!0)}_(y,v)};ce(f,y=>{g(s).type==="textarea"?y(p):y(m,!1)},!0)}_(h,d)};ce(l,h=>{g(s).type==="input"?h(c):h(u,!1)})}Q(o),_(a,o)}),_(r,n),pe()}wi(["click"]);const _q=768;class Cq extends Zv{constructor(e=_q){super(`max-width: ${e-1}px`)}}const Eq="sidebar:state",Tq=3600*24*7,Iq="18rem",Mq="18rem",Oq="3rem",Nq="b";class Rq{props;#e=j(()=>this.props.open());get open(){return g(this.#e)}set open(e){O(this.#e,e)}#t=oe(!1);get openMobile(){return g(this.#t)}set openMobile(e){O(this.#t,e,!0)}setOpen;#r;#n=j(()=>this.open?"expanded":"collapsed");get state(){return g(this.#n)}set state(e){O(this.#n,e)}constructor(e){this.setOpen=e.setOpen,this.#r=new Cq,this.props=e}get isMobile(){return this.#r.current}handleShortcutKeydown=e=>{e.key===Nq&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.toggle())};setOpenMobile=e=>{this.openMobile=e};toggle=()=>this.#r.current?this.openMobile=!this.openMobile:this.setOpen(!this.open)}const y8="scn-sidebar";function Pq(r){return qd(Symbol.for(y8),new Rq(r))}function kb(){return Ac(Symbol.for(y8))}var Fq=ee("<div><!></div>");function Dq(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=Fq();Lt(i,s=>({"data-slot":"sidebar-group-content","data-sidebar":"group-content",class:s,...n}),[()=>Qt("w-full text-sm",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}var Lq=ee("<div><!></div>");function Bq(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","children","child","class"]);const i=j(()=>({class:Qt("text-sidebar-foreground/70 ring-sidebar-ring outline-hidden flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e.class),"data-slot":"sidebar-group-label","data-sidebar":"group-label",...n}));var a=J(),s=F(a);{var o=c=>{var u=J(),h=F(u);Te(h,()=>e.child,()=>({props:g(i)})),_(c,u)},l=c=>{var u=Lq();Lt(u,()=>({...g(i)}));var h=te(u);Te(h,()=>e.children??Re),Q(u),Tr(u,d=>t(d),()=>t()),_(c,u)};ce(s,c=>{e.child?c(o):c(l,!1)})}_(r,a),pe()}var Uq=ee("<div><!></div>");function zq(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=Uq();Lt(i,s=>({"data-slot":"sidebar-group","data-sidebar":"group",class:s,...n}),[()=>Qt("relative flex w-full min-w-0 flex-col p-2",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}var jq=ee("<div><!></div>");function Hq(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=jq();Lt(i,s=>({"data-slot":"sidebar-header","data-sidebar":"header",class:s,...n}),[()=>Qt("flex flex-col gap-2 p-2",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}var qq=ee("<main><!></main>");function Gq(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=qq();Lt(i,s=>({"data-slot":"sidebar-inset",class:s,...n}),[()=>Qt("relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}Af({base:"peer/menu-button outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground group-has-data-[sidebar=menu-action]/menu-item:pr-8 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm transition-[width,height,padding] focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:font-medium [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"group-data-[collapsible=icon]:p-0! h-12 text-sm"}},defaultVariants:{variant:"default",size:"default"}});var Wq=ee("<li><!></li>");function Vq(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=Wq();Lt(i,s=>({"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",class:s,...n}),[()=>Qt("group/menu-item relative",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}var Xq=ee("<ul><!></ul>");function $q(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=Xq();Lt(i,s=>({"data-slot":"sidebar-menu","data-sidebar":"menu",class:s,...n}),[()=>Qt("flex w-full min-w-0 flex-col gap-1",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}var Kq=ee("<div><!></div>");function Yq(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"open",15,!0),i=L(e,"onOpenChange",3,()=>{}),a=De(e,["$$slots","$$events","$$legacy","ref","open","onOpenChange","class","style","children"]);const s=Pq({open:()=>n(),setOpen:c=>{n(c),i()(c),document.cookie=`${Eq}=${n()}; path=/; max-age=${Tq}`}});var o=J();Rn("keydown",Tl,function(...c){s.handleShortcutKeydown?.apply(this,c)});var l=F(o);ve(l,()=>rB,(c,u)=>{u(c,{delayDuration:0,children:(h,d)=>{var f=Kq();Lt(f,m=>({"data-slot":"sidebar-wrapper",style:`--sidebar-width: ${Iq}; --sidebar-width-icon: ${Oq}; ${e.style??""}`,class:m,...a}),[()=>Qt("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",e.class)]);var p=te(f);Te(p,()=>e.children??Re),Q(f),Tr(f,m=>t(m),()=>t()),_(h,f)},$$slots:{default:!0}})}),_(r,o),pe()}var Jq=ee('<!> <span class="sr-only">Toggle Sidebar</span>',1);function Qq(r,e){ge(e,!0),L(e,"ref",11,null);let t=De(e,["$$slots","$$events","$$legacy","ref","class","onclick"]);const n=kb();{let i=j(()=>Qt("size-7",e.class));Qr(r,$e({"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",get class(){return g(i)},type:"button",onclick:a=>{e.onclick?.(a),n.toggle()}},()=>t,{children:(a,s)=>{var o=Jq(),l=F(o);XR(l,{}),Rt(2),_(a,o)},$$slots:{default:!0}}))}pe()}function Zq(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e.class));ve(a,()=>Hp,(o,l)=>{l(o,$e({"data-slot":"sheet-overlay",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}const eG=Af({base:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",variants:{side:{top:"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",bottom:"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",left:"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",right:"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"}},defaultVariants:{side:"right"}});var tG=ee('<!> <span class="sr-only">Close</span>',1),rG=ee("<!> <!>",1),nG=ee("<!> <!>",1);function iG(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"side",3,"right"),i=De(e,["$$slots","$$events","$$legacy","ref","class","side","portalProps","children"]);var a=J(),s=F(a);ve(s,()=>Ll,(o,l)=>{l(o,$e(()=>e.portalProps,{children:(c,u)=>{var h=nG(),d=F(h);Zq(d,{});var f=ae(d,2);{let p=j(()=>Qt(eG({side:n()}),e.class));ve(f,()=>i6,(m,y)=>{y(m,$e({"data-slot":"sheet-content",get class(){return g(p)}},()=>i,{get ref(){return t()},set ref(v){t(v)},children:(v,x)=>{var S=rG(),A=F(S);Te(A,()=>e.children??Re);var C=ae(A,2);ve(C,()=>n6,(k,I)=>{I(k,{class:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none",children:(R,U)=>{var D=tG(),$=F(D);eo($,{class:"size-4"}),Rt(2),_(R,D)},$$slots:{default:!0}})}),_(v,S)},$$slots:{default:!0}}))})}_(c,h)},$$slots:{default:!0}}))}),_(r,a),pe()}var aG=ee("<div><!></div>");function sG(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class","children"]);var i=aG();Lt(i,s=>({"data-slot":"sheet-header",class:s,...n}),[()=>Qt("flex flex-col gap-1.5 p-4",e.class)]);var a=te(i);Te(a,()=>e.children??Re),Q(i),Tr(i,s=>t(s),()=>t()),_(r,i),pe()}function oG(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("font-semibold text-foreground",e.class));ve(a,()=>Ep,(o,l)=>{l(o,$e({"data-slot":"sheet-title",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}function lG(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=De(e,["$$slots","$$events","$$legacy","ref","class"]);var i=J(),a=F(i);{let s=j(()=>Qt("text-sm text-muted-foreground",e.class));ve(a,()=>qp,(o,l)=>{l(o,$e({"data-slot":"sheet-description",get class(){return g(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}_(r,i),pe()}const cG=r6;var uG=ee("<div><!></div>"),hG=ee("<!> <!>",1),dG=ee('<!> <div class="flex h-full w-full flex-col"><!></div>',1),fG=ee('<div class="group peer hidden text-sidebar-foreground md:block" data-slot="sidebar"><div data-slot="sidebar-gap"></div> <div><div data-sidebar="sidebar" data-slot="sidebar-inner" class="flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm"><!></div></div></div>');function gG(r,e){ge(e,!0);let t=L(e,"ref",15,null),n=L(e,"side",3,"left"),i=L(e,"variant",3,"sidebar"),a=L(e,"collapsible",3,"offcanvas"),s=De(e,["$$slots","$$events","$$legacy","ref","side","variant","collapsible","class","children"]);const o=kb();var l=J(),c=F(l);{var u=d=>{var f=uG();Lt(f,m=>({class:m,...s}),[()=>Qt("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",e.class)]);var p=te(f);Te(p,()=>e.children??Re),Q(f),Tr(f,m=>t(m),()=>t()),_(d,f)},h=d=>{var f=J(),p=F(f);{var m=v=>{var x=J(),S=F(x),A=()=>o.openMobile,C=k=>o.setOpenMobile(k);ve(S,()=>cG,(k,I)=>{I(k,$e({get open(){return A()},set open(R){C(R)}},()=>s,{children:(R,U)=>{var D=J(),$=F(D);ve($,()=>iG,(H,V)=>{V(H,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",class:"z-99999 w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:z-99 [&>button]:hidden",get style(){return`--sidebar-width: ${Mq};`},get side(){return n()},children:(z,Z)=>{var q=dG(),re=F(q);ve(re,()=>sG,(P,be)=>{be(P,{class:"sr-only",children:(_e,W)=>{var me=hG(),He=F(me);ve(He,()=>oG,(Le,bt)=>{bt(Le,{children:(Ie,Ve)=>{Rt();var We=sr("Sidebar");_(Ie,We)},$$slots:{default:!0}})});var Xe=ae(He,2);ve(Xe,()=>lG,(Le,bt)=>{bt(Le,{children:(Ie,Ve)=>{Rt();var We=sr("Displays the mobile sidebar.");_(Ie,We)},$$slots:{default:!0}})}),_(_e,me)},$$slots:{default:!0}})});var X=ae(re,2),ie=te(X);Te(ie,()=>e.children??Re),Q(X),_(z,q)},$$slots:{default:!0}})}),_(R,D)},$$slots:{default:!0}}))}),_(v,x)},y=v=>{var x=fG(),S=te(x),A=ae(S,2);Lt(A,I=>({"data-slot":"sidebar-container",class:I,...s}),[()=>Qt("fixed inset-y-0 z-999 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:z-0 md:flex",n()==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",i()==="floating"||i()==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)",e.class)]);var C=te(A),k=te(C);Te(k,()=>e.children??Re),Q(C),Q(A),Q(x),Tr(x,I=>t(I),()=>t()),qe(I=>{Jt(x,"data-state",o.state),Jt(x,"data-collapsible",o.state==="collapsed"?a():""),Jt(x,"data-variant",i()),Jt(x,"data-side",n()),tr(S,1,I)},[()=>ai(Qt("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",i()==="floating"||i()==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)"))]),_(v,x)};ce(p,v=>{o.isMobile?v(m):v(y,!1)},!0)}_(d,f)};ce(c,d=>{a()==="none"?d(u):d(h,!1)})}_(r,l),pe()}var pG=ee('<div class="relative"><!> <!> <!></div>'),mG=ee('<div class="flex items-center gap-2"><!> New chat</div> <!>',1),bG=ee('<div class="flex items-center gap-2"><!> Search conversations</div> <!>',1),vG=ee("<!> <!>",1),yG=ee('<div class="space-y-0.5"><!></div>');function wG(r,e){ge(e,!0);let t=L(e,"isSearchModeActive",15),n=L(e,"searchQuery",15),i=oe(null);function a(){t(!1),n("")}Ft(()=>{t()&&g(i)?.focus()});var s=yG(),o=te(s);{var l=u=>{var h=pG(),d=te(h);u2(d,{class:"absolute top-2.5 left-2 h-4 w-4 text-muted-foreground"});var f=ae(d,2);td(f,{onkeydown:m=>m.key==="Escape"&&a(),placeholder:"Search conversations...",class:"pl-8",get ref(){return g(i)},set ref(m){O(i,m,!0)},get value(){return n()},set value(m){n(m)}});var p=ae(f,2);eo(p,{class:"cursor-pointertext-muted-foreground absolute top-2.5 right-2 h-4 w-4",onclick:a}),Q(h),_(u,h)},c=u=>{var h=vG(),d=F(h);Qr(d,{class:"w-full justify-between hover:[&>kbd]:opacity-100",href:"?new_chat=true#/",get onclick(){return e.handleMobileSidebarItemClick},variant:"ghost",children:(p,m)=>{var y=mG(),v=F(y),x=te(v);j6(x,{class:"h-4 w-4"}),Rt(),Q(v);var S=ae(v,2);Ab(S,{keys:["shift","cmd","o"]}),_(p,y)},$$slots:{default:!0}});var f=ae(d,2);Qr(f,{class:"w-full justify-between hover:[&>kbd]:opacity-100",onclick:()=>{t(!0)},variant:"ghost",children:(p,m)=>{var y=bG(),v=F(y),x=te(v);u2(x,{class:"h-4 w-4"}),Rt(),Q(v);var S=ae(v,2);Ab(S,{keys:["cmd","k"]}),_(p,y)},$$slots:{default:!0}}),_(u,h)};ce(o,u=>{t()?u(l):u(c,!1)})}Q(s),_(r,s),pe()}var xG=ee('<a href="#/"><h1 class="inline-flex items-center gap-1 px-2 text-xl font-semibold">llama.cpp</h1></a> <!>',1),SG=ee('<div class="px-2 py-4 text-center"><p class="mb-4 p-4 text-sm text-muted-foreground"> </p></div>'),kG=ee("<!> <!>",1),AG=ee("<!> <!>",1),_G=ee('<!> <!> <div class="bottom-0 z-10 bg-sidebar bg-sidebar/50 px-4 py-4 backdrop-blur-lg md:sticky"></div>',1),CG=ee("<!> <!>",1),EG=ee("<!> <!>",1),TG=ee("<!> <!>",1),IG=ee("<!> <!> <!>",1);function MG(r,e){ge(e,!0);const t=kb();let n=j(()=>us.params.id),i=oe(!1),a=oe(""),s=oe(!1),o=oe(!1),l=oe(null),c=oe(""),u=j(()=>g(a).trim().length>0?Qh().filter(I=>I.name.toLowerCase().includes(g(a).toLowerCase())):Qh());async function h(I){const R=Qh().find(U=>U.id===I);R&&(O(l,R,!0),O(s,!0))}async function d(I){const R=Qh().find(U=>U.id===I);R&&(O(l,R,!0),O(c,R.name,!0),O(o,!0))}function f(){g(l)&&(O(s,!1),setTimeout(()=>{hb(g(l).id),O(l,null)},100))}function p(){!g(c).trim()||!g(l)||(O(o,!1),z7(g(l).id,g(c)),O(l,null))}function m(){t.isMobile&&t.toggle()}function y(){O(i,!0)}function v(){if(g(n)&&g(u).find(R=>R.id===g(n))){const R=new CustomEvent("edit-active-conversation",{detail:{conversationId:g(n)}});document.dispatchEvent(R)}}async function x(I){g(i)&&(O(i,!1),O(a,"")),await Do(`#/chat/${I}`)}var S=IG(),A=F(S);pb(A,{class:"h-[100vh]",children:(I,R)=>{var U=_G(),D=F(U);ve(D,()=>Hq,(H,V)=>{V(H,{class:" top-0 z-10 gap-6 bg-sidebar/50 px-4 pt-4 pb-2 backdrop-blur-lg md:sticky",children:(z,Z)=>{var q=xG(),re=F(q);re.__click=m;var X=ae(re,2);wG(X,{handleMobileSidebarItemClick:m,get isSearchModeActive(){return g(i)},set isSearchModeActive(ie){O(i,ie,!0)},get searchQuery(){return g(a)},set searchQuery(ie){O(a,ie,!0)}}),_(z,q)},$$slots:{default:!0}})});var $=ae(D,2);ve($,()=>zq,(H,V)=>{V(H,{class:"mt-4 space-y-2 p-0 px-4",children:(z,Z)=>{var q=AG(),re=F(q);{var X=P=>{var be=J(),_e=F(be);ve(_e,()=>Bq,(W,me)=>{me(W,{children:(He,Xe)=>{Rt();var Le=sr();qe(()=>at(Le,g(i)?"Search results":"Conversations")),_(He,Le)},$$slots:{default:!0}})}),_(P,be)};ce(re,P=>{(g(u).length>0&&g(i)||!g(i))&&P(X)})}var ie=ae(re,2);ve(ie,()=>Dq,(P,be)=>{be(P,{children:(_e,W)=>{var me=J(),He=F(me);ve(He,()=>$q,(Xe,Le)=>{Le(Xe,{children:(bt,Ie)=>{var Ve=kG(),We=F(Ve);_n(We,17,()=>g(u),Ke=>Ke.id,(Ke,ze)=>{var Ge=J(),ot=F(Ge);ve(ot,()=>Vq,(lt,ct)=>{ct(lt,{class:"mb-1",children:(Ct,St)=>{{let Ze=j(()=>({id:g(ze).id,name:g(ze).name,lastModified:g(ze).lastModified,currNode:g(ze).currNode})),nt=j(()=>g(n)===g(ze).id);FG(Ct,{get conversation(){return g(Ze)},handleMobileSidebarItemClick:m,get isActive(){return g(nt)},onSelect:x,onEdit:d,onDelete:h})}},$$slots:{default:!0}})}),_(Ke,Ge)});var Qe=ae(We,2);{var mt=Ke=>{var ze=SG(),Ge=te(ze),ot=te(Ge,!0);Q(Ge),Q(ze),qe(()=>at(ot,g(a).length>0?"No results found":g(i)?"Start typing to see results":"No conversations yet")),_(Ke,ze)};ce(Qe,Ke=>{g(u).length===0&&Ke(mt)})}_(bt,Ve)},$$slots:{default:!0}})}),_(_e,me)},$$slots:{default:!0}})}),_(z,q)},$$slots:{default:!0}})}),Rt(2),_(I,U)},$$slots:{default:!0}});var C=ae(A,2);{let I=j(()=>g(l)?`Are you sure you want to delete "${g(l).name}"? This action cannot be undone and will permanently remove all messages in this conversation.`:"");b5(C,{title:"Delete Conversation",get description(){return g(I)},confirmText:"Delete",cancelText:"Cancel",variant:"destructive",get icon(){return Eh},onConfirm:f,onCancel:()=>{O(s,!1),O(l,null)},get open(){return g(s)},set open(R){O(s,R,!0)}})}var k=ae(C,2);return ve(k,()=>tc,(I,R)=>{R(I,{get open(){return g(o)},set open(U){O(o,U,!0)},children:(U,D)=>{var $=J(),H=F($);ve(H,()=>Zl,(V,z)=>{z(V,{children:(Z,q)=>{var re=TG(),X=F(re);ve(X,()=>Ql,(P,be)=>{be(P,{children:(_e,W)=>{var me=CG(),He=F(me);ve(He,()=>Yl,(Le,bt)=>{bt(Le,{children:(Ie,Ve)=>{Rt();var We=sr("Edit Conversation Name");_(Ie,We)},$$slots:{default:!0}})});var Xe=ae(He,2);ve(Xe,()=>ec,(Le,bt)=>{bt(Le,{children:(Ie,Ve)=>{td(Ie,{class:"mt-4 text-foreground",onkeydown:We=>{We.key==="Enter"&&(We.preventDefault(),p())},placeholder:"Enter a new name",type:"text",get value(){return g(c)},set value(We){O(c,We,!0)}})},$$slots:{default:!0}})}),_(_e,me)},$$slots:{default:!0}})});var ie=ae(X,2);ve(ie,()=>Jl,(P,be)=>{be(P,{children:(_e,W)=>{var me=EG(),He=F(me);ve(He,()=>gb,(Le,bt)=>{bt(Le,{onclick:()=>{O(o,!1),O(l,null)},children:(Ie,Ve)=>{Rt();var We=sr("Cancel");_(Ie,We)},$$slots:{default:!0}})});var Xe=ae(He,2);ve(Xe,()=>pu,(Le,bt)=>{bt(Le,{onclick:p,children:(Ie,Ve)=>{Rt();var We=sr("Save");_(Ie,We)},$$slots:{default:!0}})}),_(_e,me)},$$slots:{default:!0}})}),_(Z,re)},$$slots:{default:!0}})}),_(U,$)},$$slots:{default:!0}})}),_(r,S),pe({handleMobileSidebarItemClick:m,activateSearchMode:y,editActiveConversation:v})}wi(["click"]);function OG(r,e){O(e,!0)}function NG(r,e){e.onSelect?.(e.conversation.id)}var RG=ee('<div class="actions flex items-center"><!></div>'),PG=ee('<button><div class="flex min-w-0 flex-1 items-center gap-2"><!> <span class="truncate text-sm font-medium"> </span></div> <!></button>');function FG(r,e){ge(e,!0);let t=L(e,"isActive",3,!1),n=oe(!1),i=oe(!1),a=j(()=>H7().includes(e.conversation.id));function s(x){x.stopPropagation(),e.onEdit?.(e.conversation.id)}function o(x){x.stopPropagation(),e.onDelete?.(e.conversation.id)}function l(x){x.detail.conversationId===e.conversation.id&&t()&&s(x)}function c(){g(i)||O(n,!1)}Ft(()=>{g(i)||O(n,!1)}),Si(()=>(document.addEventListener("edit-active-conversation",l),()=>{document.removeEventListener("edit-active-conversation",l)}));var u=PG();u.__click=[NG,e],u.__mouseover=[OG,n];var h=te(u),d=te(h);{var f=x=>{l2(x,{class:"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground"})};ce(d,x=>{g(a)&&x(f)})}var p=ae(d,2);p.__click=function(...x){e.handleMobileSidebarItemClick?.apply(this,x)};var m=te(p,!0);Q(p),Q(h);var y=ae(h,2);{var v=x=>{var S=RG(),A=te(S);{let C=j(()=>[{icon:KR,label:"Edit",onclick:s,shortcut:["shift","cmd","e"]},{icon:P6,label:"Export",onclick:k=>{k.stopPropagation(),O7(e.conversation.id)},shortcut:["shift","cmd","s"]},{icon:Eh,label:"Delete",onclick:o,variant:"destructive",shortcut:["shift","cmd","d"],separator:!0}]);ane(A,{get triggerIcon(){return UR},triggerTooltip:"More actions",get actions(){return g(C)},get open(){return g(i)},set open(k){O(i,k,!0)}})}Q(S),_(x,S)};ce(y,x=>{g(n)&&x(v)})}Q(u),qe(()=>{tr(u,1,`group flex min-h-9 w-full cursor-pointer items-center justify-between space-x-3 rounded-lg px-3 py-1.5 text-left transition-colors hover:bg-foreground/10 ${t()?"bg-foreground/5 text-accent-foreground":""}`,"svelte-5d6dyd"),at(m,e.conversation.name)}),Rn("mouseleave",u,c),_(r,u),pe()}wi(["click","mouseover"]);var DG=ee("<!> ",1),LG=ee("<!> <!>",1),BG=ee('<!> <div><p class="font-medium"> </p></div> <!>',1);function UG(r,e){ge(e,!0);let t=L(e,"open",15);const n=j(()=>e.type==="timeout"),i=j(()=>g(n)?"TCP Timeout":"Server Error"),a=j(()=>g(n)?"The request did not receive a response from the server before timing out.":"The server responded with an error message. Review the details below."),s=j(()=>g(n)?"text-destructive":"text-amber-500"),o=j(()=>g(n)?"border-destructive/40 bg-destructive/10 text-destructive":"border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-400");function l(h){t(h),e.onOpenChange?.(h)}var c=J(),u=F(c);ve(u,()=>tc,(h,d)=>{d(h,{get open(){return t()},onOpenChange:l,children:(f,p)=>{var m=J(),y=F(m);ve(y,()=>Zl,(v,x)=>{x(v,{children:(S,A)=>{var C=BG(),k=F(C);ve(k,()=>Ql,($,H)=>{H($,{children:(V,z)=>{var Z=LG(),q=F(Z);ve(q,()=>Yl,(X,ie)=>{ie(X,{class:"flex items-center gap-2",children:(P,be)=>{var _e=DG(),W=F(_e);{var me=Le=>{{let bt=j(()=>`h-5 w-5 ${g(s)}`);QR(Le,{get class(){return g(bt)}})}},He=Le=>{{let bt=j(()=>`h-5 w-5 ${g(s)}`);Th(Le,{get class(){return g(bt)}})}};ce(W,Le=>{g(n)?Le(me):Le(He,!1)})}var Xe=ae(W);qe(()=>at(Xe,` ${g(i)??""}`)),_(P,_e)},$$slots:{default:!0}})});var re=ae(q,2);ve(re,()=>ec,(X,ie)=>{ie(X,{children:(P,be)=>{Rt();var _e=sr();qe(()=>at(_e,g(a))),_(P,_e)},$$slots:{default:!0}})}),_(V,Z)},$$slots:{default:!0}})});var I=ae(k,2),R=te(I),U=te(R,!0);Q(R),Q(I);var D=ae(I,2);ve(D,()=>Jl,($,H)=>{H($,{children:(V,z)=>{var Z=J(),q=F(Z);ve(q,()=>pu,(re,X)=>{X(re,{onclick:()=>l(!1),children:(ie,P)=>{Rt();var be=sr("Close");_(ie,be)},$$slots:{default:!0}})}),_(V,Z)},$$slots:{default:!0}})}),qe(()=>{tr(I,1,`rounded-lg border px-4 py-3 text-sm ${g(o)}`),at(U,e.message)}),_(S,C)},$$slots:{default:!0}})}),_(f,m)},$$slots:{default:!0}})}),_(r,c),pe()}var zG=ee("<!> Empty Files Detected",1),jG=ee("<!> <!>",1),HG=ee('<li class="font-mono text-sm"> </li>'),qG=ee('<!> <div class="space-y-3 text-sm"><div class="rounded-lg bg-muted p-3"><div class="mb-2 font-medium">Empty Files:</div> <ul class="list-inside list-disc space-y-1 text-muted-foreground"></ul></div> <div><div class="mb-2 font-medium">What happened:</div> <ul class="list-inside list-disc space-y-1 text-muted-foreground"><li>Empty files cannot be processed or sent to the AI model</li> <li>These files have been automatically removed from your attachments</li> <li>You can try uploading files with content instead</li></ul></div></div> <!>',1);function GG(r,e){ge(e,!0);let t=L(e,"open",15);function n(s){t(s),e.onOpenChange?.(s)}var i=J(),a=F(i);ve(a,()=>tc,(s,o)=>{o(s,{get open(){return t()},onOpenChange:n,children:(l,c)=>{var u=J(),h=F(u);ve(h,()=>Zl,(d,f)=>{f(d,{children:(p,m)=>{var y=qG(),v=F(y);ve(v,()=>Ql,(k,I)=>{I(k,{children:(R,U)=>{var D=jG(),$=F(D);ve($,()=>Yl,(V,z)=>{z(V,{class:"flex items-center gap-2",children:(Z,q)=>{var re=zG(),X=F(re);zR(X,{class:"h-5 w-5 text-destructive"}),Rt(),_(Z,re)},$$slots:{default:!0}})});var H=ae($,2);ve(H,()=>ec,(V,z)=>{z(V,{children:(Z,q)=>{Rt();var re=sr("The following files are empty and have been removed from your attachments:");_(Z,re)},$$slots:{default:!0}})}),_(R,D)},$$slots:{default:!0}})});var x=ae(v,2),S=te(x),A=ae(te(S),2);_n(A,20,()=>e.emptyFiles,k=>k,(k,I)=>{var R=HG(),U=te(R,!0);Q(R),qe(()=>at(U,I)),_(k,R)}),Q(A),Q(S),Rt(2),Q(x);var C=ae(x,2);ve(C,()=>Jl,(k,I)=>{I(k,{children:(R,U)=>{var D=J(),$=F(D);ve($,()=>pu,(H,V)=>{V(H,{onclick:()=>n(!1),children:(z,Z)=>{Rt();var q=sr("Got it");_(z,q)},$$slots:{default:!0}})}),_(R,D)},$$slots:{default:!0}})}),_(p,y)},$$slots:{default:!0}})}),_(l,u)},$$slots:{default:!0}})}),_(r,i),pe()}var WG=ee("<!> <!>",1),VG=ee("<!> <!>",1),XG=ee('<!> <div class="space-y-4 pt-2 pb-6"><div class="space-y-2"><p class="text-sm font-medium text-muted-foreground">Current title:</p> <p class="rounded-md bg-muted/50 p-3 text-sm font-medium"> </p></div> <div class="space-y-2"><p class="text-sm font-medium text-muted-foreground">New title would be:</p> <p class="rounded-md bg-muted/50 p-3 text-sm font-medium"> </p></div></div> <!>',1);function $G(r,e){ge(e,!0);let t=L(e,"open",15);var n=J(),i=F(n);ve(i,()=>tc,(a,s)=>{s(a,{get open(){return t()},set open(o){t(o)},children:(o,l)=>{var c=J(),u=F(c);ve(u,()=>Zl,(h,d)=>{d(h,{children:(f,p)=>{var m=XG(),y=F(m);ve(y,()=>Ql,(U,D)=>{D(U,{children:($,H)=>{var V=WG(),z=F(V);ve(z,()=>Yl,(q,re)=>{re(q,{children:(X,ie)=>{Rt();var P=sr("Update Conversation Title?");_(X,P)},$$slots:{default:!0}})});var Z=ae(z,2);ve(Z,()=>ec,(q,re)=>{re(q,{children:(X,ie)=>{Rt();var P=sr("Do you want to update the conversation title to match the first message content?");_(X,P)},$$slots:{default:!0}})}),_($,V)},$$slots:{default:!0}})});var v=ae(y,2),x=te(v),S=ae(te(x),2),A=te(S,!0);Q(S),Q(x);var C=ae(x,2),k=ae(te(C),2),I=te(k,!0);Q(k),Q(C),Q(v);var R=ae(v,2);ve(R,()=>Jl,(U,D)=>{D(U,{children:($,H)=>{var V=VG(),z=F(V);Qr(z,{variant:"outline",get onclick(){return e.onCancel},children:(q,re)=>{Rt();var X=sr("Keep Current Title");_(q,X)},$$slots:{default:!0}});var Z=ae(z,2);Qr(Z,{get onclick(){return e.onConfirm},children:(q,re)=>{Rt();var X=sr("Update Title");_(q,X)},$$slots:{default:!0}}),_($,V)},$$slots:{default:!0}})}),qe(()=>{at(A,e.currentTitle),at(I,e.newTitle)}),_(f,m)},$$slots:{default:!0}})}),_(o,c)},$$slots:{default:!0}})}),_(r,n),pe()}var KG=ee("<span>⌘</span>"),YG=ee("<span></span>"),JG=ee("<!> <!>",1),QG=ee("<kbd></kbd>");function Ab(r,e){ge(e,!0);let t=L(e,"variant",3,"default"),n=L(e,"class",3,""),i=t()==="destructive"?"text-destructive":"text-muted-foreground";var a=QG();_n(a,21,()=>e.keys,B9,(s,o,l)=>{var c=JG(),u=F(c);{var h=m=>{{let y=j(()=>t()==="destructive"?"text-destructive":"");OR(m,{get class(){return`h-1 w-1 ${g(y)??""} -mr-1`}})}},d=m=>{var y=J(),v=F(y);{var x=A=>{var C=KG();qe(()=>tr(C,1,ai(t()==="destructive"?"text-destructive":""))),_(A,C)},S=A=>{var C=sr();qe(k=>at(C,k),[()=>g(o).toUpperCase()]),_(A,C)};ce(v,A=>{g(o)==="cmd"?A(x):A(S,!1)},!0)}_(m,y)};ce(u,m=>{g(o)==="shift"?m(h):m(d,!1)})}var f=ae(u,2);{var p=m=>{var y=YG();_(m,y)};ce(f,m=>{l<e.keys.length-1&&m(p)})}_(s,c)}),Q(a),qe(()=>tr(a,1,`px-1 pointer-events-none inline-flex select-none items-center gap-0.5 font-sans text-md font-medium opacity-0 transition-opacity -my-1 ${i} ${n()??""}`)),_(r,a),pe()}const ZG={};function _b(r,e){const t=ZG,n=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return w8(r,n,i)}function w8(r,e,t){if(eW(r)){if("value"in r)return r.type==="html"&&!t?"":r.value;if(e&&"alt"in r&&r.alt)return r.alt;if("children"in r)return x8(r.children,e,t)}return Array.isArray(r)?x8(r,e,t):""}function x8(r,e,t){const n=[];let i=-1;for(;++i<r.length;)n[i]=w8(r[i],e,t);return n.join("")}function eW(r){return!!(r&&typeof r=="object")}const S8=document.createElement("i");function Cb(r){const e="&"+r+";";S8.innerHTML=e;const t=S8.textContent;return t.charCodeAt(t.length-1)===59&&r!=="semi"||t===e?!1:t}function ba(r,e,t,n){const i=r.length;let a=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,t=t>0?t:0,n.length<1e4)s=Array.from(n),s.unshift(e,t),r.splice(...s);else for(t&&r.splice(e,t);a<n.length;)s=n.slice(a,a+1e4),s.unshift(e,0),r.splice(...s),a+=1e4,e+=1e4}function Ba(r,e){return r.length>0?(ba(r,r.length,0,e),r):e}const k8={}.hasOwnProperty;function A8(r){const e={};let t=-1;for(;++t<r.length;)tW(e,r[t]);return e}function tW(r,e){let t;for(t in e){const i=(k8.call(r,t)?r[t]:void 0)||(r[t]={}),a=e[t];let s;if(a)for(s in a){k8.call(i,s)||(i[s]=[]);const o=a[s];rW(i[s],Array.isArray(o)?o:o?[o]:[])}}}function rW(r,e){let t=-1;const n=[];for(;++t<e.length;)(e[t].add==="after"?r:n).push(e[t]);ba(r,0,0,n)}function _8(r,e){const t=Number.parseInt(r,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"<22>":String.fromCodePoint(t)}function ts(r){return r.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ui=rl(/[A-Za-z]/),Ci=rl(/[\dA-Za-z]/),nW=rl(/[#-'*+\--9=?A-Z^-~]/);function zf(r){return r!==null&&(r<32||r===127)}const Eb=rl(/\d/),iW=rl(/[\dA-Fa-f]/),aW=rl(/[!-/:-@[-`{-~]/);function Yt(r){return r!==null&&r<-2}function vn(r){return r!==null&&(r<0||r===32)}function Vr(r){return r===-2||r===-1||r===32}const jf=rl(new RegExp("\\p{P}|\\p{S}","u")),ic=rl(/\s/);function rl(r){return e;function e(t){return t!==null&&t>-1&&r.test(String.fromCharCode(t))}}function bu(r){const e=[];let t=-1,n=0,i=0;for(;++t<r.length;){const a=r.charCodeAt(t);let s="";if(a===37&&Ci(r.charCodeAt(t+1))&&Ci(r.charCodeAt(t+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=r.charCodeAt(t+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="<22>"}else s=String.fromCharCode(a);s&&(e.push(r.slice(n,t),encodeURIComponent(s)),n=t+i+1,s=""),i&&(t+=i,i=0)}return e.join("")+r.slice(n)}function Hr(r,e,t,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(l){return Vr(l)?(r.enter(t),o(l)):e(l)}function o(l){return Vr(l)&&a++<i?(r.consume(l),o):(r.exit(t),e(l))}}const sW={tokenize:oW};function oW(r){const e=r.attempt(this.parser.constructs.contentInitial,n,i);let t;return e;function n(o){if(o===null){r.consume(o);return}return r.enter("lineEnding"),r.consume(o),r.exit("lineEnding"),Hr(r,e,"linePrefix")}function i(o){return r.enter("paragraph"),a(o)}function a(o){const l=r.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,s(o)}function s(o){if(o===null){r.exit("chunkText"),r.exit("paragraph"),r.consume(o);return}return Yt(o)?(r.consume(o),r.exit("chunkText"),a):(r.consume(o),s)}}const lW={tokenize:cW},C8={tokenize:uW};function cW(r){const e=this,t=[];let n=0,i,a,s;return o;function o(S){if(n<t.length){const A=t[n];return e.containerState=A[1],r.attempt(A[0].continuation,l,c)(S)}return c(S)}function l(S){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&x();const A=e.events.length;let C=A,k;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){k=e.events[C][1].end;break}v(n);let I=A;for(;I<e.events.length;)e.events[I][1].end={...k},I++;return ba(e.events,C+1,0,e.events.slice(A)),e.events.length=I,c(S)}return o(S)}function c(S){if(n===t.length){if(!i)return d(S);if(i.currentConstruct&&i.currentConstruct.concrete)return p(S);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},r.check(C8,u,h)(S)}function u(S){return i&&x(),v(n),d(S)}function h(S){return e.parser.lazy[e.now().line]=n!==t.length,s=e.now().offset,p(S)}function d(S){return e.containerState={},r.attempt(C8,f,p)(S)}function f(S){return n++,t.push([e.currentConstruct,e.containerState]),d(S)}function p(S){if(S===null){i&&x(),v(0),r.consume(S);return}return i=i||e.parser.flow(e.now()),r.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),m(S)}function m(S){if(S===null){y(r.exit("chunkFlow"),!0),v(0),r.consume(S);return}return Yt(S)?(r.consume(S),y(r.exit("chunkFlow")),n=0,e.interrupt=void 0,o):(r.consume(S),m)}function y(S,A){const C=e.sliceStream(S);if(A&&C.push(null),S.previous=a,a&&(a.next=S),a=S,i.defineSkip(S.start),i.write(C),e.parser.lazy[S.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;const I=e.events.length;let R=I,U,D;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){if(U){D=e.events[R][1].end;break}U=!0}for(v(n),k=I;k<e.events.length;)e.events[k][1].end={...D},k++;ba(e.events,R+1,0,e.events.slice(I)),e.events.length=k}}function v(S){let A=t.length;for(;A-- >S;){const C=t[A];e.containerState=C[1],C[0].exit.call(e,r)}t.length=S}function x(){i.write([null]),a=void 0,i=void 0,e.containerState._closeFlow=void 0}}function uW(r,e,t){return Hr(r,r.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function vu(r){if(r===null||vn(r)||ic(r))return 1;if(jf(r))return 2}function Hf(r,e,t){const n=[];let i=-1;for(;++i<r.length;){const a=r[i].resolveAll;a&&!n.includes(a)&&(e=a(e,t),n.push(a))}return e}const Tb={name:"attention",resolveAll:hW,tokenize:dW};function hW(r,e){let t=-1,n,i,a,s,o,l,c,u;for(;++t<r.length;)if(r[t][0]==="enter"&&r[t][1].type==="attentionSequence"&&r[t][1]._close){for(n=t;n--;)if(r[n][0]==="exit"&&r[n][1].type==="attentionSequence"&&r[n][1]._open&&e.sliceSerialize(r[n][1]).charCodeAt(0)===e.sliceSerialize(r[t][1]).charCodeAt(0)){if((r[n][1]._close||r[t][1]._open)&&(r[t][1].end.offset-r[t][1].start.offset)%3&&!((r[n][1].end.offset-r[n][1].start.offset+r[t][1].end.offset-r[t][1].start.offset)%3))continue;l=r[n][1].end.offset-r[n][1].start.offset>1&&r[t][1].end.offset-r[t][1].start.offset>1?2:1;const h={...r[n][1].end},d={...r[t][1].start};E8(h,-l),E8(d,l),s={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...r[n][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...r[t][1].start},end:d},a={type:l>1?"strongText":"emphasisText",start:{...r[n][1].end},end:{...r[t][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},r[n][1].end={...s.start},r[t][1].start={...o.end},c=[],r[n][1].end.offset-r[n][1].start.offset&&(c=Ba(c,[["enter",r[n][1],e],["exit",r[n][1],e]])),c=Ba(c,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",a,e]]),c=Ba(c,Hf(e.parser.constructs.insideSpan.null,r.slice(n+1,t),e)),c=Ba(c,[["exit",a,e],["enter",o,e],["exit",o,e],["exit",i,e]]),r[t][1].end.offset-r[t][1].start.offset?(u=2,c=Ba(c,[["enter",r[t][1],e],["exit",r[t][1],e]])):u=0,ba(r,n-1,t-n+3,c),t=n+c.length-u-2;break}}for(t=-1;++t<r.length;)r[t][1].type==="attentionSequence"&&(r[t][1].type="data");return r}function dW(r,e){const t=this.parser.constructs.attentionMarkers.null,n=this.previous,i=vu(n);let a;return s;function s(l){return a=l,r.enter("attentionSequence"),o(l)}function o(l){if(l===a)return r.consume(l),o;const c=r.exit("attentionSequence"),u=vu(l),h=!u||u===2&&i||t.includes(l),d=!i||i===2&&u||t.includes(n);return c._open=!!(a===42?h:h&&(i||!d)),c._close=!!(a===42?d:d&&(u||!h)),e(l)}}function E8(r,e){r.column+=e,r.offset+=e,r._bufferIndex+=e}const fW={name:"autolink",tokenize:gW};function gW(r,e,t){let n=0;return i;function i(f){return r.enter("autolink"),r.enter("autolinkMarker"),r.consume(f),r.exit("autolinkMarker"),r.enter("autolinkProtocol"),a}function a(f){return Ui(f)?(r.consume(f),s):f===64?t(f):c(f)}function s(f){return f===43||f===45||f===46||Ci(f)?(n=1,o(f)):c(f)}function o(f){return f===58?(r.consume(f),n=0,l):(f===43||f===45||f===46||Ci(f))&&n++<32?(r.consume(f),o):(n=0,c(f))}function l(f){return f===62?(r.exit("autolinkProtocol"),r.enter("autolinkMarker"),r.consume(f),r.exit("autolinkMarker"),r.exit("autolink"),e):f===null||f===32||f===60||zf(f)?t(f):(r.consume(f),l)}function c(f){return f===64?(r.consume(f),u):nW(f)?(r.consume(f),c):t(f)}function u(f){return Ci(f)?h(f):t(f)}function h(f){return f===46?(r.consume(f),n=0,u):f===62?(r.exit("autolinkProtocol").type="autolinkEmail",r.enter("autolinkMarker"),r.consume(f),r.exit("autolinkMarker"),r.exit("autolink"),e):d(f)}function d(f){if((f===45||Ci(f))&&n++<63){const p=f===45?d:h;return r.consume(f),p}return t(f)}}const ad={partial:!0,tokenize:pW};function pW(r,e,t){return n;function n(a){return Vr(a)?Hr(r,i,"linePrefix")(a):i(a)}function i(a){return a===null||Yt(a)?e(a):t(a)}}const T8={continuation:{tokenize:bW},exit:vW,name:"blockQuote",tokenize:mW};function mW(r,e,t){const n=this;return i;function i(s){if(s===62){const o=n.containerState;return o.open||(r.enter("blockQuote",{_container:!0}),o.open=!0),r.enter("blockQuotePrefix"),r.enter("blockQuoteMarker"),r.consume(s),r.exit("blockQuoteMarker"),a}return t(s)}function a(s){return Vr(s)?(r.enter("blockQuotePrefixWhitespace"),r.consume(s),r.exit("blockQuotePrefixWhitespace"),r.exit("blockQuotePrefix"),e):(r.exit("blockQuotePrefix"),e(s))}}function bW(r,e,t){const n=this;return i;function i(s){return Vr(s)?Hr(r,a,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return r.attempt(T8,e,t)(s)}}function vW(r){r.exit("blockQuote")}const I8={name:"characterEscape",tokenize:yW};function yW(r,e,t){return n;function n(a){return r.enter("characterEscape"),r.enter("escapeMarker"),r.consume(a),r.exit("escapeMarker"),i}function i(a){return aW(a)?(r.enter("characterEscapeValue"),r.consume(a),r.exit("characterEscapeValue"),r.exit("characterEscape"),e):t(a)}}const M8={name:"characterReference",tokenize:wW};function wW(r,e,t){const n=this;let i=0,a,s;return o;function o(h){return r.enter("characterReference"),r.enter("characterReferenceMarker"),r.consume(h),r.exit("characterReferenceMarker"),l}function l(h){return h===35?(r.enter("characterReferenceMarkerNumeric"),r.consume(h),r.exit("characterReferenceMarkerNumeric"),c):(r.enter("characterReferenceValue"),a=31,s=Ci,u(h))}function c(h){return h===88||h===120?(r.enter("characterReferenceMarkerHexadecimal"),r.consume(h),r.exit("characterReferenceMarkerHexadecimal"),r.enter("characterReferenceValue"),a=6,s=iW,u):(r.enter("characterReferenceValue"),a=7,s=Eb,u(h))}function u(h){if(h===59&&i){const d=r.exit("characterReferenceValue");return s===Ci&&!Cb(n.sliceSerialize(d))?t(h):(r.enter("characterReferenceMarker"),r.consume(h),r.exit("characterReferenceMarker"),r.exit("characterReference"),e)}return s(h)&&i++<a?(r.consume(h),u):t(h)}}const O8={partial:!0,tokenize:SW},N8={concrete:!0,name:"codeFenced",tokenize:xW};function xW(r,e,t){const n=this,i={partial:!0,tokenize:C};let a=0,s=0,o;return l;function l(k){return c(k)}function c(k){const I=n.events[n.events.length-1];return a=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,o=k,r.enter("codeFenced"),r.enter("codeFencedFence"),r.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===o?(s++,r.consume(k),u):s<3?t(k):(r.exit("codeFencedFenceSequence"),Vr(k)?Hr(r,h,"whitespace")(k):h(k))}function h(k){return k===null||Yt(k)?(r.exit("codeFencedFence"),n.interrupt?e(k):r.check(O8,m,A)(k)):(r.enter("codeFencedFenceInfo"),r.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===null||Yt(k)?(r.exit("chunkString"),r.exit("codeFencedFenceInfo"),h(k)):Vr(k)?(r.exit("chunkString"),r.exit("codeFencedFenceInfo"),Hr(r,f,"whitespace")(k)):k===96&&k===o?t(k):(r.consume(k),d)}function f(k){return k===null||Yt(k)?h(k):(r.enter("codeFencedFenceMeta"),r.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||Yt(k)?(r.exit("chunkString"),r.exit("codeFencedFenceMeta"),h(k)):k===96&&k===o?t(k):(r.consume(k),p)}function m(k){return r.attempt(i,A,y)(k)}function y(k){return r.enter("lineEnding"),r.consume(k),r.exit("lineEnding"),v}function v(k){return a>0&&Vr(k)?Hr(r,x,"linePrefix",a+1)(k):x(k)}function x(k){return k===null||Yt(k)?r.check(O8,m,A)(k):(r.enter("codeFlowValue"),S(k))}function S(k){return k===null||Yt(k)?(r.exit("codeFlowValue"),x(k)):(r.consume(k),S)}function A(k){return r.exit("codeFenced"),e(k)}function C(k,I,R){let U=0;return D;function D(Z){return k.enter("lineEnding"),k.consume(Z),k.exit("lineEnding"),$}function $(Z){return k.enter("codeFencedFence"),Vr(Z)?Hr(k,H,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):H(Z)}function H(Z){return Z===o?(k.enter("codeFencedFenceSequence"),V(Z)):R(Z)}function V(Z){return Z===o?(U++,k.consume(Z),V):U>=s?(k.exit("codeFencedFenceSequence"),Vr(Z)?Hr(k,z,"whitespace")(Z):z(Z)):R(Z)}function z(Z){return Z===null||Yt(Z)?(k.exit("codeFencedFence"),I(Z)):R(Z)}}}function SW(r,e,t){const n=this;return i;function i(s){return s===null?t(s):(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),a)}function a(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}const Ib={name:"codeIndented",tokenize:AW},kW={partial:!0,tokenize:_W};function AW(r,e,t){const n=this;return i;function i(c){return r.enter("codeIndented"),Hr(r,a,"linePrefix",5)(c)}function a(c){const u=n.events[n.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):t(c)}function s(c){return c===null?l(c):Yt(c)?r.attempt(kW,s,l)(c):(r.enter("codeFlowValue"),o(c))}function o(c){return c===null||Yt(c)?(r.exit("codeFlowValue"),s(c)):(r.consume(c),o)}function l(c){return r.exit("codeIndented"),e(c)}}function _W(r,e,t){const n=this;return i;function i(s){return n.parser.lazy[n.now().line]?t(s):Yt(s)?(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),i):Hr(r,a,"linePrefix",5)(s)}function a(s){const o=n.events[n.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(s):Yt(s)?i(s):t(s)}}const CW={name:"codeText",previous:TW,resolve:EW,tokenize:IW};function EW(r){let e=r.length-4,t=3,n,i;if((r[t][1].type==="lineEnding"||r[t][1].type==="space")&&(r[e][1].type==="lineEnding"||r[e][1].type==="space")){for(n=t;++n<e;)if(r[n][1].type==="codeTextData"){r[t][1].type="codeTextPadding",r[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(n=t-1,e++;++n<=e;)i===void 0?n!==e&&r[n][1].type!=="lineEnding"&&(i=n):(n===e||r[n][1].type==="lineEnding")&&(r[i][1].type="codeTextData",n!==i+2&&(r[i][1].end=r[n-1][1].end,r.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return r}function TW(r){return r!==96||this.events[this.events.length-1][1].type==="characterEscape"}function IW(r,e,t){let n=0,i,a;return s;function s(h){return r.enter("codeText"),r.enter("codeTextSequence"),o(h)}function o(h){return h===96?(r.consume(h),n++,o):(r.exit("codeTextSequence"),l(h))}function l(h){return h===null?t(h):h===32?(r.enter("space"),r.consume(h),r.exit("space"),l):h===96?(a=r.enter("codeTextSequence"),i=0,u(h)):Yt(h)?(r.enter("lineEnding"),r.consume(h),r.exit("lineEnding"),l):(r.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||Yt(h)?(r.exit("codeTextData"),l(h)):(r.consume(h),c)}function u(h){return h===96?(r.consume(h),i++,u):i===n?(r.exit("codeTextSequence"),r.exit("codeText"),e(h)):(a.type="codeTextData",c(h))}}class MW{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=t??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const i=t||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&sd(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),sd(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sd(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);sd(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);sd(this.left,t.reverse())}}}function sd(r,e){let t=0;if(e.length<1e4)r.push(...e);else for(;t<e.length;)r.push(...e.slice(t,t+1e4)),t+=1e4}function R8(r){const e={};let t=-1,n,i,a,s,o,l,c;const u=new MW(r);for(;++t<u.length;){for(;t in e;)t=e[t];if(n=u.get(t),t&&n[1].type==="chunkFlow"&&u.get(t-1)[1].type==="listItemPrefix"&&(l=n[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,OW(u,t)),t=e[t],c=!0);else if(n[1]._container){for(a=t,i=void 0;a--;)if(s=u.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(n[1].end={...u.get(i)[1].start},o=u.slice(i,t),o.unshift(n),u.splice(i,t-i+1,o))}}return ba(r,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function OW(r,e){const t=r.get(e)[1],n=r.get(e)[2];let i=e-1;const a=[];let s=t._tokenizer;s||(s=n.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,l=[],c={};let u,h,d=-1,f=t,p=0,m=0;const y=[m];for(;f;){for(;r.get(++i)[1]!==f;);a.push(i),f._tokenizer||(u=n.sliceStream(f),f.next||u.push(null),h&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=t;++d<o.length;)o[d][0]==="exit"&&o[d-1][0]==="enter"&&o[d][1].type===o[d-1][1].type&&o[d][1].start.line!==o[d][1].end.line&&(m=d+1,y.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),d=y.length;d--;){const v=o.slice(y[d],y[d+1]),x=a.pop();l.push([x,x+v.length-1]),r.splice(x,2,v)}for(l.reverse(),d=-1;++d<l.length;)c[p+l[d][0]]=p+l[d][1],p+=l[d][1]-l[d][0]-1;return c}const NW={resolve:PW,tokenize:FW},RW={partial:!0,tokenize:DW};function PW(r){return R8(r),r}function FW(r,e){let t;return n;function n(o){return r.enter("content"),t=r.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):Yt(o)?r.check(RW,s,a)(o):(r.consume(o),i)}function a(o){return r.exit("chunkContent"),r.exit("content"),e(o)}function s(o){return r.consume(o),r.exit("chunkContent"),t.next=r.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function DW(r,e,t){const n=this;return i;function i(s){return r.exit("chunkContent"),r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),Hr(r,a,"linePrefix")}function a(s){if(s===null||Yt(s))return t(s);const o=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(s):r.interrupt(n.parser.constructs.flow,t,e)(s)}}function P8(r,e,t,n,i,a,s,o,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return h;function h(v){return v===60?(r.enter(n),r.enter(i),r.enter(a),r.consume(v),r.exit(a),d):v===null||v===32||v===41||zf(v)?t(v):(r.enter(n),r.enter(s),r.enter(o),r.enter("chunkString",{contentType:"string"}),m(v))}function d(v){return v===62?(r.enter(a),r.consume(v),r.exit(a),r.exit(i),r.exit(n),e):(r.enter(o),r.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===62?(r.exit("chunkString"),r.exit(o),d(v)):v===null||v===60||Yt(v)?t(v):(r.consume(v),v===92?p:f)}function p(v){return v===60||v===62||v===92?(r.consume(v),f):f(v)}function m(v){return!u&&(v===null||v===41||vn(v))?(r.exit("chunkString"),r.exit(o),r.exit(s),r.exit(n),e(v)):u<c&&v===40?(r.consume(v),u++,m):v===41?(r.consume(v),u--,m):v===null||v===32||v===40||zf(v)?t(v):(r.consume(v),v===92?y:m)}function y(v){return v===40||v===41||v===92?(r.consume(v),m):m(v)}}function F8(r,e,t,n,i,a){const s=this;let o=0,l;return c;function c(f){return r.enter(n),r.enter(i),r.consume(f),r.exit(i),r.enter(a),u}function u(f){return o>999||f===null||f===91||f===93&&!l||f===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?t(f):f===93?(r.exit(a),r.enter(i),r.consume(f),r.exit(i),r.exit(n),e):Yt(f)?(r.enter("lineEnding"),r.consume(f),r.exit("lineEnding"),u):(r.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||Yt(f)||o++>999?(r.exit("chunkString"),u(f)):(r.consume(f),l||(l=!Vr(f)),f===92?d:h)}function d(f){return f===91||f===92||f===93?(r.consume(f),o++,h):h(f)}}function D8(r,e,t,n,i,a){let s;return o;function o(d){return d===34||d===39||d===40?(r.enter(n),r.enter(i),r.consume(d),r.exit(i),s=d===40?41:d,l):t(d)}function l(d){return d===s?(r.enter(i),r.consume(d),r.exit(i),r.exit(n),e):(r.enter(a),c(d))}function c(d){return d===s?(r.exit(a),l(s)):d===null?t(d):Yt(d)?(r.enter("lineEnding"),r.consume(d),r.exit("lineEnding"),Hr(r,c,"linePrefix")):(r.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===s||d===null||Yt(d)?(r.exit("chunkString"),c(d)):(r.consume(d),d===92?h:u)}function h(d){return d===s||d===92?(r.consume(d),u):u(d)}}function od(r,e){let t;return n;function n(i){return Yt(i)?(r.enter("lineEnding"),r.consume(i),r.exit("lineEnding"),t=!0,n):Vr(i)?Hr(r,n,t?"linePrefix":"lineSuffix")(i):e(i)}}const LW={name:"definition",tokenize:UW},BW={partial:!0,tokenize:zW};function UW(r,e,t){const n=this;let i;return a;function a(f){return r.enter("definition"),s(f)}function s(f){return F8.call(n,r,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=ts(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),f===58?(r.enter("definitionMarker"),r.consume(f),r.exit("definitionMarker"),l):t(f)}function l(f){return vn(f)?od(r,c)(f):c(f)}function c(f){return P8(r,u,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return r.attempt(BW,h,h)(f)}function h(f){return Vr(f)?Hr(r,d,"whitespace")(f):d(f)}function d(f){return f===null||Yt(f)?(r.exit("definition"),n.parser.defined.push(i),e(f)):t(f)}}function zW(r,e,t){return n;function n(o){return vn(o)?od(r,i)(o):t(o)}function i(o){return D8(r,a,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return Vr(o)?Hr(r,s,"whitespace")(o):s(o)}function s(o){return o===null||Yt(o)?e(o):t(o)}}const jW={name:"hardBreakEscape",tokenize:HW};function HW(r,e,t){return n;function n(a){return r.enter("hardBreakEscape"),r.consume(a),i}function i(a){return Yt(a)?(r.exit("hardBreakEscape"),e(a)):t(a)}}const qW={name:"headingAtx",resolve:GW,tokenize:WW};function GW(r,e){let t=r.length-2,n=3,i,a;return r[n][1].type==="whitespace"&&(n+=2),t-2>n&&r[t][1].type==="whitespace"&&(t-=2),r[t][1].type==="atxHeadingSequence"&&(n===t-1||t-4>n&&r[t-2][1].type==="whitespace")&&(t-=n+1===t?2:4),t>n&&(i={type:"atxHeadingText",start:r[n][1].start,end:r[t][1].end},a={type:"chunkText",start:r[n][1].start,end:r[t][1].end,contentType:"text"},ba(r,n,t-n+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),r}function WW(r,e,t){let n=0;return i;function i(u){return r.enter("atxHeading"),a(u)}function a(u){return r.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&n++<6?(r.consume(u),s):u===null||vn(u)?(r.exit("atxHeadingSequence"),o(u)):t(u)}function o(u){return u===35?(r.enter("atxHeadingSequence"),l(u)):u===null||Yt(u)?(r.exit("atxHeading"),e(u)):Vr(u)?Hr(r,o,"whitespace")(u):(r.enter("atxHeadingText"),c(u))}function l(u){return u===35?(r.consume(u),l):(r.exit("atxHeadingSequence"),o(u))}function c(u){return u===null||u===35||vn(u)?(r.exit("atxHeadingText"),o(u)):(r.consume(u),c)}}const VW=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],L8=["pre","script","style","textarea"],XW={concrete:!0,name:"htmlFlow",resolveTo:YW,tokenize:JW},$W={partial:!0,tokenize:ZW},KW={partial:!0,tokenize:QW};function YW(r){let e=r.length;for(;e--&&!(r[e][0]==="enter"&&r[e][1].type==="htmlFlow"););return e>1&&r[e-2][1].type==="linePrefix"&&(r[e][1].start=r[e-2][1].start,r[e+1][1].start=r[e-2][1].start,r.splice(e-2,2)),r}function JW(r,e,t){const n=this;let i,a,s,o,l;return c;function c(W){return u(W)}function u(W){return r.enter("htmlFlow"),r.enter("htmlFlowData"),r.consume(W),h}function h(W){return W===33?(r.consume(W),d):W===47?(r.consume(W),a=!0,m):W===63?(r.consume(W),i=3,n.interrupt?e:P):Ui(W)?(r.consume(W),s=String.fromCharCode(W),y):t(W)}function d(W){return W===45?(r.consume(W),i=2,f):W===91?(r.consume(W),i=5,o=0,p):Ui(W)?(r.consume(W),i=4,n.interrupt?e:P):t(W)}function f(W){return W===45?(r.consume(W),n.interrupt?e:P):t(W)}function p(W){const me="CDATA[";return W===me.charCodeAt(o++)?(r.consume(W),o===me.length?n.interrupt?e:H:p):t(W)}function m(W){return Ui(W)?(r.consume(W),s=String.fromCharCode(W),y):t(W)}function y(W){if(W===null||W===47||W===62||vn(W)){const me=W===47,He=s.toLowerCase();return!me&&!a&&L8.includes(He)?(i=1,n.interrupt?e(W):H(W)):VW.includes(s.toLowerCase())?(i=6,me?(r.consume(W),v):n.interrupt?e(W):H(W)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?t(W):a?x(W):S(W))}return W===45||Ci(W)?(r.consume(W),s+=String.fromCharCode(W),y):t(W)}function v(W){return W===62?(r.consume(W),n.interrupt?e:H):t(W)}function x(W){return Vr(W)?(r.consume(W),x):D(W)}function S(W){return W===47?(r.consume(W),D):W===58||W===95||Ui(W)?(r.consume(W),A):Vr(W)?(r.consume(W),S):D(W)}function A(W){return W===45||W===46||W===58||W===95||Ci(W)?(r.consume(W),A):C(W)}function C(W){return W===61?(r.consume(W),k):Vr(W)?(r.consume(W),C):S(W)}function k(W){return W===null||W===60||W===61||W===62||W===96?t(W):W===34||W===39?(r.consume(W),l=W,I):Vr(W)?(r.consume(W),k):R(W)}function I(W){return W===l?(r.consume(W),l=null,U):W===null||Yt(W)?t(W):(r.consume(W),I)}function R(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||vn(W)?C(W):(r.consume(W),R)}function U(W){return W===47||W===62||Vr(W)?S(W):t(W)}function D(W){return W===62?(r.consume(W),$):t(W)}function $(W){return W===null||Yt(W)?H(W):Vr(W)?(r.consume(W),$):t(W)}function H(W){return W===45&&i===2?(r.consume(W),q):W===60&&i===1?(r.consume(W),re):W===62&&i===4?(r.consume(W),be):W===63&&i===3?(r.consume(W),P):W===93&&i===5?(r.consume(W),ie):Yt(W)&&(i===6||i===7)?(r.exit("htmlFlowData"),r.check($W,_e,V)(W)):W===null||Yt(W)?(r.exit("htmlFlowData"),V(W)):(r.consume(W),H)}function V(W){return r.check(KW,z,_e)(W)}function z(W){return r.enter("lineEnding"),r.consume(W),r.exit("lineEnding"),Z}function Z(W){return W===null||Yt(W)?V(W):(r.enter("htmlFlowData"),H(W))}function q(W){return W===45?(r.consume(W),P):H(W)}function re(W){return W===47?(r.consume(W),s="",X):H(W)}function X(W){if(W===62){const me=s.toLowerCase();return L8.includes(me)?(r.consume(W),be):H(W)}return Ui(W)&&s.length<8?(r.consume(W),s+=String.fromCharCode(W),X):H(W)}function ie(W){return W===93?(r.consume(W),P):H(W)}function P(W){return W===62?(r.consume(W),be):W===45&&i===2?(r.consume(W),P):H(W)}function be(W){return W===null||Yt(W)?(r.exit("htmlFlowData"),_e(W)):(r.consume(W),be)}function _e(W){return r.exit("htmlFlow"),e(W)}}function QW(r,e,t){const n=this;return i;function i(s){return Yt(s)?(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),a):t(s)}function a(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}function ZW(r,e,t){return n;function n(i){return r.enter("lineEnding"),r.consume(i),r.exit("lineEnding"),r.attempt(ad,e,t)}}const eV={name:"htmlText",tokenize:tV};function tV(r,e,t){const n=this;let i,a,s;return o;function o(P){return r.enter("htmlText"),r.enter("htmlTextData"),r.consume(P),l}function l(P){return P===33?(r.consume(P),c):P===47?(r.consume(P),C):P===63?(r.consume(P),S):Ui(P)?(r.consume(P),R):t(P)}function c(P){return P===45?(r.consume(P),u):P===91?(r.consume(P),a=0,p):Ui(P)?(r.consume(P),x):t(P)}function u(P){return P===45?(r.consume(P),f):t(P)}function h(P){return P===null?t(P):P===45?(r.consume(P),d):Yt(P)?(s=h,re(P)):(r.consume(P),h)}function d(P){return P===45?(r.consume(P),f):h(P)}function f(P){return P===62?q(P):P===45?d(P):h(P)}function p(P){const be="CDATA[";return P===be.charCodeAt(a++)?(r.consume(P),a===be.length?m:p):t(P)}function m(P){return P===null?t(P):P===93?(r.consume(P),y):Yt(P)?(s=m,re(P)):(r.consume(P),m)}function y(P){return P===93?(r.consume(P),v):m(P)}function v(P){return P===62?q(P):P===93?(r.consume(P),v):m(P)}function x(P){return P===null||P===62?q(P):Yt(P)?(s=x,re(P)):(r.consume(P),x)}function S(P){return P===null?t(P):P===63?(r.consume(P),A):Yt(P)?(s=S,re(P)):(r.consume(P),S)}function A(P){return P===62?q(P):S(P)}function C(P){return Ui(P)?(r.consume(P),k):t(P)}function k(P){return P===45||Ci(P)?(r.consume(P),k):I(P)}function I(P){return Yt(P)?(s=I,re(P)):Vr(P)?(r.consume(P),I):q(P)}function R(P){return P===45||Ci(P)?(r.consume(P),R):P===47||P===62||vn(P)?U(P):t(P)}function U(P){return P===47?(r.consume(P),q):P===58||P===95||Ui(P)?(r.consume(P),D):Yt(P)?(s=U,re(P)):Vr(P)?(r.consume(P),U):q(P)}function D(P){return P===45||P===46||P===58||P===95||Ci(P)?(r.consume(P),D):$(P)}function $(P){return P===61?(r.consume(P),H):Yt(P)?(s=$,re(P)):Vr(P)?(r.consume(P),$):U(P)}function H(P){return P===null||P===60||P===61||P===62||P===96?t(P):P===34||P===39?(r.consume(P),i=P,V):Yt(P)?(s=H,re(P)):Vr(P)?(r.consume(P),H):(r.consume(P),z)}function V(P){return P===i?(r.consume(P),i=void 0,Z):P===null?t(P):Yt(P)?(s=V,re(P)):(r.consume(P),V)}function z(P){return P===null||P===34||P===39||P===60||P===61||P===96?t(P):P===47||P===62||vn(P)?U(P):(r.consume(P),z)}function Z(P){return P===47||P===62||vn(P)?U(P):t(P)}function q(P){return P===62?(r.consume(P),r.exit("htmlTextData"),r.exit("htmlText"),e):t(P)}function re(P){return r.exit("htmlTextData"),r.enter("lineEnding"),r.consume(P),r.exit("lineEnding"),X}function X(P){return Vr(P)?Hr(r,ie,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):ie(P)}function ie(P){return r.enter("htmlTextData"),s(P)}}const Mb={name:"labelEnd",resolveAll:aV,resolveTo:sV,tokenize:oV},rV={tokenize:lV},nV={tokenize:cV},iV={tokenize:uV};function aV(r){let e=-1;const t=[];for(;++e<r.length;){const n=r[e][1];if(t.push(r[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const i=n.type==="labelImage"?4:2;n.type="data",e+=i}}return r.length!==t.length&&ba(r,0,r.length,t),r}function sV(r,e){let t=r.length,n=0,i,a,s,o;for(;t--;)if(i=r[t][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;r[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(r[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=t,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(s=t);const l={type:r[a][1].type==="labelLink"?"link":"image",start:{...r[a][1].start},end:{...r[r.length-1][1].end}},c={type:"label",start:{...r[a][1].start},end:{...r[s][1].end}},u={type:"labelText",start:{...r[a+n+2][1].end},end:{...r[s-2][1].start}};return o=[["enter",l,e],["enter",c,e]],o=Ba(o,r.slice(a+1,a+n+3)),o=Ba(o,[["enter",u,e]]),o=Ba(o,Hf(e.parser.constructs.insideSpan.null,r.slice(a+n+4,s-3),e)),o=Ba(o,[["exit",u,e],r[s-2],r[s-1],["exit",c,e]]),o=Ba(o,r.slice(s+1)),o=Ba(o,[["exit",l,e]]),ba(r,a,r.length,o),r}function oV(r,e,t){const n=this;let i=n.events.length,a,s;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){a=n.events[i][1];break}return o;function o(d){return a?a._inactive?h(d):(s=n.parser.defined.includes(ts(n.sliceSerialize({start:a.end,end:n.now()}))),r.enter("labelEnd"),r.enter("labelMarker"),r.consume(d),r.exit("labelMarker"),r.exit("labelEnd"),l):t(d)}function l(d){return d===40?r.attempt(rV,u,s?u:h)(d):d===91?r.attempt(nV,u,s?c:h)(d):s?u(d):h(d)}function c(d){return r.attempt(iV,u,h)(d)}function u(d){return e(d)}function h(d){return a._balanced=!0,t(d)}}function lV(r,e,t){return n;function n(h){return r.enter("resource"),r.enter("resourceMarker"),r.consume(h),r.exit("resourceMarker"),i}function i(h){return vn(h)?od(r,a)(h):a(h)}function a(h){return h===41?u(h):P8(r,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return vn(h)?od(r,l)(h):u(h)}function o(h){return t(h)}function l(h){return h===34||h===39||h===40?D8(r,c,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):u(h)}function c(h){return vn(h)?od(r,u)(h):u(h)}function u(h){return h===41?(r.enter("resourceMarker"),r.consume(h),r.exit("resourceMarker"),r.exit("resource"),e):t(h)}}function cV(r,e,t){const n=this;return i;function i(o){return F8.call(n,r,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return n.parser.defined.includes(ts(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(o):t(o)}function s(o){return t(o)}}function uV(r,e,t){return n;function n(a){return r.enter("reference"),r.enter("referenceMarker"),r.consume(a),r.exit("referenceMarker"),i}function i(a){return a===93?(r.enter("referenceMarker"),r.consume(a),r.exit("referenceMarker"),r.exit("reference"),e):t(a)}}const hV={name:"labelStartImage",resolveAll:Mb.resolveAll,tokenize:dV};function dV(r,e,t){const n=this;return i;function i(o){return r.enter("labelImage"),r.enter("labelImageMarker"),r.consume(o),r.exit("labelImageMarker"),a}function a(o){return o===91?(r.enter("labelMarker"),r.consume(o),r.exit("labelMarker"),r.exit("labelImage"),s):t(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?t(o):e(o)}}const fV={name:"labelStartLink",resolveAll:Mb.resolveAll,tokenize:gV};function gV(r,e,t){const n=this;return i;function i(s){return r.enter("labelLink"),r.enter("labelMarker"),r.consume(s),r.exit("labelMarker"),r.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?t(s):e(s)}}const Ob={name:"lineEnding",tokenize:pV};function pV(r,e){return t;function t(n){return r.enter("lineEnding"),r.consume(n),r.exit("lineEnding"),Hr(r,e,"linePrefix")}}const qf={name:"thematicBreak",tokenize:mV};function mV(r,e,t){let n=0,i;return a;function a(c){return r.enter("thematicBreak"),s(c)}function s(c){return i=c,o(c)}function o(c){return c===i?(r.enter("thematicBreakSequence"),l(c)):n>=3&&(c===null||Yt(c))?(r.exit("thematicBreak"),e(c)):t(c)}function l(c){return c===i?(r.consume(c),n++,l):(r.exit("thematicBreakSequence"),Vr(c)?Hr(r,o,"whitespace")(c):o(c))}}const ea={continuation:{tokenize:wV},exit:SV,name:"list",tokenize:yV},bV={partial:!0,tokenize:kV},vV={partial:!0,tokenize:xV};function yV(r,e,t){const n=this,i=n.events[n.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(f){const p=n.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!n.containerState.marker||f===n.containerState.marker:Eb(f)){if(n.containerState.type||(n.containerState.type=p,r.enter(p,{_container:!0})),p==="listUnordered")return r.enter("listItemPrefix"),f===42||f===45?r.check(qf,t,c)(f):c(f);if(!n.interrupt||f===49)return r.enter("listItemPrefix"),r.enter("listItemValue"),l(f)}return t(f)}function l(f){return Eb(f)&&++s<10?(r.consume(f),l):(!n.interrupt||s<2)&&(n.containerState.marker?f===n.containerState.marker:f===41||f===46)?(r.exit("listItemValue"),c(f)):t(f)}function c(f){return r.enter("listItemMarker"),r.consume(f),r.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||f,r.check(ad,n.interrupt?t:u,r.attempt(bV,d,h))}function u(f){return n.containerState.initialBlankLine=!0,a++,d(f)}function h(f){return Vr(f)?(r.enter("listItemPrefixWhitespace"),r.consume(f),r.exit("listItemPrefixWhitespace"),d):t(f)}function d(f){return n.containerState.size=a+n.sliceSerialize(r.exit("listItemPrefix"),!0).length,e(f)}}function wV(r,e,t){const n=this;return n.containerState._closeFlow=void 0,r.check(ad,i,a);function i(o){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Hr(r,e,"listItemIndent",n.containerState.size+1)(o)}function a(o){return n.containerState.furtherBlankLines||!Vr(o)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(o)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,r.attempt(vV,e,s)(o))}function s(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,Hr(r,r.attempt(ea,e,t),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function xV(r,e,t){const n=this;return Hr(r,i,"listItemIndent",n.containerState.size+1);function i(a){const s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(a):t(a)}}function SV(r){r.exit(this.containerState.type)}function kV(r,e,t){const n=this;return Hr(r,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=n.events[n.events.length-1];return!Vr(a)&&s&&s[1].type==="listItemPrefixWhitespace"?e(a):t(a)}}const B8={name:"setextUnderline",resolveTo:AV,tokenize:_V};function AV(r,e){let t=r.length,n,i,a;for(;t--;)if(r[t][0]==="enter"){if(r[t][1].type==="content"){n=t;break}r[t][1].type==="paragraph"&&(i=t)}else r[t][1].type==="content"&&r.splice(t,1),!a&&r[t][1].type==="definition"&&(a=t);const s={type:"setextHeading",start:{...r[n][1].start},end:{...r[r.length-1][1].end}};return r[i][1].type="setextHeadingText",a?(r.splice(i,0,["enter",s,e]),r.splice(a+1,0,["exit",r[n][1],e]),r[n][1].end={...r[a][1].end}):r[n][1]=s,r.push(["exit",s,e]),r}function _V(r,e,t){const n=this;let i;return a;function a(c){let u=n.events.length,h;for(;u--;)if(n.events[u][1].type!=="lineEnding"&&n.events[u][1].type!=="linePrefix"&&n.events[u][1].type!=="content"){h=n.events[u][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||h)?(r.enter("setextHeadingLine"),i=c,s(c)):t(c)}function s(c){return r.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(r.consume(c),o):(r.exit("setextHeadingLineSequence"),Vr(c)?Hr(r,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Yt(c)?(r.exit("setextHeadingLine"),e(c)):t(c)}}const CV={tokenize:EV};function EV(r){const e=this,t=r.attempt(ad,n,r.attempt(this.parser.constructs.flowInitial,i,Hr(r,r.attempt(this.parser.constructs.flow,i,r.attempt(NW,i)),"linePrefix")));return t;function n(a){if(a===null){r.consume(a);return}return r.enter("lineEndingBlank"),r.consume(a),r.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function i(a){if(a===null){r.consume(a);return}return r.enter("lineEnding"),r.consume(a),r.exit("lineEnding"),e.currentConstruct=void 0,t}}const TV={resolveAll:z8()},IV=U8("string"),MV=U8("text");function U8(r){return{resolveAll:z8(r==="text"?OV:void 0),tokenize:e};function e(t){const n=this,i=this.parser.constructs[r],a=t.attempt(i,s,o);return s;function s(u){return c(u)?a(u):o(u)}function o(u){if(u===null){t.consume(u);return}return t.enter("data"),t.consume(u),l}function l(u){return c(u)?(t.exit("data"),a(u)):(t.consume(u),l)}function c(u){if(u===null)return!0;const h=i[u];let d=-1;if(h)for(;++d<h.length;){const f=h[d];if(!f.previous||f.previous.call(n,n.previous))return!0}return!1}}}function z8(r){return e;function e(t,n){let i=-1,a;for(;++i<=t.length;)a===void 0?t[i]&&t[i][1].type==="data"&&(a=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==a+2&&(t[a][1].end=t[i-1][1].end,t.splice(a+2,i-a-2),i=a+2),a=void 0);return r?r(t,n):t}}function OV(r,e){let t=0;for(;++t<=r.length;)if((t===r.length||r[t][1].type==="lineEnding")&&r[t-1][1].type==="data"){const n=r[t-1][1],i=e.sliceStream(n);let a=i.length,s=-1,o=0,l;for(;a--;){const c=i[a];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(c===-2)l=!0,o++;else if(c!==-1){a++;break}}if(e._contentTypeTextTrailing&&t===r.length&&(o=0),o){const c={type:t===r.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:n.start._bufferIndex+s,_index:n.start._index+a,line:n.end.line,column:n.end.column-o,offset:n.end.offset-o},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(r.splice(t,0,["enter",c,e],["exit",c,e]),t+=2)}t++}return r}const NV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:LW},disable:{null:[]},document:{42:ea,43:ea,45:ea,48:ea,49:ea,50:ea,51:ea,52:ea,53:ea,54:ea,55:ea,56:ea,57:ea,62:T8},flow:{35:qW,42:qf,45:[B8,qf],60:XW,61:B8,95:qf,96:N8,126:N8},flowInitial:{[-2]:Ib,[-1]:Ib,32:Ib},insideSpan:{null:[Tb,TV]},string:{38:M8,92:I8},text:{[-5]:Ob,[-4]:Ob,[-3]:Ob,33:hV,38:M8,42:Tb,60:[fW,eV],91:fV,92:[jW,I8],93:Mb,95:Tb,96:CW}},Symbol.toStringTag,{value:"Module"}));function RV(r,e,t){let n={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},a=[];let s=[],o=[];const l={attempt:I(C),check:I(k),consume:x,enter:S,exit:A,interrupt:I(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:p,parser:r,previous:null,sliceSerialize:d,sliceStream:f,write:h};let u=e.tokenize.call(c,l);return e.resolveAll&&a.push(e),c;function h($){return s=Ba(s,$),y(),s[s.length-1]!==null?[]:(R(e,0),c.events=Hf(a,c.events,c),c.events)}function d($,H){return FV(f($),H)}function f($){return PV(s,$)}function p(){const{_bufferIndex:$,_index:H,line:V,column:z,offset:Z}=n;return{_bufferIndex:$,_index:H,line:V,column:z,offset:Z}}function m($){i[$.line]=$.column,D()}function y(){let $;for(;n._index<s.length;){const H=s[n._index];if(typeof H=="string")for($=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===$&&n._bufferIndex<H.length;)v(H.charCodeAt(n._bufferIndex));else v(H)}}function v($){u=u($)}function x($){Yt($)?(n.line++,n.column=1,n.offset+=$===-3?2:1,D()):$!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=$}function S($,H){const V=H||{};return V.type=$,V.start=p(),c.events.push(["enter",V,c]),o.push(V),V}function A($){const H=o.pop();return H.end=p(),c.events.push(["exit",H,c]),H}function C($,H){R($,H.from)}function k($,H){H.restore()}function I($,H){return V;function V(z,Z,q){let re,X,ie,P;return Array.isArray(z)?_e(z):"tokenize"in z?_e([z]):be(z);function be(Xe){return Le;function Le(bt){const Ie=bt!==null&&Xe[bt],Ve=bt!==null&&Xe.null,We=[...Array.isArray(Ie)?Ie:Ie?[Ie]:[],...Array.isArray(Ve)?Ve:Ve?[Ve]:[]];return _e(We)(bt)}}function _e(Xe){return re=Xe,X=0,Xe.length===0?q:W(Xe[X])}function W(Xe){return Le;function Le(bt){return P=U(),ie=Xe,Xe.partial||(c.currentConstruct=Xe),Xe.name&&c.parser.constructs.disable.null.includes(Xe.name)?He():Xe.tokenize.call(H?Object.assign(Object.create(c),H):c,l,me,He)(bt)}}function me(Xe){return $(ie,P),Z}function He(Xe){return P.restore(),++X<re.length?W(re[X]):q}}}function R($,H){$.resolveAll&&!a.includes($)&&a.push($),$.resolve&&ba(c.events,H,c.events.length-H,$.resolve(c.events.slice(H),c)),$.resolveTo&&(c.events=$.resolveTo(c.events,c))}function U(){const $=p(),H=c.previous,V=c.currentConstruct,z=c.events.length,Z=Array.from(o);return{from:z,restore:q};function q(){n=$,c.previous=H,c.currentConstruct=V,c.events.length=z,o=Z,D()}}function D(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function PV(r,e){const t=e.start._index,n=e.start._bufferIndex,i=e.end._index,a=e.end._bufferIndex;let s;if(t===i)s=[r[t].slice(n,a)];else{if(s=r.slice(t,i),n>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(n):s.shift()}a>0&&s.push(r[i].slice(0,a))}return s}function FV(r,e){let t=-1;const n=[];let i;for(;++t<r.length;){const a=r[t];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
`;break}case-3:{s=`\r
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,n.push(s)}return n.join("")}function DV(r){const n={constructs:A8([NV,...(r||{}).extensions||[]]),content:i(sW),defined:[],document:i(lW),flow:i(CV),lazy:{},string:i(IV),text:i(MV)};return n;function i(a){return s;function s(o){return RV(n,a,o)}}}function LV(r){for(;!R8(r););return r}const j8=/[\0\t\n\r]/g;function BV(){let r=1,e="",t=!0,n;return i;function i(a,s,o){const l=[];let c,u,h,d,f;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),h=0,e="",t&&(a.charCodeAt(0)===65279&&h++,t=void 0);h<a.length;){if(j8.lastIndex=h,c=j8.exec(a),d=c&&c.index!==void 0?c.index:a.length,f=a.charCodeAt(d),!c){e=a.slice(h);break}if(f===10&&h===d&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),h<d&&(l.push(a.slice(h,d)),r+=d-h),f){case 0:{l.push(65533),r++;break}case 9:{for(u=Math.ceil(r/4)*4,l.push(-2);r++<u;)l.push(-1);break}case 10:{l.push(-4),r=1;break}default:n=!0,r=1}h=d+1}return o&&(n&&l.push(-5),e&&l.push(e),l.push(null)),l}}const UV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function H8(r){return r.replace(UV,zV)}function zV(r,e,t){if(e)return e;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),a=i===120||i===88;return _8(t.slice(a?2:1),a?16:10)}return Cb(t)||r}function Gf(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?q8(r.position):"start"in r||"end"in r?q8(r):"line"in r||"column"in r?Nb(r):""}function Nb(r){return G8(r&&r.line)+":"+G8(r&&r.column)}function q8(r){return Nb(r&&r.start)+"-"+Nb(r&&r.end)}function G8(r){return r&&typeof r=="number"?r:1}const W8={}.hasOwnProperty;function jV(r,e,t){return typeof e!="string"&&(t=e,e=void 0),HV(t)(LV(DV(t).document().write(BV()(r,e,!0))))}function HV(r){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ct),autolinkProtocol:U,autolinkEmail:U,atxHeading:a(ze),blockQuote:a(Ve),characterEscape:U,characterReference:U,codeFenced:a(We),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(We,s),codeText:a(Qe,s),codeTextData:U,data:U,codeFlowValue:U,definition:a(mt),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(Ke),hardBreakEscape:a(Ge),hardBreakTrailing:a(Ge),htmlFlow:a(ot,s),htmlFlowData:U,htmlText:a(ot,s),htmlTextData:U,image:a(lt),label:s,link:a(ct),listItem:a(St),listItemValue:d,listOrdered:a(Ct,h),listUnordered:a(Ct),paragraph:a(Ze),reference:W,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(ze),strong:a(nt),thematicBreak:a(kt)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:Ie,autolinkProtocol:bt,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:He,characterReferenceMarkerNumeric:He,characterReferenceValue:Xe,characterReference:Le,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:D,codeIndented:l(v),codeText:l(Z),codeTextData:D,data:D,definition:l(),definitionDestinationString:A,definitionLabelString:x,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(H),hardBreakTrailing:l(H),htmlFlow:l(V),htmlFlowData:D,htmlText:l(z),htmlTextData:D,image:l(re),label:ie,labelText:X,lineEnding:$,link:l(q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:me,resourceDestinationString:P,resourceTitleString:be,resource:_e,setextHeading:l(R),setextHeadingLineSequence:I,setextHeadingText:k,strong:l(),thematicBreak:l()}};V8(e,(r||{}).mdastExtensions||[]);const t={};return n;function n(Se){let Fe={type:"root",children:[]};const it={stack:[Fe],tokenStack:[],config:e,enter:o,exit:c,buffer:s,resume:u,data:t},yt=[];let $t=-1;for(;++$t<Se.length;)if(Se[$t][1].type==="listOrdered"||Se[$t][1].type==="listUnordered")if(Se[$t][0]==="enter")yt.push($t);else{const kr=yt.pop();$t=i(Se,kr,$t)}for($t=-1;++$t<Se.length;){const kr=e[Se[$t][0]];W8.call(kr,Se[$t][1].type)&&kr[Se[$t][1].type].call(Object.assign({sliceSerialize:Se[$t][2].sliceSerialize},it),Se[$t][1])}if(it.tokenStack.length>0){const kr=it.tokenStack[it.tokenStack.length-1];(kr[1]||X8).call(it,void 0,kr[0])}for(Fe.position={start:nl(Se.length>0?Se[0][1].start:{line:1,column:1,offset:0}),end:nl(Se.length>0?Se[Se.length-2][1].end:{line:1,column:1,offset:0})},$t=-1;++$t<e.transforms.length;)Fe=e.transforms[$t](Fe)||Fe;return Fe}function i(Se,Fe,it){let yt=Fe-1,$t=-1,kr=!1,Ar,mr,sn,Zr;for(;++yt<=it;){const Je=Se[yt];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?$t++:$t--,Zr=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(Ar&&!Zr&&!$t&&!sn&&(sn=yt),Zr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Zr=void 0}if(!$t&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||$t===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(Ar){let wt=yt;for(mr=void 0;wt--;){const Et=Se[wt];if(Et[1].type==="lineEnding"||Et[1].type==="lineEndingBlank"){if(Et[0]==="exit")continue;mr&&(Se[mr][1].type="lineEndingBlank",kr=!0),Et[1].type="lineEnding",mr=wt}else if(!(Et[1].type==="linePrefix"||Et[1].type==="blockQuotePrefix"||Et[1].type==="blockQuotePrefixWhitespace"||Et[1].type==="blockQuoteMarker"||Et[1].type==="listItemIndent"))break}sn&&(!mr||sn<mr)&&(Ar._spread=!0),Ar.end=Object.assign({},mr?Se[mr][1].start:Je[1].end),Se.splice(mr||yt,0,["exit",Ar,Je[2]]),yt++,it++}if(Je[1].type==="listItemPrefix"){const wt={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};Ar=wt,Se.splice(yt,0,["enter",wt,Je[2]]),yt++,it++,sn=void 0,Zr=!0}}}return Se[Fe][1]._spread=kr,it}function a(Se,Fe){return it;function it(yt){o.call(this,Se(yt),yt),Fe&&Fe.call(this,yt)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(Se,Fe,it){this.stack[this.stack.length-1].children.push(Se),this.stack.push(Se),this.tokenStack.push([Fe,it||void 0]),Se.position={start:nl(Fe.start),end:void 0}}function l(Se){return Fe;function Fe(it){Se&&Se.call(this,it),c.call(this,it)}}function c(Se,Fe){const it=this.stack.pop(),yt=this.tokenStack.pop();if(yt)yt[0].type!==Se.type&&(Fe?Fe.call(this,Se,yt[0]):(yt[1]||X8).call(this,Se,yt[0]));else throw new Error("Cannot close `"+Se.type+"` ("+Gf({start:Se.start,end:Se.end})+"): its not open");it.position.end=nl(Se.end)}function u(){return _b(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function d(Se){if(this.data.expectingFirstListItemValue){const Fe=this.stack[this.stack.length-2];Fe.start=Number.parseInt(this.sliceSerialize(Se),10),this.data.expectingFirstListItemValue=void 0}}function f(){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.lang=Se}function p(){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.meta=Se}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.value=Se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.value=Se.replace(/(\r?\n|\r)$/g,"")}function x(Se){const Fe=this.resume(),it=this.stack[this.stack.length-1];it.label=Fe,it.identifier=ts(this.sliceSerialize(Se)).toLowerCase()}function S(){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.title=Se}function A(){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.url=Se}function C(Se){const Fe=this.stack[this.stack.length-1];if(!Fe.depth){const it=this.sliceSerialize(Se).length;Fe.depth=it}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function I(Se){const Fe=this.stack[this.stack.length-1];Fe.depth=this.sliceSerialize(Se).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function U(Se){const it=this.stack[this.stack.length-1].children;let yt=it[it.length-1];(!yt||yt.type!=="text")&&(yt=ht(),yt.position={start:nl(Se.start),end:void 0},it.push(yt)),this.stack.push(yt)}function D(Se){const Fe=this.stack.pop();Fe.value+=this.sliceSerialize(Se),Fe.position.end=nl(Se.end)}function $(Se){const Fe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const it=Fe.children[Fe.children.length-1];it.position.end=nl(Se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Fe.type)&&(U.call(this,Se),D.call(this,Se))}function H(){this.data.atHardBreak=!0}function V(){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.value=Se}function z(){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.value=Se}function Z(){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.value=Se}function q(){const Se=this.stack[this.stack.length-1];if(this.data.inReference){const Fe=this.data.referenceType||"shortcut";Se.type+="Reference",Se.referenceType=Fe,delete Se.url,delete Se.title}else delete Se.identifier,delete Se.label;this.data.referenceType=void 0}function re(){const Se=this.stack[this.stack.length-1];if(this.data.inReference){const Fe=this.data.referenceType||"shortcut";Se.type+="Reference",Se.referenceType=Fe,delete Se.url,delete Se.title}else delete Se.identifier,delete Se.label;this.data.referenceType=void 0}function X(Se){const Fe=this.sliceSerialize(Se),it=this.stack[this.stack.length-2];it.label=H8(Fe),it.identifier=ts(Fe).toLowerCase()}function ie(){const Se=this.stack[this.stack.length-1],Fe=this.resume(),it=this.stack[this.stack.length-1];if(this.data.inReference=!0,it.type==="link"){const yt=Se.children;it.children=yt}else it.alt=Fe}function P(){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.url=Se}function be(){const Se=this.resume(),Fe=this.stack[this.stack.length-1];Fe.title=Se}function _e(){this.data.inReference=void 0}function W(){this.data.referenceType="collapsed"}function me(Se){const Fe=this.resume(),it=this.stack[this.stack.length-1];it.label=Fe,it.identifier=ts(this.sliceSerialize(Se)).toLowerCase(),this.data.referenceType="full"}function He(Se){this.data.characterReferenceType=Se.type}function Xe(Se){const Fe=this.sliceSerialize(Se),it=this.data.characterReferenceType;let yt;it?(yt=_8(Fe,it==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):yt=Cb(Fe);const $t=this.stack[this.stack.length-1];$t.value+=yt}function Le(Se){const Fe=this.stack.pop();Fe.position.end=nl(Se.end)}function bt(Se){D.call(this,Se);const Fe=this.stack[this.stack.length-1];Fe.url=this.sliceSerialize(Se)}function Ie(Se){D.call(this,Se);const Fe=this.stack[this.stack.length-1];Fe.url="mailto:"+this.sliceSerialize(Se)}function Ve(){return{type:"blockquote",children:[]}}function We(){return{type:"code",lang:null,meta:null,value:""}}function Qe(){return{type:"inlineCode",value:""}}function mt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ke(){return{type:"emphasis",children:[]}}function ze(){return{type:"heading",depth:0,children:[]}}function Ge(){return{type:"break"}}function ot(){return{type:"html",value:""}}function lt(){return{type:"image",title:null,url:"",alt:null}}function ct(){return{type:"link",title:null,url:"",children:[]}}function Ct(Se){return{type:"list",ordered:Se.type==="listOrdered",start:null,spread:Se._spread,children:[]}}function St(Se){return{type:"listItem",spread:Se._spread,checked:null,children:[]}}function Ze(){return{type:"paragraph",children:[]}}function nt(){return{type:"strong",children:[]}}function ht(){return{type:"text",value:""}}function kt(){return{type:"thematicBreak"}}}function nl(r){return{line:r.line,column:r.column,offset:r.offset}}function V8(r,e){let t=-1;for(;++t<e.length;){const n=e[t];Array.isArray(n)?V8(r,n):qV(r,n)}}function qV(r,e){let t;for(t in e)if(W8.call(e,t))switch(t){case"canContainEols":{const n=e[t];n&&r[t].push(...n);break}case"transforms":{const n=e[t];n&&r[t].push(...n);break}case"enter":case"exit":{const n=e[t];n&&Object.assign(r[t],n);break}}}function X8(r,e){throw r?new Error("Cannot close `"+r.type+"` ("+Gf({start:r.start,end:r.end})+"): a different token (`"+e.type+"`, "+Gf({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Gf({start:e.start,end:e.end})+") is still open")}function GV(r){const e=this;e.parser=t;function t(n){return jV(n,{...e.data("settings"),...r,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}const $8={}.hasOwnProperty;function K8(r,e){const t=e||{};function n(i,...a){let s=n.invalid;const o=n.handlers;if(i&&$8.call(i,r)){const l=String(i[r]);s=$8.call(o,l)?o[l]:n.unknown}if(s)return s.call(this,i,...a)}return n.handlers=t.handlers||{},n.invalid=t.invalid,n.unknown=t.unknown,n}const WV={}.hasOwnProperty;function Y8(r,e){let t=-1,n;if(e.extensions)for(;++t<e.extensions.length;)Y8(r,e.extensions[t]);for(n in e)if(WV.call(e,n))switch(n){case"extensions":break;case"unsafe":{J8(r[n],e[n]);break}case"join":{J8(r[n],e[n]);break}case"handlers":{VV(r[n],e[n]);break}default:r.options[n]=e[n]}return r}function J8(r,e){e&&r.push(...e)}function VV(r,e){e&&Object.assign(r,e)}function XV(r,e,t,n){const i=t.enter("blockquote"),a=t.createTracker(n);a.move("> "),a.shift(2);const s=t.indentLines(t.containerFlow(r,a.current()),$V);return i(),s}function $V(r,e,t){return">"+(t?"":" ")+r}function Q8(r,e){return Z8(r,e.inConstruct,!0)&&!Z8(r,e.notInConstruct,!1)}function Z8(r,e,t){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return t;let n=-1;for(;++n<e.length;)if(r.includes(e[n]))return!0;return!1}function ew(r,e,t,n){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
`&&Q8(t.stack,t.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
`}function tw(r,e){const t=String(r);let n=t.indexOf(e),i=n,a=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++a>s&&(s=a):a=1,i=n+e.length,n=t.indexOf(e,i);return s}function Rb(r,e){return!!(e.options.fences===!1&&r.value&&!r.lang&&/[^ \r\n]/.test(r.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(r.value))}function KV(r){const e=r.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function YV(r,e,t,n){const i=KV(t),a=r.value||"",s=i==="`"?"GraveAccent":"Tilde";if(Rb(r,t)){const h=t.enter("codeIndented"),d=t.indentLines(a,JV);return h(),d}const o=t.createTracker(n),l=i.repeat(Math.max(tw(a,i)+1,3)),c=t.enter("codeFenced");let u=o.move(l);if(r.lang){const h=t.enter(`codeFencedLang${s}`);u+=o.move(t.safe(r.lang,{before:u,after:" ",encode:["`"],...o.current()})),h()}if(r.lang&&r.meta){const h=t.enter(`codeFencedMeta${s}`);u+=o.move(" "),u+=o.move(t.safe(r.meta,{before:u,after:`
`,encode:["`"],...o.current()})),h()}return u+=o.move(`
`),a&&(u+=o.move(a+`
`)),u+=o.move(l),c(),u}function JV(r,e,t){return(t?"":" ")+r}function Pb(r){const e=r.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function QV(r,e,t,n){const i=Pb(t),a=i==='"'?"Quote":"Apostrophe",s=t.enter("definition");let o=t.enter("label");const l=t.createTracker(n);let c=l.move("[");return c+=l.move(t.safe(t.associationId(r),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!r.url||/[\0- \u007F]/.test(r.url)?(o=t.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(t.safe(r.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=t.enter("destinationRaw"),c+=l.move(t.safe(r.url,{before:c,after:r.title?" ":`
`,...l.current()}))),o(),r.title&&(o=t.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(t.safe(r.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),s(),c}function ZV(r){const e=r.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function il(r){return"&#x"+r.toString(16).toUpperCase()+";"}function Wf(r,e,t){const n=vu(r),i=vu(e);return n===void 0?i===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}rw.peek=eX;function rw(r,e,t,n){const i=ZV(t),a=t.enter("emphasis"),s=t.createTracker(n),o=s.move(i);let l=s.move(t.containerPhrasing(r,{after:i,before:o,...s.current()}));const c=l.charCodeAt(0),u=Wf(n.before.charCodeAt(n.before.length-1),c,i);u.inside&&(l=il(c)+l.slice(1));const h=l.charCodeAt(l.length-1),d=Wf(n.after.charCodeAt(0),h,i);d.inside&&(l=l.slice(0,-1)+il(h));const f=s.move(i);return a(),t.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},o+l+f}function eX(r,e,t){return t.options.emphasis||"*"}const ld=function(r){if(r==null)return iX;if(typeof r=="function")return Vf(r);if(typeof r=="object")return Array.isArray(r)?tX(r):rX(r);if(typeof r=="string")return nX(r);throw new Error("Expected function, string, or object as test")};function tX(r){const e=[];let t=-1;for(;++t<r.length;)e[t]=ld(r[t]);return Vf(n);function n(...i){let a=-1;for(;++a<e.length;)if(e[a].apply(this,i))return!0;return!1}}function rX(r){const e=r;return Vf(t);function t(n){const i=n;let a;for(a in r)if(i[a]!==e[a])return!1;return!0}}function nX(r){return Vf(e);function e(t){return t&&t.type===r}}function Vf(r){return e;function e(t,n,i){return!!(aX(t)&&r.call(this,t,typeof n=="number"?n:void 0,i||void 0))}}function iX(){return!0}function aX(r){return r!==null&&typeof r=="object"&&"type"in r}function Aie(r){return r}const nw=[],sX=!0,Fb=!1,iw="skip";function Db(r,e,t,n){let i;typeof e=="function"&&typeof t!="function"?(n=t,t=e):i=e;const a=ld(i),s=n?-1:1;o(r,void 0,[])();function o(l,c,u){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const f=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return d;function d(){let f=nw,p,m,y;if((!e||a(l,c,u[u.length-1]||void 0))&&(f=oX(t(l,u)),f[0]===Fb))return f;if("children"in l&&l.children){const v=l;if(v.children&&f[0]!==iw)for(m=(n?v.children.length:-1)+s,y=u.concat(v);m>-1&&m<v.children.length;){const x=v.children[m];if(p=o(x,m,y)(),p[0]===Fb)return p;m=typeof p[1]=="number"?p[1]:m+s}}return f}}}function oX(r){return Array.isArray(r)?r:typeof r=="number"?[sX,r]:r==null?nw:[r]}function Xf(r,e,t,n){let i,a,s;typeof e=="function"&&typeof t!="function"?(a=void 0,s=e,i=t):(a=e,s=t,i=n),Db(r,a,o,i);function o(l,c){const u=c[c.length-1],h=u?u.children.indexOf(l):void 0;return s(l,h,u)}}function aw(r,e){let t=!1;return Xf(r,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return t=!0,Fb}),!!((!r.depth||r.depth<3)&&_b(r)&&(e.options.setext||t))}function lX(r,e,t,n){const i=Math.max(Math.min(6,r.depth||1),1),a=t.createTracker(n);if(aw(r,t)){const u=t.enter("headingSetext"),h=t.enter("phrasing"),d=t.containerPhrasing(r,{...a.current(),before:`
`,after:`
`});return h(),u(),d+`
`+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
`))+1))}const s="#".repeat(i),o=t.enter("headingAtx"),l=t.enter("phrasing");a.move(s+" ");let c=t.containerPhrasing(r,{before:"# ",after:`
`,...a.current()});return/^[\t ]/.test(c)&&(c=il(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,t.options.closeAtx&&(c+=" "+s),l(),o(),c}sw.peek=cX;function sw(r){return r.value||""}function cX(){return"<"}ow.peek=uX;function ow(r,e,t,n){const i=Pb(t),a=i==='"'?"Quote":"Apostrophe",s=t.enter("image");let o=t.enter("label");const l=t.createTracker(n);let c=l.move("![");return c+=l.move(t.safe(r.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!r.url&&r.title||/[\0- \u007F]/.test(r.url)?(o=t.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(t.safe(r.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=t.enter("destinationRaw"),c+=l.move(t.safe(r.url,{before:c,after:r.title?" ":")",...l.current()}))),o(),r.title&&(o=t.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(t.safe(r.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),c+=l.move(")"),s(),c}function uX(){return"!"}lw.peek=hX;function lw(r,e,t,n){const i=r.referenceType,a=t.enter("imageReference");let s=t.enter("label");const o=t.createTracker(n);let l=o.move("![");const c=t.safe(r.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=t.stack;t.stack=[],s=t.enter("reference");const h=t.safe(t.associationId(r),{before:l,after:"]",...o.current()});return s(),t.stack=u,a(),i==="full"||!c||c!==h?l+=o.move(h+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function hX(){return"!"}cw.peek=dX;function cw(r,e,t){let n=r.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++a<t.unsafe.length;){const s=t.unsafe[a],o=t.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(n);){let c=l.index;n.charCodeAt(c)===10&&n.charCodeAt(c-1)===13&&c--,n=n.slice(0,c)+" "+n.slice(l.index+1)}}return i+n+i}function dX(){return"`"}function uw(r,e){const t=_b(r);return!!(!e.options.resourceLink&&r.url&&!r.title&&r.children&&r.children.length===1&&r.children[0].type==="text"&&(t===r.url||"mailto:"+t===r.url)&&/^[a-z][a-z+.-]+:/i.test(r.url)&&!/[\0- <>\u007F]/.test(r.url))}hw.peek=fX;function hw(r,e,t,n){const i=Pb(t),a=i==='"'?"Quote":"Apostrophe",s=t.createTracker(n);let o,l;if(uw(r,t)){const u=t.stack;t.stack=[],o=t.enter("autolink");let h=s.move("<");return h+=s.move(t.containerPhrasing(r,{before:h,after:">",...s.current()})),h+=s.move(">"),o(),t.stack=u,h}o=t.enter("link"),l=t.enter("label");let c=s.move("[");return c+=s.move(t.containerPhrasing(r,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!r.url&&r.title||/[\0- \u007F]/.test(r.url)?(l=t.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(t.safe(r.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=t.enter("destinationRaw"),c+=s.move(t.safe(r.url,{before:c,after:r.title?" ":")",...s.current()}))),l(),r.title&&(l=t.enter(`title${a}`),c+=s.move(" "+i),c+=s.move(t.safe(r.title,{before:c,after:i,...s.current()})),c+=s.move(i),l()),c+=s.move(")"),o(),c}function fX(r,e,t){return uw(r,t)?"<":"["}dw.peek=gX;function dw(r,e,t,n){const i=r.referenceType,a=t.enter("linkReference");let s=t.enter("label");const o=t.createTracker(n);let l=o.move("[");const c=t.containerPhrasing(r,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=t.stack;t.stack=[],s=t.enter("reference");const h=t.safe(t.associationId(r),{before:l,after:"]",...o.current()});return s(),t.stack=u,a(),i==="full"||!c||c!==h?l+=o.move(h+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function gX(){return"["}function Lb(r){const e=r.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function pX(r){const e=Lb(r),t=r.options.bulletOther;if(!t)return e==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+t+"`) to be different");return t}function mX(r){const e=r.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function fw(r){const e=r.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function bX(r,e,t,n){const i=t.enter("list"),a=t.bulletCurrent;let s=r.ordered?mX(t):Lb(t);const o=r.ordered?s==="."?")":".":pX(t);let l=e&&t.bulletLastUsed?s===t.bulletLastUsed:!1;if(!r.ordered){const u=r.children?r.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),fw(t)===s&&u){let h=-1;for(;++h<r.children.length;){const d=r.children[h];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=o),t.bulletCurrent=s;const c=t.containerFlow(r,n);return t.bulletLastUsed=s,t.bulletCurrent=a,i(),c}function vX(r){const e=r.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function yX(r,e,t,n){const i=vX(t);let a=t.bulletCurrent||Lb(t);e&&e.type==="list"&&e.ordered&&(a=(typeof e.start=="number"&&e.start>-1?e.start:1)+(t.options.incrementListMarker===!1?0:e.children.indexOf(r))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||r.spread))&&(s=Math.ceil(s/4)*4);const o=t.createTracker(n);o.move(a+" ".repeat(s-a.length)),o.shift(s);const l=t.enter("listItem"),c=t.indentLines(t.containerFlow(r,o.current()),u);return l(),c;function u(h,d,f){return d?(f?"":" ".repeat(s))+h:(f?a:a+" ".repeat(s-a.length))+h}}function wX(r,e,t,n){const i=t.enter("paragraph"),a=t.enter("phrasing"),s=t.containerPhrasing(r,n);return a(),i(),s}const xX=ld(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function SX(r,e,t,n){return(r.children.some(function(s){return xX(s)})?t.containerPhrasing:t.containerFlow).call(t,r,n)}function kX(r){const e=r.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}gw.peek=AX;function gw(r,e,t,n){const i=kX(t),a=t.enter("strong"),s=t.createTracker(n),o=s.move(i+i);let l=s.move(t.containerPhrasing(r,{after:i,before:o,...s.current()}));const c=l.charCodeAt(0),u=Wf(n.before.charCodeAt(n.before.length-1),c,i);u.inside&&(l=il(c)+l.slice(1));const h=l.charCodeAt(l.length-1),d=Wf(n.after.charCodeAt(0),h,i);d.inside&&(l=l.slice(0,-1)+il(h));const f=s.move(i+i);return a(),t.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},o+l+f}function AX(r,e,t){return t.options.strong||"*"}function _X(r,e,t,n){return t.safe(r.value,n)}function CX(r){const e=r.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function EX(r,e,t){const n=(fw(t)+(t.options.ruleSpaces?" ":"")).repeat(CX(t));return t.options.ruleSpaces?n.slice(0,-1):n}const Bb={blockquote:XV,break:ew,code:YV,definition:QV,emphasis:rw,hardBreak:ew,heading:lX,html:sw,image:ow,imageReference:lw,inlineCode:cw,link:hw,linkReference:dw,list:bX,listItem:yX,paragraph:wX,root:SX,strong:gw,text:_X,thematicBreak:EX},TX=[IX];function IX(r,e,t,n){if(e.type==="code"&&Rb(e,n)&&(r.type==="list"||r.type===e.type&&Rb(r,n)))return!1;if("spread"in t&&typeof t.spread=="boolean")return r.type==="paragraph"&&(r.type===e.type||e.type==="definition"||e.type==="heading"&&aw(e,n))?void 0:t.spread?1:0}const ac=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],MX=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:ac},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:ac},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:ac},{atBreak:!0,character:"+",after:`(?:[ \r
])`},{atBreak:!0,character:"-",after:`(?:[ \r
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:ac},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:ac},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:ac},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:ac},{atBreak:!0,character:"~"}];function OX(r){return r.label||!r.identifier?r.label||"":H8(r.identifier)}function NX(r){if(!r._compiled){const e=(r.atBreak?"[\\r\\n][\\t ]*":"")+(r.before?"(?:"+r.before+")":"");r._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(r.character)?"\\":"")+r.character+(r.after?"(?:"+r.after+")":""),"g")}return r._compiled}function RX(r,e,t){const n=e.indexStack,i=r.children||[],a=[];let s=-1,o=t.before,l;n.push(-1);let c=e.createTracker(t);for(;++s<i.length;){const u=i[s];let h;if(n[n.length-1]=s,s+1<i.length){let p=e.handle.handlers[i[s+1].type];p&&p.peek&&(p=p.peek),h=p?p(i[s+1],r,e,{before:"",after:"",...c.current()}).charAt(0):""}else h=t.after;a.length>0&&(o==="\r"||o===`
`)&&u.type==="html"&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/," "),o=" ",c=e.createTracker(t),c.move(a.join("")));let d=e.handle(u,r,e,{...c.current(),after:h,before:o});l&&l===d.slice(0,1)&&(d=il(l.charCodeAt(0))+d.slice(1));const f=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,l=void 0,f&&(a.length>0&&f.before&&o===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+il(o.charCodeAt(0))),f.after&&(l=h)),c.move(d),a.push(d),o=d.slice(-1)}return n.pop(),a.join("")}function PX(r,e,t){const n=e.indexStack,i=r.children||[],a=e.createTracker(t),s=[];let o=-1;for(n.push(-1);++o<i.length;){const l=i[o];n[n.length-1]=o,s.push(a.move(e.handle(l,r,e,{before:`
`,after:`
`,...a.current()}))),l.type!=="list"&&(e.bulletLastUsed=void 0),o<i.length-1&&s.push(a.move(FX(l,i[o+1],r,e)))}return n.pop(),s.join("")}function FX(r,e,t,n){let i=n.join.length;for(;i--;){const a=n.join[i](r,e,t,n);if(a===!0||a===1)break;if(typeof a=="number")return`
`.repeat(1+a);if(a===!1)return`
<!---->
`}return`
`}const DX=/\r?\n|\r/g;function LX(r,e){const t=[];let n=0,i=0,a;for(;a=DX.exec(r);)s(r.slice(n,a.index)),t.push(a[0]),n=a.index+a[0].length,i++;return s(r.slice(n)),t.join("");function s(o){t.push(e(o,i,!o))}}function BX(r,e,t){const n=(t.before||"")+(e||"")+(t.after||""),i=[],a=[],s={};let o=-1;for(;++o<r.unsafe.length;){const u=r.unsafe[o];if(!Q8(r.stack,u))continue;const h=r.compilePattern(u);let d;for(;d=h.exec(n);){const f="before"in u||!!u.atBreak,p="after"in u,m=d.index+(f?d[1].length:0);i.includes(m)?(s[m].before&&!f&&(s[m].before=!1),s[m].after&&!p&&(s[m].after=!1)):(i.push(m),s[m]={before:f,after:p})}}i.sort(UX);let l=t.before?t.before.length:0;const c=n.length-(t.after?t.after.length:0);for(o=-1;++o<i.length;){const u=i[o];u<l||u>=c||u+1<c&&i[o+1]===u+1&&s[u].after&&!s[u+1].before&&!s[u+1].after||i[o-1]===u-1&&s[u].before&&!s[u-1].before&&!s[u-1].after||(l!==u&&a.push(pw(n.slice(l,u),"\\")),l=u,/[!-/:-@[-`{-~]/.test(n.charAt(u))&&(!t.encode||!t.encode.includes(n.charAt(u)))?a.push("\\"):(a.push(il(n.charCodeAt(u))),l++))}return a.push(pw(n.slice(l,c),t.after)),a.join("")}function UX(r,e){return r-e}function pw(r,e){const t=/\\(?=[!-/:-@[-`{-~])/g,n=[],i=[],a=r+e;let s=-1,o=0,l;for(;l=t.exec(a);)n.push(l.index);for(;++s<n.length;)o!==n[s]&&i.push(r.slice(o,n[s])),i.push("\\"),o=n[s];return i.push(r.slice(o)),i.join("")}function zX(r){const e=r||{},t=e.now||{};let n=e.lineShift||0,i=t.line||1,a=t.column||1;return{move:l,current:s,shift:o};function s(){return{now:{line:i,column:a},lineShift:n}}function o(c){n+=c}function l(c){const u=c||"",h=u.split(/\r?\n|\r/g),d=h[h.length-1];return i+=h.length-1,a=h.length===1?a+d.length:1+d.length+n,u}}function jX(r,e){const t=e||{},n={associationId:OX,containerPhrasing:WX,containerFlow:VX,createTracker:zX,compilePattern:NX,enter:a,handlers:{...Bb},handle:void 0,indentLines:LX,indexStack:[],join:[...TX],options:{},safe:XX,stack:[],unsafe:[...MX]};Y8(n,t),n.options.tightDefinitions&&n.join.push(GX),n.handle=K8("type",{invalid:HX,unknown:qX,handlers:n.handlers});let i=n.handle(r,void 0,n,{before:`
`,after:`
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
`),i;function a(s){return n.stack.push(s),o;function o(){n.stack.pop()}}}function HX(r){throw new Error("Cannot handle value `"+r+"`, expected node")}function qX(r){const e=r;throw new Error("Cannot handle unknown node `"+e.type+"`")}function GX(r,e){if(r.type==="definition"&&r.type===e.type)return 0}function WX(r,e){return RX(r,this,e)}function VX(r,e){return PX(r,this,e)}function XX(r,e){return BX(this,r,e)}function $X(r){const e=this;e.compiler=t;function t(n){return jX(n,{...e.data("settings"),...r,extensions:e.data("toMarkdownExtensions")||[]})}}function mw(r){if(r)throw r}var Ub,bw;function KX(){if(bw)return Ub;bw=1;var r=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},a=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var u=r.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&r.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!h)return!1;var d;for(d in c);return typeof d>"u"||r.call(c,d)},s=function(c,u){t&&u.name==="__proto__"?t(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},o=function(c,u){if(u==="__proto__")if(r.call(c,u)){if(n)return n(c,u).value}else return;return c[u]};return Ub=function l(){var c,u,h,d,f,p,m=arguments[0],y=1,v=arguments.length,x=!1;for(typeof m=="boolean"&&(x=m,m=arguments[1]||{},y=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});y<v;++y)if(c=arguments[y],c!=null)for(u in c)h=o(m,u),d=o(c,u),m!==d&&(x&&d&&(a(d)||(f=i(d)))?(f?(f=!1,p=h&&i(h)?h:[]):p=h&&a(h)?h:{},s(m,{name:u,newValue:l(x,p,d)})):typeof d<"u"&&s(m,{name:u,newValue:d}));return m},Ub}var YX=KX();const zb=x0(YX);function _ie(){}function jb(r){if(typeof r!="object"||r===null)return!1;const e=Object.getPrototypeOf(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)}function JX(){const r=[],e={run:t,use:n};return e;function t(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...i);function o(l,...c){const u=r[++a];let h=-1;if(l){s(l);return}for(;++h<i.length;)(c[h]===null||c[h]===void 0)&&(c[h]=i[h]);i=c,u?QX(u,o)(...c):s(null,...c)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return r.push(i),e}}function QX(r,e){let t;return n;function n(...s){const o=r.length>s.length;let l;o&&s.push(i);try{l=r.apply(this,s)}catch(c){const u=c;if(o&&t)throw u;return i(u)}o||(l&&l.then&&typeof l.then=="function"?l.then(a,i):l instanceof Error?i(l):a(l))}function i(s,...o){t||(t=!0,e(s,...o))}function a(s){i(null,s)}}function ZX(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?vw(r.position):"start"in r||"end"in r?vw(r):"line"in r||"column"in r?Hb(r):""}function Hb(r){return yw(r&&r.line)+":"+yw(r&&r.column)}function vw(r){return Hb(r&&r.start)+"-"+Hb(r&&r.end)}function yw(r){return r&&typeof r=="number"?r:1}class ta extends Error{constructor(e,t,n){super(),typeof t=="string"&&(n=t,t=void 0);let i="",a={},s=!1;if(t&&("line"in t&&"column"in t?a={place:t}:"start"in t&&"end"in t?a={place:t}:"type"in t?a={ancestors:[t],place:t.position}:a={...t}),typeof e=="string"?i=e:!a.cause&&e&&(s=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?a.ruleId=n:(a.source=n.slice(0,l),a.ruleId=n.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=o?o.line:void 0,this.name=ZX(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}}ta.prototype.file="",ta.prototype.name="",ta.prototype.reason="",ta.prototype.message="",ta.prototype.stack="",ta.prototype.column=void 0,ta.prototype.line=void 0,ta.prototype.ancestors=void 0,ta.prototype.cause=void 0,ta.prototype.fatal=void 0,ta.prototype.place=void 0,ta.prototype.ruleId=void 0,ta.prototype.source=void 0;const _s={basename:e$,dirname:t$,extname:r$,join:n$,sep:"/"};function e$(r,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');cd(r);let t=0,n=-1,i=r.length,a;if(e===void 0||e.length===0||e.length>r.length){for(;i--;)if(r.codePointAt(i)===47){if(a){t=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":r.slice(t,n)}if(e===r)return"";let s=-1,o=e.length-1;for(;i--;)if(r.codePointAt(i)===47){if(a){t=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(r.codePointAt(i)===e.codePointAt(o--)?o<0&&(n=i):(o=-1,n=s));return t===n?n=s:n<0&&(n=r.length),r.slice(t,n)}function t$(r){if(cd(r),r.length===0)return".";let e=-1,t=r.length,n;for(;--t;)if(r.codePointAt(t)===47){if(n){e=t;break}}else n||(n=!0);return e<0?r.codePointAt(0)===47?"/":".":e===1&&r.codePointAt(0)===47?"//":r.slice(0,e)}function r$(r){cd(r);let e=r.length,t=-1,n=0,i=-1,a=0,s;for(;e--;){const o=r.codePointAt(e);if(o===47){if(s){n=e+1;break}continue}t<0&&(s=!0,t=e+1),o===46?i<0?i=e:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||t<0||a===0||a===1&&i===t-1&&i===n+1?"":r.slice(i,t)}function n$(...r){let e=-1,t;for(;++e<r.length;)cd(r[e]),r[e]&&(t=t===void 0?r[e]:t+"/"+r[e]);return t===void 0?".":i$(t)}function i$(r){cd(r);const e=r.codePointAt(0)===47;let t=a$(r,!e);return t.length===0&&!e&&(t="."),t.length>0&&r.codePointAt(r.length-1)===47&&(t+="/"),e?"/"+t:t}function a$(r,e){let t="",n=0,i=-1,a=0,s=-1,o,l;for(;++s<=r.length;){if(s<r.length)o=r.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(t.length<2||n!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",n=0):(t=t.slice(0,l),n=t.length-1-t.lastIndexOf("/")),i=s,a=0;continue}}else if(t.length>0){t="",n=0,i=s,a=0;continue}}e&&(t=t.length>0?t+"/..":"..",n=2)}else t.length>0?t+="/"+r.slice(i+1,s):t=r.slice(i+1,s),n=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return t}function cd(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}const s$={cwd:o$};function o$(){return"/"}function qb(r){return!!(r!==null&&typeof r=="object"&&"href"in r&&r.href&&"protocol"in r&&r.protocol&&r.auth===void 0)}function l$(r){if(typeof r=="string")r=new URL(r);else if(!qb(r)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+r+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(r.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return c$(r)}function c$(r){if(r.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=r.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const n=e.codePointAt(t+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const Gb=["history","path","basename","stem","extname","dirname"];class u${constructor(e){let t;e?qb(e)?t={path:e}:typeof e=="string"||h$(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":s$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Gb.length;){const a=Gb[n];a in t&&t[a]!==void 0&&t[a]!==null&&(this[a]=a==="history"?[...t[a]]:t[a])}let i;for(i in t)Gb.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?_s.basename(this.path):void 0}set basename(e){Vb(e,"basename"),Wb(e,"basename"),this.path=_s.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?_s.dirname(this.path):void 0}set dirname(e){ww(this.basename,"dirname"),this.path=_s.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?_s.extname(this.path):void 0}set extname(e){if(Wb(e,"extname"),ww(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=_s.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){qb(e)&&(e=l$(e)),Vb(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?_s.basename(this.path,this.extname):void 0}set stem(e){Vb(e,"stem"),Wb(e,"stem"),this.path=_s.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const i=this.message(e,t,n);throw i.fatal=!0,i}info(e,t,n){const i=this.message(e,t,n);return i.fatal=void 0,i}message(e,t,n){const i=new ta(e,t,n);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Wb(r,e){if(r&&r.includes(_s.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+_s.sep+"`")}function Vb(r,e){if(!r)throw new Error("`"+e+"` cannot be empty")}function ww(r,e){if(!r)throw new Error("Setting `"+e+"` requires `path` to be set too")}function h$(r){return!!(r&&typeof r=="object"&&"byteLength"in r&&"byteOffset"in r)}const d$=function(r){const n=this.constructor.prototype,i=n[r],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,n),a},f$={}.hasOwnProperty;class Xb extends d${constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=JX()}copy(){const e=new Xb;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(zb(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(Yb("data",this.frozen),this.namespace[e]=t,this):f$.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Yb("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const i=t.call(e,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=$f(e),n=this.parser||this.Parser;return $b("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),$b("process",this.parser||this.Parser),Kb("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(a,s){const o=$f(e),l=n.parse(o);n.run(l,o,function(u,h,d){if(u||!h||!d)return c(u);const f=h,p=n.stringify(f,d);m$(p)?d.value=p:d.result=p,c(u,d)});function c(u,h){u||!h?s(u):a?a(h):t(void 0,h)}}}processSync(e){let t=!1,n;return this.freeze(),$b("processSync",this.parser||this.Parser),Kb("processSync",this.compiler||this.Compiler),this.process(e,i),Sw("processSync","process",t),n;function i(a,s){t=!0,mw(a),n=s}}run(e,t,n){xw(e),this.freeze();const i=this.transformers;return!n&&typeof t=="function"&&(n=t,t=void 0),n?a(void 0,n):new Promise(a);function a(s,o){const l=$f(t);i.run(e,l,c);function c(u,h,d){const f=h||e;u?o(u):s?s(f):n(void 0,f,d)}}}runSync(e,t){let n=!1,i;return this.run(e,t,a),Sw("runSync","run",n),i;function a(s,o){mw(s),i=o,n=!0}}stringify(e,t){this.freeze();const n=$f(t),i=this.compiler||this.Compiler;return Kb("stringify",i),xw(e),i(e,n)}use(e,...t){const n=this.attachers,i=this.namespace;if(Yb("use",this.frozen),e!=null)if(typeof e=="function")l(e,t);else if(typeof e=="object")Array.isArray(e)?o(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...h]=c;l(u,h)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=zb(!0,i.settings,c.settings))}function o(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const h=c[u];a(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let h=-1,d=-1;for(;++h<n.length;)if(n[h][0]===c){d=h;break}if(d===-1)n.push([c,...u]);else if(u.length>0){let[f,...p]=u;const m=n[d][1];jb(m)&&jb(f)&&(f=zb(!0,m,f)),n[d]=[c,f,...p]}}}}const g$=new Xb().freeze();function $b(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `parser`")}function Kb(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `compiler`")}function Yb(r,e){if(e)throw new Error("Cannot call `"+r+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function xw(r){if(!jb(r)||typeof r.type!="string")throw new TypeError("Expected node, got `"+r+"`")}function Sw(r,e,t){if(!t)throw new Error("`"+r+"` finished async. Use `"+e+"` instead")}function $f(r){return p$(r)?r:new u$(r)}function p$(r){return!!(r&&typeof r=="object"&&"message"in r&&"messages"in r)}function m$(r){return typeof r=="string"||b$(r)}function b$(r){return!!(r&&typeof r=="object"&&"byteLength"in r&&"byteOffset"in r)}const v$=g$().use(GV).use($X).freeze();function y$(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kw(r,e,t){const i=ld((t||{}).ignore||[]),a=w$(e);let s=-1;for(;++s<a.length;)Db(r,"text",o);function o(c,u){let h=-1,d;for(;++h<u.length;){const f=u[h],p=d?d.children:void 0;if(i(f,p?p.indexOf(f):void 0,d))return;d=f}if(d)return l(c,u)}function l(c,u){const h=u[u.length-1],d=a[s][0],f=a[s][1];let p=0;const y=h.children.indexOf(c);let v=!1,x=[];d.lastIndex=0;let S=d.exec(c.value);for(;S;){const A=S.index,C={index:S.index,input:S.input,stack:[...u,c]};let k=f(...S,C);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?d.lastIndex=A+1:(p!==A&&x.push({type:"text",value:c.value.slice(p,A)}),Array.isArray(k)?x.push(...k):k&&x.push(k),p=A+S[0].length,v=!0),!d.global)break;S=d.exec(c.value)}return v?(p<c.value.length&&x.push({type:"text",value:c.value.slice(p)}),h.children.splice(y,1,...x)):x=[c],y+x.length}}function w$(r){const e=[];if(!Array.isArray(r))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!r[0]||Array.isArray(r[0])?r:[r];let n=-1;for(;++n<t.length;){const i=t[n];e.push([x$(i[0]),S$(i[1])])}return e}function x$(r){return typeof r=="string"?new RegExp(y$(r),"g"):r}function S$(r){return typeof r=="function"?r:function(){return r}}function k$(r){kw(r,[/\r?\n|\r/g,A$])}function A$(){return{type:"break"}}function _$(){return function(r){k$(r)}}function Kf(r,e){const t=String(r);if(typeof e!="string")throw new TypeError("Expected character");let n=0,i=t.indexOf(e);for(;i!==-1;)n++,i=t.indexOf(e,i+e.length);return n}const Jb="phrasing",Qb=["autolink","link","image","label"];function C$(){return{transforms:[R$],enter:{literalAutolink:T$,literalAutolinkEmail:Zb,literalAutolinkHttp:Zb,literalAutolinkWww:Zb},exit:{literalAutolink:N$,literalAutolinkEmail:O$,literalAutolinkHttp:I$,literalAutolinkWww:M$}}}function E$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Jb,notInConstruct:Qb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Jb,notInConstruct:Qb},{character:":",before:"[ps]",after:"\\/",inConstruct:Jb,notInConstruct:Qb}]}}function T$(r){this.enter({type:"link",title:null,url:"",children:[]},r)}function Zb(r){this.config.enter.autolinkProtocol.call(this,r)}function I$(r){this.config.exit.autolinkProtocol.call(this,r)}function M$(r){this.config.exit.data.call(this,r);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(r)}function O$(r){this.config.exit.autolinkEmail.call(this,r)}function N$(r){this.exit(r)}function R$(r){kw(r,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,P$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),F$]],{ignore:["link","linkReference"]})}function P$(r,e,t,n,i){let a="";if(!Aw(i)||(/^w/i.test(e)&&(t=e+t,e="",a="http://"),!D$(t)))return!1;const s=L$(t+n);if(!s[0])return!1;const o={type:"link",title:null,url:a+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function F$(r,e,t,n){return!Aw(n,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+t,children:[{type:"text",value:e+"@"+t}]}}function D$(r){const e=r.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function L$(r){const e=/[!"&'),.:;<>?\]}]+$/.exec(r);if(!e)return[r,void 0];r=r.slice(0,e.index);let t=e[0],n=t.indexOf(")");const i=Kf(r,"(");let a=Kf(r,")");for(;n!==-1&&i>a;)r+=t.slice(0,n+1),t=t.slice(n+1),n=t.indexOf(")"),a++;return[r,t]}function Aw(r,e){const t=r.input.charCodeAt(r.index-1);return(r.index===0||ic(t)||jf(t))&&(!e||t!==47)}_w.peek=V$;function B$(){this.buffer()}function U$(r){this.enter({type:"footnoteReference",identifier:"",label:""},r)}function z$(){this.buffer()}function j$(r){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},r)}function H$(r){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=ts(this.sliceSerialize(r)).toLowerCase(),t.label=e}function q$(r){this.exit(r)}function G$(r){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=ts(this.sliceSerialize(r)).toLowerCase(),t.label=e}function W$(r){this.exit(r)}function V$(){return"["}function _w(r,e,t,n){const i=t.createTracker(n);let a=i.move("[^");const s=t.enter("footnoteReference"),o=t.enter("reference");return a+=i.move(t.safe(t.associationId(r),{after:"]",before:a})),o(),s(),a+=i.move("]"),a}function X$(){return{enter:{gfmFootnoteCallString:B$,gfmFootnoteCall:U$,gfmFootnoteDefinitionLabelString:z$,gfmFootnoteDefinition:j$},exit:{gfmFootnoteCallString:H$,gfmFootnoteCall:q$,gfmFootnoteDefinitionLabelString:G$,gfmFootnoteDefinition:W$}}}function $$(r){let e=!1;return r&&r.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:t,footnoteReference:_w},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(n,i,a,s){const o=a.createTracker(s);let l=o.move("[^");const c=a.enter("footnoteDefinition"),u=a.enter("label");return l+=o.move(a.safe(a.associationId(n),{before:l,after:"]"})),u(),l+=o.move("]:"),n.children&&n.children.length>0&&(o.shift(4),l+=o.move((e?`
`:" ")+a.indentLines(a.containerFlow(n,o.current()),e?Cw:K$))),c(),l}}function K$(r,e,t){return e===0?r:Cw(r,e,t)}function Cw(r,e,t){return(t?"":" ")+r}const Y$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ew.peek=tK;function J$(){return{canContainEols:["delete"],enter:{strikethrough:Z$},exit:{strikethrough:eK}}}function Q$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Y$}],handlers:{delete:Ew}}}function Z$(r){this.enter({type:"delete",children:[]},r)}function eK(r){this.exit(r)}function Ew(r,e,t,n){const i=t.createTracker(n),a=t.enter("strikethrough");let s=i.move("~~");return s+=t.containerPhrasing(r,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function tK(){return"~"}function rK(r){return r.length}function nK(r,e){const t=e||{},n=(t.align||[]).concat(),i=t.stringLength||rK,a=[],s=[],o=[],l=[];let c=0,u=-1;for(;++u<r.length;){const m=[],y=[];let v=-1;for(r[u].length>c&&(c=r[u].length);++v<r[u].length;){const x=iK(r[u][v]);if(t.alignDelimiters!==!1){const S=i(x);y[v]=S,(l[v]===void 0||S>l[v])&&(l[v]=S)}m.push(x)}s[u]=m,o[u]=y}let h=-1;if(typeof n=="object"&&"length"in n)for(;++h<c;)a[h]=Tw(n[h]);else{const m=Tw(n);for(;++h<c;)a[h]=m}h=-1;const d=[],f=[];for(;++h<c;){const m=a[h];let y="",v="";m===99?(y=":",v=":"):m===108?y=":":m===114&&(v=":");let x=t.alignDelimiters===!1?1:Math.max(1,l[h]-y.length-v.length);const S=y+"-".repeat(x)+v;t.alignDelimiters!==!1&&(x=y.length+x+v.length,x>l[h]&&(l[h]=x),f[h]=x),d[h]=S}s.splice(1,0,d),o.splice(1,0,f),u=-1;const p=[];for(;++u<s.length;){const m=s[u],y=o[u];h=-1;const v=[];for(;++h<c;){const x=m[h]||"";let S="",A="";if(t.alignDelimiters!==!1){const C=l[h]-(y[h]||0),k=a[h];k===114?S=" ".repeat(C):k===99?C%2?(S=" ".repeat(C/2+.5),A=" ".repeat(C/2-.5)):(S=" ".repeat(C/2),A=S):A=" ".repeat(C)}t.delimiterStart!==!1&&!h&&v.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&x==="")&&(t.delimiterStart!==!1||h)&&v.push(" "),t.alignDelimiters!==!1&&v.push(S),v.push(x),t.alignDelimiters!==!1&&v.push(A),t.padding!==!1&&v.push(" "),(t.delimiterEnd!==!1||h!==c-1)&&v.push("|")}p.push(t.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return p.join(`
`)}function iK(r){return r==null?"":String(r)}function Tw(r){const e=typeof r=="string"?r.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function aK(){return{enter:{table:sK,tableData:Iw,tableHeader:Iw,tableRow:lK},exit:{codeText:cK,table:oK,tableData:e3,tableHeader:e3,tableRow:e3}}}function sK(r){const e=r._align;this.enter({type:"table",align:e.map(function(t){return t==="none"?null:t}),children:[]},r),this.data.inTable=!0}function oK(r){this.exit(r),this.data.inTable=void 0}function lK(r){this.enter({type:"tableRow",children:[]},r)}function e3(r){this.exit(r)}function Iw(r){this.enter({type:"tableCell",children:[]},r)}function cK(r){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,uK));const t=this.stack[this.stack.length-1];t.type,t.value=e,this.exit(r)}function uK(r,e){return e==="|"?e:r}function hK(r){const e=r||{},t=e.tableCellPadding,n=e.tablePipeAlign,i=e.stringLength,a=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:s,tableCell:l,tableRow:o}};function s(f,p,m,y){return c(u(f,m,y),f.align)}function o(f,p,m,y){const v=h(f,m,y),x=c([v]);return x.slice(0,x.indexOf(`
`))}function l(f,p,m,y){const v=m.enter("tableCell"),x=m.enter("phrasing"),S=m.containerPhrasing(f,{...y,before:a,after:a});return x(),v(),S}function c(f,p){return nK(f,{align:p,alignDelimiters:n,padding:t,stringLength:i})}function u(f,p,m){const y=f.children;let v=-1;const x=[],S=p.enter("table");for(;++v<y.length;)x[v]=h(y[v],p,m);return S(),x}function h(f,p,m){const y=f.children;let v=-1;const x=[],S=p.enter("tableRow");for(;++v<y.length;)x[v]=l(y[v],f,p,m);return S(),x}function d(f,p,m){let y=Bb.inlineCode(f,p,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function dK(){return{exit:{taskListCheckValueChecked:Mw,taskListCheckValueUnchecked:Mw,paragraph:gK}}}function fK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:pK}}}function Mw(r){const e=this.stack[this.stack.length-2];e.type,e.checked=r.type==="taskListCheckValueChecked"}function gK(r){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const n=t.children[0];if(n&&n.type==="text"){const i=e.children;let a=-1,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===t&&(n.value=n.value.slice(1),n.value.length===0?t.children.shift():t.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,t.position.start=Object.assign({},n.position.start)))}}this.exit(r)}function pK(r,e,t,n){const i=r.children[0],a=typeof r.checked=="boolean"&&i&&i.type==="paragraph",s="["+(r.checked?"x":" ")+"] ",o=t.createTracker(n);a&&o.move(s);let l=Bb.listItem(r,e,t,{...n,...o.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function mK(){return[C$(),X$(),J$(),aK(),dK()]}function bK(r){return{extensions:[E$(),$$(r),Q$(),hK(r),fK()]}}const vK={tokenize:AK,partial:!0},Ow={tokenize:_K,partial:!0},Nw={tokenize:CK,partial:!0},Rw={tokenize:EK,partial:!0},yK={tokenize:TK,partial:!0},Pw={name:"wwwAutolink",tokenize:SK,previous:Dw},Fw={name:"protocolAutolink",tokenize:kK,previous:Lw},ho={name:"emailAutolink",tokenize:xK,previous:Bw},Cs={};function wK(){return{text:Cs}}let sc=48;for(;sc<123;)Cs[sc]=ho,sc++,sc===58?sc=65:sc===91&&(sc=97);Cs[43]=ho,Cs[45]=ho,Cs[46]=ho,Cs[95]=ho,Cs[72]=[ho,Fw],Cs[104]=[ho,Fw],Cs[87]=[ho,Pw],Cs[119]=[ho,Pw];function xK(r,e,t){const n=this;let i,a;return s;function s(h){return!t3(h)||!Bw.call(n,n.previous)||r3(n.events)?t(h):(r.enter("literalAutolink"),r.enter("literalAutolinkEmail"),o(h))}function o(h){return t3(h)?(r.consume(h),o):h===64?(r.consume(h),l):t(h)}function l(h){return h===46?r.check(yK,u,c)(h):h===45||h===95||Ci(h)?(a=!0,r.consume(h),l):u(h)}function c(h){return r.consume(h),i=!0,l}function u(h){return a&&i&&Ui(n.previous)?(r.exit("literalAutolinkEmail"),r.exit("literalAutolink"),e(h)):t(h)}}function SK(r,e,t){const n=this;return i;function i(s){return s!==87&&s!==119||!Dw.call(n,n.previous)||r3(n.events)?t(s):(r.enter("literalAutolink"),r.enter("literalAutolinkWww"),r.check(vK,r.attempt(Ow,r.attempt(Nw,a),t),t)(s))}function a(s){return r.exit("literalAutolinkWww"),r.exit("literalAutolink"),e(s)}}function kK(r,e,t){const n=this;let i="",a=!1;return s;function s(h){return(h===72||h===104)&&Lw.call(n,n.previous)&&!r3(n.events)?(r.enter("literalAutolink"),r.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),r.consume(h),o):t(h)}function o(h){if(Ui(h)&&i.length<5)return i+=String.fromCodePoint(h),r.consume(h),o;if(h===58){const d=i.toLowerCase();if(d==="http"||d==="https")return r.consume(h),l}return t(h)}function l(h){return h===47?(r.consume(h),a?c:(a=!0,l)):t(h)}function c(h){return h===null||zf(h)||vn(h)||ic(h)||jf(h)?t(h):r.attempt(Ow,r.attempt(Nw,u),t)(h)}function u(h){return r.exit("literalAutolinkHttp"),r.exit("literalAutolink"),e(h)}}function AK(r,e,t){let n=0;return i;function i(s){return(s===87||s===119)&&n<3?(n++,r.consume(s),i):s===46&&n===3?(r.consume(s),a):t(s)}function a(s){return s===null?t(s):e(s)}}function _K(r,e,t){let n,i,a;return s;function s(c){return c===46||c===95?r.check(Rw,l,o)(c):c===null||vn(c)||ic(c)||c!==45&&jf(c)?l(c):(a=!0,r.consume(c),s)}function o(c){return c===95?n=!0:(i=n,n=void 0),r.consume(c),s}function l(c){return i||n||!a?t(c):e(c)}}function CK(r,e){let t=0,n=0;return i;function i(s){return s===40?(t++,r.consume(s),i):s===41&&n<t?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?r.check(Rw,e,a)(s):s===null||vn(s)||ic(s)?e(s):(r.consume(s),i)}function a(s){return s===41&&n++,r.consume(s),i}}function EK(r,e,t){return n;function n(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(r.consume(o),n):o===38?(r.consume(o),a):o===93?(r.consume(o),i):o===60||o===null||vn(o)||ic(o)?e(o):t(o)}function i(o){return o===null||o===40||o===91||vn(o)||ic(o)?e(o):n(o)}function a(o){return Ui(o)?s(o):t(o)}function s(o){return o===59?(r.consume(o),n):Ui(o)?(r.consume(o),s):t(o)}}function TK(r,e,t){return n;function n(a){return r.consume(a),i}function i(a){return Ci(a)?t(a):e(a)}}function Dw(r){return r===null||r===40||r===42||r===95||r===91||r===93||r===126||vn(r)}function Lw(r){return!Ui(r)}function Bw(r){return!(r===47||t3(r))}function t3(r){return r===43||r===45||r===46||r===95||Ci(r)}function r3(r){let e=r.length,t=!1;for(;e--;){const n=r[e][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){t=!0;break}if(n._gfmAutolinkLiteralWalkedInto){t=!1;break}}return r.length>0&&!t&&(r[r.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const IK={tokenize:LK,partial:!0};function MK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:PK,continuation:{tokenize:FK},exit:DK}},text:{91:{name:"gfmFootnoteCall",tokenize:RK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:OK,resolveTo:NK}}}}function OK(r,e,t){const n=this;let i=n.events.length;const a=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let s;for(;i--;){const l=n.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!s||!s._balanced)return t(l);const c=ts(n.sliceSerialize({start:s.end,end:n.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?t(l):(r.enter("gfmFootnoteCallLabelMarker"),r.consume(l),r.exit("gfmFootnoteCallLabelMarker"),e(l))}}function NK(r,e){let t=r.length;for(;t--;)if(r[t][1].type==="labelImage"&&r[t][0]==="enter"){r[t][1];break}r[t+1][1].type="data",r[t+3][1].type="gfmFootnoteCallLabelMarker";const n={type:"gfmFootnoteCall",start:Object.assign({},r[t+3][1].start),end:Object.assign({},r[r.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},r[t+3][1].end),end:Object.assign({},r[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},r[r.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[r[t+1],r[t+2],["enter",n,e],r[t+3],r[t+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],r[r.length-2],r[r.length-1],["exit",n,e]];return r.splice(t,r.length-t+1,...o),r}function RK(r,e,t){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a=0,s;return o;function o(h){return r.enter("gfmFootnoteCall"),r.enter("gfmFootnoteCallLabelMarker"),r.consume(h),r.exit("gfmFootnoteCallLabelMarker"),l}function l(h){return h!==94?t(h):(r.enter("gfmFootnoteCallMarker"),r.consume(h),r.exit("gfmFootnoteCallMarker"),r.enter("gfmFootnoteCallString"),r.enter("chunkString").contentType="string",c)}function c(h){if(a>999||h===93&&!s||h===null||h===91||vn(h))return t(h);if(h===93){r.exit("chunkString");const d=r.exit("gfmFootnoteCallString");return i.includes(ts(n.sliceSerialize(d)))?(r.enter("gfmFootnoteCallLabelMarker"),r.consume(h),r.exit("gfmFootnoteCallLabelMarker"),r.exit("gfmFootnoteCall"),e):t(h)}return vn(h)||(s=!0),a++,r.consume(h),h===92?u:c}function u(h){return h===91||h===92||h===93?(r.consume(h),a++,c):c(h)}}function PK(r,e,t){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a,s=0,o;return l;function l(p){return r.enter("gfmFootnoteDefinition")._container=!0,r.enter("gfmFootnoteDefinitionLabel"),r.enter("gfmFootnoteDefinitionLabelMarker"),r.consume(p),r.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(r.enter("gfmFootnoteDefinitionMarker"),r.consume(p),r.exit("gfmFootnoteDefinitionMarker"),r.enter("gfmFootnoteDefinitionLabelString"),r.enter("chunkString").contentType="string",u):t(p)}function u(p){if(s>999||p===93&&!o||p===null||p===91||vn(p))return t(p);if(p===93){r.exit("chunkString");const m=r.exit("gfmFootnoteDefinitionLabelString");return a=ts(n.sliceSerialize(m)),r.enter("gfmFootnoteDefinitionLabelMarker"),r.consume(p),r.exit("gfmFootnoteDefinitionLabelMarker"),r.exit("gfmFootnoteDefinitionLabel"),d}return vn(p)||(o=!0),s++,r.consume(p),p===92?h:u}function h(p){return p===91||p===92||p===93?(r.consume(p),s++,u):u(p)}function d(p){return p===58?(r.enter("definitionMarker"),r.consume(p),r.exit("definitionMarker"),i.includes(a)||i.push(a),Hr(r,f,"gfmFootnoteDefinitionWhitespace")):t(p)}function f(p){return e(p)}}function FK(r,e,t){return r.check(ad,e,r.attempt(IK,e,t))}function DK(r){r.exit("gfmFootnoteDefinition")}function LK(r,e,t){const n=this;return Hr(r,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=n.events[n.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):t(a)}}function BK(r){let t=(r||{}).singleTilde;const n={name:"strikethrough",tokenize:a,resolveAll:i};return t==null&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(s,o){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let c=l;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[l][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[l][1].end)},h={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[l][1].start)},d=[["enter",u,o],["enter",s[c][1],o],["exit",s[c][1],o],["enter",h,o]],f=o.parser.constructs.insideSpan.null;f&&ba(d,d.length,0,Hf(f,s.slice(c+1,l),o)),ba(d,d.length,0,[["exit",h,o],["enter",s[l][1],o],["exit",s[l][1],o],["exit",u,o]]),ba(s,c-1,l-c+3,d),l=c+d.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function a(s,o,l){const c=this.previous,u=this.events;let h=0;return d;function d(p){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(p):(s.enter("strikethroughSequenceTemporary"),f(p))}function f(p){const m=vu(c);if(p===126)return h>1?l(p):(s.consume(p),h++,f);if(h<2&&!t)return l(p);const y=s.exit("strikethroughSequenceTemporary"),v=vu(p);return y._open=!v||v===2&&!!m,y._close=!m||m===2&&!!v,o(p)}}}class UK{constructor(){this.map=[]}add(e,t,n){zK(this,e,t,n)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(const a of i)e.push(a);i=n.pop()}this.map.length=0}}function zK(r,e,t,n){let i=0;if(!(t===0&&n.length===0)){for(;i<r.map.length;){if(r.map[i][0]===e){r.map[i][1]+=t,r.map[i][2].push(...n);return}i+=1}r.map.push([e,t,n])}}function jK(r,e){let t=!1;const n=[];for(;e<r.length;){const i=r[e];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&n.push(r[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(r[e-1][1].type==="tableDelimiterMarker"){const a=n.length-1;n[a]=n[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);e+=1}return n}function HK(){return{flow:{null:{name:"table",tokenize:qK,resolveAll:GK}}}}function qK(r,e,t){const n=this;let i=0,a=0,s;return o;function o(D){let $=n.events.length-1;for(;$>-1;){const z=n.events[$][1].type;if(z==="lineEnding"||z==="linePrefix")$--;else break}const H=$>-1?n.events[$][1].type:null,V=H==="tableHead"||H==="tableRow"?k:l;return V===k&&n.parser.lazy[n.now().line]?t(D):V(D)}function l(D){return r.enter("tableHead"),r.enter("tableRow"),c(D)}function c(D){return D===124||(s=!0,a+=1),u(D)}function u(D){return D===null?t(D):Yt(D)?a>1?(a=0,n.interrupt=!0,r.exit("tableRow"),r.enter("lineEnding"),r.consume(D),r.exit("lineEnding"),f):t(D):Vr(D)?Hr(r,u,"whitespace")(D):(a+=1,s&&(s=!1,i+=1),D===124?(r.enter("tableCellDivider"),r.consume(D),r.exit("tableCellDivider"),s=!0,u):(r.enter("data"),h(D)))}function h(D){return D===null||D===124||vn(D)?(r.exit("data"),u(D)):(r.consume(D),D===92?d:h)}function d(D){return D===92||D===124?(r.consume(D),h):h(D)}function f(D){return n.interrupt=!1,n.parser.lazy[n.now().line]?t(D):(r.enter("tableDelimiterRow"),s=!1,Vr(D)?Hr(r,p,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):p(D))}function p(D){return D===45||D===58?y(D):D===124?(s=!0,r.enter("tableCellDivider"),r.consume(D),r.exit("tableCellDivider"),m):C(D)}function m(D){return Vr(D)?Hr(r,y,"whitespace")(D):y(D)}function y(D){return D===58?(a+=1,s=!0,r.enter("tableDelimiterMarker"),r.consume(D),r.exit("tableDelimiterMarker"),v):D===45?(a+=1,v(D)):D===null||Yt(D)?A(D):C(D)}function v(D){return D===45?(r.enter("tableDelimiterFiller"),x(D)):C(D)}function x(D){return D===45?(r.consume(D),x):D===58?(s=!0,r.exit("tableDelimiterFiller"),r.enter("tableDelimiterMarker"),r.consume(D),r.exit("tableDelimiterMarker"),S):(r.exit("tableDelimiterFiller"),S(D))}function S(D){return Vr(D)?Hr(r,A,"whitespace")(D):A(D)}function A(D){return D===124?p(D):D===null||Yt(D)?!s||i!==a?C(D):(r.exit("tableDelimiterRow"),r.exit("tableHead"),e(D)):C(D)}function C(D){return t(D)}function k(D){return r.enter("tableRow"),I(D)}function I(D){return D===124?(r.enter("tableCellDivider"),r.consume(D),r.exit("tableCellDivider"),I):D===null||Yt(D)?(r.exit("tableRow"),e(D)):Vr(D)?Hr(r,I,"whitespace")(D):(r.enter("data"),R(D))}function R(D){return D===null||D===124||vn(D)?(r.exit("data"),I(D)):(r.consume(D),D===92?U:R)}function U(D){return D===92||D===124?(r.consume(D),R):R(D)}}function GK(r,e){let t=-1,n=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,l=0,c,u,h;const d=new UK;for(;++t<r.length;){const f=r[t],p=f[1];f[0]==="enter"?p.type==="tableHead"?(o=!1,l!==0&&(Uw(d,e,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(t,0,[["enter",c,e]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(n=!0,h=void 0,a=[0,0,0,0],s=[0,t+1,0,0],o&&(o=!1,u={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(t,0,[["enter",u,e]])),i=p.type==="tableDelimiterRow"?2:u?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(n=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],h=Yf(d,e,a,i,void 0,h),a=[0,0,0,0]),s[2]=t)):p.type==="tableCellDivider"&&(n?n=!1:(a[1]!==0&&(s[0]=s[1],h=Yf(d,e,a,i,void 0,h)),a=s,s=[a[1],t,0,0])):p.type==="tableHead"?(o=!0,l=t):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=t,a[1]!==0?(s[0]=s[1],h=Yf(d,e,a,i,t,h)):s[1]!==0&&(h=Yf(d,e,s,i,t,h)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=t)}for(l!==0&&Uw(d,e,l,c,u),d.consume(e.events),t=-1;++t<e.events.length;){const f=e.events[t];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=jK(e.events,t))}return r}function Yf(r,e,t,n,i,a){const s=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",o="tableContent";t[0]!==0&&(a.end=Object.assign({},yu(e.events,t[0])),r.add(t[0],0,[["exit",a,e]]));const l=yu(e.events,t[1]);if(a={type:s,start:Object.assign({},l),end:Object.assign({},l)},r.add(t[1],0,[["enter",a,e]]),t[2]!==0){const c=yu(e.events,t[2]),u=yu(e.events,t[3]),h={type:o,start:Object.assign({},c),end:Object.assign({},u)};if(r.add(t[2],0,[["enter",h,e]]),n!==2){const d=e.events[t[2]],f=e.events[t[3]];if(d[1].end=Object.assign({},f[1].end),d[1].type="chunkText",d[1].contentType="text",t[3]>t[2]+1){const p=t[2]+1,m=t[3]-t[2]-1;r.add(p,m,[])}}r.add(t[3]+1,0,[["exit",h,e]])}return i!==void 0&&(a.end=Object.assign({},yu(e.events,i)),r.add(i,0,[["exit",a,e]]),a=void 0),a}function Uw(r,e,t,n,i){const a=[],s=yu(e.events,t);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),n.end=Object.assign({},s),a.push(["exit",n,e]),r.add(t+1,0,a)}function yu(r,e){const t=r[e],n=t[0]==="enter"?"start":"end";return t[1][n]}const WK={name:"tasklistCheck",tokenize:XK};function VK(){return{text:{91:WK}}}function XK(r,e,t){const n=this;return i;function i(l){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?t(l):(r.enter("taskListCheck"),r.enter("taskListCheckMarker"),r.consume(l),r.exit("taskListCheckMarker"),a)}function a(l){return vn(l)?(r.enter("taskListCheckValueUnchecked"),r.consume(l),r.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(r.enter("taskListCheckValueChecked"),r.consume(l),r.exit("taskListCheckValueChecked"),s):t(l)}function s(l){return l===93?(r.enter("taskListCheckMarker"),r.consume(l),r.exit("taskListCheckMarker"),r.exit("taskListCheck"),o):t(l)}function o(l){return Yt(l)?e(l):Vr(l)?r.check({tokenize:$K},e,t)(l):t(l)}}function $K(r,e,t){return Hr(r,n,"whitespace");function n(i){return i===null?t(i):e(i)}}function KK(r){return A8([wK(),MK(),BK(r),HK(),VK()])}const YK={};function JK(r){const e=this,t=r||YK,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),a=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(KK(t)),a.push(mK()),s.push(bK(t))}function QK(){return{enter:{mathFlow:r,mathFlowFenceMeta:e,mathText:a},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:t,mathFlowValue:o,mathText:s,mathTextData:o}};function r(l){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},l)}function e(){this.buffer()}function t(){const l=this.resume(),c=this.stack[this.stack.length-1];c.type,c.meta=l}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(l){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),u=this.stack[this.stack.length-1];u.type,this.exit(l),u.value=c;const h=u.data.hChildren[0];h.type,h.tagName,h.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function a(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function s(l){const c=this.resume(),u=this.stack[this.stack.length-1];u.type,this.exit(l),u.value=c,u.data.hChildren.push({type:"text",value:c})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function ZK(r){let e=(r||{}).singleDollarTextMath;return e==null&&(e=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:n}};function t(a,s,o,l){const c=a.value||"",u=o.createTracker(l),h="$".repeat(Math.max(tw(c,"$")+1,2)),d=o.enter("mathFlow");let f=u.move(h);if(a.meta){const p=o.enter("mathFlowMeta");f+=u.move(o.safe(a.meta,{after:`
`,before:f,encode:["$"],...u.current()})),p()}return f+=u.move(`
`),c&&(f+=u.move(c+`
`)),f+=u.move(h),d(),f}function n(a,s,o){let l=a.value||"",c=1;for(e||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const u="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let h=-1;for(;++h<o.unsafe.length;){const d=o.unsafe[h];if(!d.atBreak)continue;const f=o.compilePattern(d);let p;for(;p=f.exec(l);){let m=p.index;l.codePointAt(m)===10&&l.codePointAt(m-1)===13&&m--,l=l.slice(0,m)+" "+l.slice(p.index+1)}}return u+l+u}function i(){return"$"}}const eY={tokenize:tY,concrete:!0,name:"mathFlow"},zw={tokenize:rY,partial:!0};function tY(r,e,t){const n=this,i=n.events[n.events.length-1],a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let s=0;return o;function o(x){return r.enter("mathFlow"),r.enter("mathFlowFence"),r.enter("mathFlowFenceSequence"),l(x)}function l(x){return x===36?(r.consume(x),s++,l):s<2?t(x):(r.exit("mathFlowFenceSequence"),Hr(r,c,"whitespace")(x))}function c(x){return x===null||Yt(x)?h(x):(r.enter("mathFlowFenceMeta"),r.enter("chunkString",{contentType:"string"}),u(x))}function u(x){return x===null||Yt(x)?(r.exit("chunkString"),r.exit("mathFlowFenceMeta"),h(x)):x===36?t(x):(r.consume(x),u)}function h(x){return r.exit("mathFlowFence"),n.interrupt?e(x):r.attempt(zw,d,y)(x)}function d(x){return r.attempt({tokenize:v,partial:!0},y,f)(x)}function f(x){return(a?Hr(r,p,"linePrefix",a+1):p)(x)}function p(x){return x===null?y(x):Yt(x)?r.attempt(zw,d,y)(x):(r.enter("mathFlowValue"),m(x))}function m(x){return x===null||Yt(x)?(r.exit("mathFlowValue"),p(x)):(r.consume(x),m)}function y(x){return r.exit("mathFlow"),e(x)}function v(x,S,A){let C=0;return Hr(x,k,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function k(U){return x.enter("mathFlowFence"),x.enter("mathFlowFenceSequence"),I(U)}function I(U){return U===36?(C++,x.consume(U),I):C<s?A(U):(x.exit("mathFlowFenceSequence"),Hr(x,R,"whitespace")(U))}function R(U){return U===null||Yt(U)?(x.exit("mathFlowFence"),S(U)):A(U)}}}function rY(r,e,t){const n=this;return i;function i(s){return s===null?e(s):(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),a)}function a(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}function nY(r){let t=(r||{}).singleDollarTextMath;return t==null&&(t=!0),{tokenize:n,resolve:iY,previous:aY,name:"mathText"};function n(i,a,s){let o=0,l,c;return u;function u(m){return i.enter("mathText"),i.enter("mathTextSequence"),h(m)}function h(m){return m===36?(i.consume(m),o++,h):o<2&&!t?s(m):(i.exit("mathTextSequence"),d(m))}function d(m){return m===null?s(m):m===36?(c=i.enter("mathTextSequence"),l=0,p(m)):m===32?(i.enter("space"),i.consume(m),i.exit("space"),d):Yt(m)?(i.enter("lineEnding"),i.consume(m),i.exit("lineEnding"),d):(i.enter("mathTextData"),f(m))}function f(m){return m===null||m===32||m===36||Yt(m)?(i.exit("mathTextData"),d(m)):(i.consume(m),f)}function p(m){return m===36?(i.consume(m),l++,p):l===o?(i.exit("mathTextSequence"),i.exit("mathText"),a(m)):(c.type="mathTextData",f(m))}}}function iY(r){let e=r.length-4,t=3,n,i;if((r[t][1].type==="lineEnding"||r[t][1].type==="space")&&(r[e][1].type==="lineEnding"||r[e][1].type==="space")){for(n=t;++n<e;)if(r[n][1].type==="mathTextData"){r[e][1].type="mathTextPadding",r[t][1].type="mathTextPadding",t+=2,e-=2;break}}for(n=t-1,e++;++n<=e;)i===void 0?n!==e&&r[n][1].type!=="lineEnding"&&(i=n):(n===e||r[n][1].type==="lineEnding")&&(r[i][1].type="mathTextData",n!==i+2&&(r[i][1].end=r[n-1][1].end,r.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return r}function aY(r){return r!==36||this.events[this.events.length-1][1].type==="characterEscape"}function sY(r){return{flow:{36:eY},text:{36:nY(r)}}}class va{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new va(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}class Ua{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Ua(t,va.range(this,e))}}class ut{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,i,a,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start,a=s.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,a).replace(/[^]/g,"$&̲"),c;i>15?c="…"+o.slice(i-15,i):c=o.slice(0,i);var u;a+15<o.length?u=o.slice(a,a+15)+"…":u=o.slice(a),n+=c+l+u}var h=new Error(n);return h.name="ParseError",h.__proto__=ut.prototype,h.position=i,i!=null&&a!=null&&(h.length=a-i),h.rawMessage=e,h}}ut.prototype.__proto__=Error.prototype;var oY=function(e,t){return e.indexOf(t)!==-1},lY=function(e,t){return e===void 0?t:e},cY=/([A-Z])/g,uY=function(e){return e.replace(cY,"-$1").toLowerCase()},hY={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},dY=/[&><"']/g;function fY(r){return String(r).replace(dY,e=>hY[e])}var jw=function r(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?r(e.body[0]):e:e.type==="font"?r(e.body):e},gY=function(e){var t=jw(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},pY=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},mY=function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},ar={contains:oY,deflt:lY,escape:fY,hyphenate:uY,getBaseElem:jw,isCharacterBox:gY,protocolFromUrl:mY},Jf={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand <n>",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function bY(r){if(r.default)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class n3{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t in Jf)if(Jf.hasOwnProperty(t)){var n=Jf[t];this[t]=e[t]!==void 0?n.processor?n.processor(e[t]):e[t]:bY(n)}}reportNonstrict(e,t,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,t,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new ut("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,n){var i=this.strict;if(typeof i=="function")try{i=i(e,t,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var t=ar.protocolFromUrl(e.url);if(t==null)return!1;e.protocol=t}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class al{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Es[vY[this.id]]}sub(){return Es[yY[this.id]]}fracNum(){return Es[wY[this.id]]}fracDen(){return Es[xY[this.id]]}cramp(){return Es[SY[this.id]]}text(){return Es[kY[this.id]]}isTight(){return this.size>=2}}var i3=0,Qf=1,wu=2,fo=3,ud=4,za=5,xu=6,zi=7,Es=[new al(i3,0,!1),new al(Qf,0,!0),new al(wu,1,!1),new al(fo,1,!0),new al(ud,2,!1),new al(za,2,!0),new al(xu,3,!1),new al(zi,3,!0)],vY=[ud,za,ud,za,xu,zi,xu,zi],yY=[za,za,za,za,zi,zi,zi,zi],wY=[wu,fo,ud,za,xu,zi,xu,zi],xY=[fo,fo,za,za,zi,zi,zi,zi],SY=[Qf,Qf,fo,fo,za,za,zi,zi],kY=[i3,Qf,wu,fo,wu,fo,wu,fo],lr={DISPLAY:Es[i3],TEXT:Es[wu],SCRIPT:Es[ud],SCRIPTSCRIPT:Es[xu]},a3=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function AY(r){for(var e=0;e<a3.length;e++)for(var t=a3[e],n=0;n<t.blocks.length;n++){var i=t.blocks[n];if(r>=i[0]&&r<=i[1])return t.name}return null}var Zf=[];a3.forEach(r=>r.blocks.forEach(e=>Zf.push(...e)));function Hw(r){for(var e=0;e<Zf.length;e+=2)if(r>=Zf[e]&&r<=Zf[e+1])return!0;return!1}var Su=80,_Y=function(e,t){return"M95,"+(622+e+t)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+e/2.075+" -"+e+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+e)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},CY=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+e/2.084+" -"+e+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+e)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},EY=function(e,t){return"M983 "+(10+e+t)+`
l`+e/3.13+" -"+e+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},TY=function(e,t){return"M424,"+(2398+e+t)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+e)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+`
h400000v`+(40+e)+"h-400000z"},IY=function(e,t){return"M473,"+(2713+e+t)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},MY=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},OY=function(e,t,n){var i=n-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+`
H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},NY=function(e,t,n){t=1e3*t;var i="";switch(e){case"sqrtMain":i=_Y(t,Su);break;case"sqrtSize1":i=CY(t,Su);break;case"sqrtSize2":i=EY(t,Su);break;case"sqrtSize3":i=TY(t,Su);break;case"sqrtSize4":i=IY(t,Su);break;case"sqrtTall":i=OY(t,Su,n)}return i},RY=function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z"+("M367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z");case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257z"+("M478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z");default:return""}},qw={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},PY=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z
M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z
M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class hd{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return ar.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){var e=t=>t.toText();return this.children.map(e).join("")}}var Ts={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},e1={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Gw={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function FY(r,e){Ts[r]=e}function s3(r,e,t){if(!Ts[e])throw new Error("Font metrics not found for font: "+e+".");var n=r.charCodeAt(0),i=Ts[e][n];if(!i&&r[0]in Gw&&(n=Gw[r[0]].charCodeAt(0),i=Ts[e][n]),!i&&t==="text"&&Hw(n)&&(i=Ts[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var o3={};function DY(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!o3[e]){var t=o3[e]={cssEmPerMu:e1.quad[e]/18};for(var n in e1)e1.hasOwnProperty(n)&&(t[n]=e1[n][e])}return o3[e]}var LY=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Ww=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Vw=function(e,t){return t.size<2?e:LY[e-1][t.size-1]};class go{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||go.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Ww[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new go(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Vw(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Ww[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Vw(go.BASESIZE,e);return this.size===t&&this.textSize===go.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==go.BASESIZE?["sizing","reset-size"+this.size,"size"+go.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=DY(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}go.BASESIZE=6;var l3={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},BY={ex:!0,em:!0,mu:!0},Xw=function(e){return typeof e!="string"&&(e=e.unit),e in l3||e in BY||e==="ex"},On=function(e,t){var n;if(e.unit in l3)n=l3[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")n=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new ut("Invalid unit: '"+e.unit+"'");i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},xt=function(e){return+e.toFixed(4)+"em"},sl=function(e){return e.filter(t=>t).join(" ")},$w=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},Kw=function(e){var t=document.createElement(e);t.className=sl(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&t.setAttribute(i,this.attributes[i]);for(var a=0;a<this.children.length;a++)t.appendChild(this.children[a].toNode());return t},UY=/[\s"'>/=\x00-\x1f]/,Yw=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+ar.escape(sl(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=ar.hyphenate(i)+":"+this.style[i]+";");n&&(t+=' style="'+ar.escape(n)+'"');for(var a in this.attributes)if(this.attributes.hasOwnProperty(a)){if(UY.test(a))throw new ut("Invalid attribute name '"+a+"'");t+=" "+a+'="'+ar.escape(this.attributes[a])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+="</"+e+">",t};class dd{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,$w.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return ar.contains(this.classes,e)}toNode(){return Kw.call(this,"span")}toMarkup(){return Yw.call(this,"span")}}class c3{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,$w.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return ar.contains(this.classes,e)}toNode(){return Kw.call(this,"a")}toMarkup(){return Yw.call(this,"a")}}class zY{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return ar.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+ar.escape(this.src)+'"'+(' alt="'+ar.escape(this.alt)+'"'),t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=ar.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+ar.escape(t)+'"'),e+="'/>",e}}var jY={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class ja{constructor(e,t,n,i,a,s,o,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=i||0,this.skew=a||0,this.width=s||0,this.classes=o||[],this.style=l||{},this.maxFontSize=0;var c=AY(this.text.charCodeAt(0));c&&this.classes.push(c+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=jY[this.text])}hasClass(e){return ar.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=xt(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=sl(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(t=t||document.createElement("span"),t.style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=ar.escape(sl(this.classes)),t+='"');var n="";this.italic>0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=ar.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,t+=' style="'+ar.escape(n)+'"');var a=ar.escape(this.text);return e?(t+=">",t+=a,t+="</span>",t):a}}class po{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+ar.escape(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>",e}}class ol{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",qw[this.pathName]),t}toMarkup(){return this.alternate?'<path d="'+ar.escape(this.alternate)+'"/>':'<path d="'+ar.escape(qw[this.pathName])+'"/>'}}class u3{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+ar.escape(this.attributes[t])+'"');return e+="/>",e}}function Jw(r){if(r instanceof ja)return r;throw new Error("Expected symbolNode but got "+String(r)+".")}function HY(r){if(r instanceof dd)return r;throw new Error("Expected span<HtmlDomNode> but got "+String(r)+".")}var qY={bin:1,close:1,inner:1,open:1,punct:1,rel:1},GY={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},wn={math:{},text:{}};function E(r,e,t,n,i,a){wn[r][i]={font:e,group:t,replace:n},a&&n&&(wn[r][n]=wn[r][i])}var M="math",rt="text",G="main",se="ams",Cn="accent-token",Bt="bin",ji="close",ku="inner",cr="mathord",Jn="op-token",ya="open",t1="punct",ue="rel",mo="spacing",we="textord";E(M,G,ue,"≡","\\equiv",!0),E(M,G,ue,"≺","\\prec",!0),E(M,G,ue,"≻","\\succ",!0),E(M,G,ue,"","\\sim",!0),E(M,G,ue,"⊥","\\perp"),E(M,G,ue,"⪯","\\preceq",!0),E(M,G,ue,"⪰","\\succeq",!0),E(M,G,ue,"≃","\\simeq",!0),E(M,G,ue,"","\\mid",!0),E(M,G,ue,"≪","\\ll",!0),E(M,G,ue,"≫","\\gg",!0),E(M,G,ue,"≍","\\asymp",!0),E(M,G,ue,"∥","\\parallel"),E(M,G,ue,"⋈","\\bowtie",!0),E(M,G,ue,"⌣","\\smile",!0),E(M,G,ue,"⊑","\\sqsubseteq",!0),E(M,G,ue,"⊒","\\sqsupseteq",!0),E(M,G,ue,"≐","\\doteq",!0),E(M,G,ue,"⌢","\\frown",!0),E(M,G,ue,"∋","\\ni",!0),E(M,G,ue,"∝","\\propto",!0),E(M,G,ue,"⊢","\\vdash",!0),E(M,G,ue,"⊣","\\dashv",!0),E(M,G,ue,"∋","\\owns"),E(M,G,t1,".","\\ldotp"),E(M,G,t1,"⋅","\\cdotp"),E(M,G,we,"#","\\#"),E(rt,G,we,"#","\\#"),E(M,G,we,"&","\\&"),E(rt,G,we,"&","\\&"),E(M,G,we,"ℵ","\\aleph",!0),E(M,G,we,"∀","\\forall",!0),E(M,G,we,"ℏ","\\hbar",!0),E(M,G,we,"∃","\\exists",!0),E(M,G,we,"∇","\\nabla",!0),E(M,G,we,"♭","\\flat",!0),E(M,G,we,"","\\ell",!0),E(M,G,we,"♮","\\natural",!0),E(M,G,we,"♣","\\clubsuit",!0),E(M,G,we,"℘","\\wp",!0),E(M,G,we,"♯","\\sharp",!0),E(M,G,we,"♢","\\diamondsuit",!0),E(M,G,we,"","\\Re",!0),E(M,G,we,"♡","\\heartsuit",!0),E(M,G,we,"","\\Im",!0),E(M,G,we,"♠","\\spadesuit",!0),E(M,G,we,"§","\\S",!0),E(rt,G,we,"§","\\S"),E(M,G,we,"¶","\\P",!0),E(rt,G,we,"¶","\\P"),E(M,G,we,"†","\\dag"),E(rt,G,we,"†","\\dag"),E(rt,G,we,"†","\\textdagger"),E(M,G,we,"‡","\\ddag"),E(rt,G,we,"‡","\\ddag"),E(rt,G,we,"‡","\\textdaggerdbl"),E(M,G,ji,"⎱","\\rmoustache",!0),E(M,G,ya,"⎰","\\lmoustache",!0),E(M,G,ji,"⟯","\\rgroup",!0),E(M,G,ya,"⟮","\\lgroup",!0),E(M,G,Bt,"∓","\\mp",!0),E(M,G,Bt,"⊖","\\ominus",!0),E(M,G,Bt,"⊎","\\uplus",!0),E(M,G,Bt,"⊓","\\sqcap",!0),E(M,G,Bt,"","\\ast"),E(M,G,Bt,"⊔","\\sqcup",!0),E(M,G,Bt,"◯","\\bigcirc",!0),E(M,G,Bt,"∙","\\bullet",!0),E(M,G,Bt,"‡","\\ddagger"),E(M,G,Bt,"≀","\\wr",!0),E(M,G,Bt,"⨿","\\amalg"),E(M,G,Bt,"&","\\And"),E(M,G,ue,"⟵","\\longleftarrow",!0),E(M,G,ue,"⇐","\\Leftarrow",!0),E(M,G,ue,"⟸","\\Longleftarrow",!0),E(M,G,ue,"⟶","\\longrightarrow",!0),E(M,G,ue,"⇒","\\Rightarrow",!0),E(M,G,ue,"⟹","\\Longrightarrow",!0),E(M,G,ue,"↔","\\leftrightarrow",!0),E(M,G,ue,"⟷","\\longleftrightarrow",!0),E(M,G,ue,"⇔","\\Leftrightarrow",!0),E(M,G,ue,"⟺","\\Longleftrightarrow",!0),E(M,G,ue,"↦","\\mapsto",!0),E(M,G,ue,"⟼","\\longmapsto",!0),E(M,G,ue,"↗","\\nearrow",!0),E(M,G,ue,"↩","\\hookleftarrow",!0),E(M,G,ue,"↪","\\hookrightarrow",!0),E(M,G,ue,"↘","\\searrow",!0),E(M,G,ue,"↼","\\leftharpoonup",!0),E(M,G,ue,"⇀","\\rightharpoonup",!0),E(M,G,ue,"↙","\\swarrow",!0),E(M,G,ue,"↽","\\leftharpoondown",!0),E(M,G,ue,"⇁","\\rightharpoondown",!0),E(M,G,ue,"↖","\\nwarrow",!0),E(M,G,ue,"⇌","\\rightleftharpoons",!0),E(M,se,ue,"≮","\\nless",!0),E(M,se,ue,"","\\@nleqslant"),E(M,se,ue,"","\\@nleqq"),E(M,se,ue,"⪇","\\lneq",!0),E(M,se,ue,"≨","\\lneqq",!0),E(M,se,ue,"","\\@lvertneqq"),E(M,se,ue,"⋦","\\lnsim",!0),E(M,se,ue,"⪉","\\lnapprox",!0),E(M,se,ue,"⊀","\\nprec",!0),E(M,se,ue,"⋠","\\npreceq",!0),E(M,se,ue,"⋨","\\precnsim",!0),E(M,se,ue,"⪹","\\precnapprox",!0),E(M,se,ue,"≁","\\nsim",!0),E(M,se,ue,"","\\@nshortmid"),E(M,se,ue,"∤","\\nmid",!0),E(M,se,ue,"⊬","\\nvdash",!0),E(M,se,ue,"⊭","\\nvDash",!0),E(M,se,ue,"⋪","\\ntriangleleft"),E(M,se,ue,"⋬","\\ntrianglelefteq",!0),E(M,se,ue,"⊊","\\subsetneq",!0),E(M,se,ue,"","\\@varsubsetneq"),E(M,se,ue,"⫋","\\subsetneqq",!0),E(M,se,ue,"","\\@varsubsetneqq"),E(M,se,ue,"≯","\\ngtr",!0),E(M,se,ue,"","\\@ngeqslant"),E(M,se,ue,"","\\@ngeqq"),E(M,se,ue,"⪈","\\gneq",!0),E(M,se,ue,"≩","\\gneqq",!0),E(M,se,ue,"","\\@gvertneqq"),E(M,se,ue,"⋧","\\gnsim",!0),E(M,se,ue,"⪊","\\gnapprox",!0),E(M,se,ue,"⊁","\\nsucc",!0),E(M,se,ue,"⋡","\\nsucceq",!0),E(M,se,ue,"⋩","\\succnsim",!0),E(M,se,ue,"⪺","\\succnapprox",!0),E(M,se,ue,"≆","\\ncong",!0),E(M,se,ue,"","\\@nshortparallel"),E(M,se,ue,"∦","\\nparallel",!0),E(M,se,ue,"⊯","\\nVDash",!0),E(M,se,ue,"⋫","\\ntriangleright"),E(M,se,ue,"⋭","\\ntrianglerighteq",!0),E(M,se,ue,"","\\@nsupseteqq"),E(M,se,ue,"⊋","\\supsetneq",!0),E(M,se,ue,"","\\@varsupsetneq"),E(M,se,ue,"⫌","\\supsetneqq",!0),E(M,se,ue,"","\\@varsupsetneqq"),E(M,se,ue,"⊮","\\nVdash",!0),E(M,se,ue,"⪵","\\precneqq",!0),E(M,se,ue,"⪶","\\succneqq",!0),E(M,se,ue,"","\\@nsubseteqq"),E(M,se,Bt,"⊴","\\unlhd"),E(M,se,Bt,"⊵","\\unrhd"),E(M,se,ue,"↚","\\nleftarrow",!0),E(M,se,ue,"↛","\\nrightarrow",!0),E(M,se,ue,"⇍","\\nLeftarrow",!0),E(M,se,ue,"⇏","\\nRightarrow",!0),E(M,se,ue,"↮","\\nleftrightarrow",!0),E(M,se,ue,"⇎","\\nLeftrightarrow",!0),E(M,se,ue,"△","\\vartriangle"),E(M,se,we,"ℏ","\\hslash"),E(M,se,we,"▽","\\triangledown"),E(M,se,we,"◊","\\lozenge"),E(M,se,we,"Ⓢ","\\circledS"),E(M,se,we,"®","\\circledR"),E(rt,se,we,"®","\\circledR"),E(M,se,we,"∡","\\measuredangle",!0),E(M,se,we,"∄","\\nexists"),E(M,se,we,"℧","\\mho"),E(M,se,we,"Ⅎ","\\Finv",!0),E(M,se,we,"⅁","\\Game",!0),E(M,se,we,"","\\backprime"),E(M,se,we,"▲","\\blacktriangle"),E(M,se,we,"▼","\\blacktriangledown"),E(M,se,we,"■","\\blacksquare"),E(M,se,we,"⧫","\\blacklozenge"),E(M,se,we,"★","\\bigstar"),E(M,se,we,"∢","\\sphericalangle",!0),E(M,se,we,"∁","\\complement",!0),E(M,se,we,"ð","\\eth",!0),E(rt,G,we,"ð","ð"),E(M,se,we,"","\\diagup"),E(M,se,we,"╲","\\diagdown"),E(M,se,we,"□","\\square"),E(M,se,we,"□","\\Box"),E(M,se,we,"◊","\\Diamond"),E(M,se,we,"¥","\\yen",!0),E(rt,se,we,"¥","\\yen",!0),E(M,se,we,"✓","\\checkmark",!0),E(rt,se,we,"✓","\\checkmark"),E(M,se,we,"ℶ","\\beth",!0),E(M,se,we,"ℸ","\\daleth",!0),E(M,se,we,"ℷ","\\gimel",!0),E(M,se,we,"ϝ","\\digamma",!0),E(M,se,we,"ϰ","\\varkappa"),E(M,se,ya,"┌","\\@ulcorner",!0),E(M,se,ji,"┐","\\@urcorner",!0),E(M,se,ya,"└","\\@llcorner",!0),E(M,se,ji,"┘","\\@lrcorner",!0),E(M,se,ue,"≦","\\leqq",!0),E(M,se,ue,"⩽","\\leqslant",!0),E(M,se,ue,"⪕","\\eqslantless",!0),E(M,se,ue,"≲","\\lesssim",!0),E(M,se,ue,"⪅","\\lessapprox",!0),E(M,se,ue,"≊","\\approxeq",!0),E(M,se,Bt,"⋖","\\lessdot"),E(M,se,ue,"⋘","\\lll",!0),E(M,se,ue,"≶","\\lessgtr",!0),E(M,se,ue,"⋚","\\lesseqgtr",!0),E(M,se,ue,"⪋","\\lesseqqgtr",!0),E(M,se,ue,"≑","\\doteqdot"),E(M,se,ue,"≓","\\risingdotseq",!0),E(M,se,ue,"≒","\\fallingdotseq",!0),E(M,se,ue,"∽","\\backsim",!0),E(M,se,ue,"⋍","\\backsimeq",!0),E(M,se,ue,"⫅","\\subseteqq",!0),E(M,se,ue,"⋐","\\Subset",!0),E(M,se,ue,"⊏","\\sqsubset",!0),E(M,se,ue,"≼","\\preccurlyeq",!0),E(M,se,ue,"⋞","\\curlyeqprec",!0),E(M,se,ue,"≾","\\precsim",!0),E(M,se,ue,"⪷","\\precapprox",!0),E(M,se,ue,"⊲","\\vartriangleleft"),E(M,se,ue,"⊴","\\trianglelefteq"),E(M,se,ue,"⊨","\\vDash",!0),E(M,se,ue,"⊪","\\Vvdash",!0),E(M,se,ue,"⌣","\\smallsmile"),E(M,se,ue,"⌢","\\smallfrown"),E(M,se,ue,"≏","\\bumpeq",!0),E(M,se,ue,"≎","\\Bumpeq",!0),E(M,se,ue,"≧","\\geqq",!0),E(M,se,ue,"⩾","\\geqslant",!0),E(M,se,ue,"⪖","\\eqslantgtr",!0),E(M,se,ue,"≳","\\gtrsim",!0),E(M,se,ue,"⪆","\\gtrapprox",!0),E(M,se,Bt,"⋗","\\gtrdot"),E(M,se,ue,"⋙","\\ggg",!0),E(M,se,ue,"≷","\\gtrless",!0),E(M,se,ue,"⋛","\\gtreqless",!0),E(M,se,ue,"⪌","\\gtreqqless",!0),E(M,se,ue,"≖","\\eqcirc",!0),E(M,se,ue,"≗","\\circeq",!0),E(M,se,ue,"≜","\\triangleq",!0),E(M,se,ue,"","\\thicksim"),E(M,se,ue,"≈","\\thickapprox"),E(M,se,ue,"⫆","\\supseteqq",!0),E(M,se,ue,"⋑","\\Supset",!0),E(M,se,ue,"⊐","\\sqsupset",!0),E(M,se,ue,"≽","\\succcurlyeq",!0),E(M,se,ue,"⋟","\\curlyeqsucc",!0),E(M,se,ue,"≿","\\succsim",!0),E(M,se,ue,"⪸","\\succapprox",!0),E(M,se,ue,"⊳","\\vartriangleright"),E(M,se,ue,"⊵","\\trianglerighteq"),E(M,se,ue,"⊩","\\Vdash",!0),E(M,se,ue,"","\\shortmid"),E(M,se,ue,"∥","\\shortparallel"),E(M,se,ue,"≬","\\between",!0),E(M,se,ue,"⋔","\\pitchfork",!0),E(M,se,ue,"∝","\\varpropto"),E(M,se,ue,"◀","\\blacktriangleleft"),E(M,se,ue,"∴","\\therefore",!0),E(M,se,ue,"∍","\\backepsilon"),E(M,se,ue,"▶","\\blacktriangleright"),E(M,se,ue,"∵","\\because",!0),E(M,se,ue,"⋘","\\llless"),E(M,se,ue,"⋙","\\gggtr"),E(M,se,Bt,"⊲","\\lhd"),E(M,se,Bt,"⊳","\\rhd"),E(M,se,ue,"≂","\\eqsim",!0),E(M,G,ue,"⋈","\\Join"),E(M,se,ue,"≑","\\Doteq",!0),E(M,se,Bt,"∔","\\dotplus",!0),E(M,se,Bt,"","\\smallsetminus"),E(M,se,Bt,"⋒","\\Cap",!0),E(M,se,Bt,"⋓","\\Cup",!0),E(M,se,Bt,"⩞","\\doublebarwedge",!0),E(M,se,Bt,"⊟","\\boxminus",!0),E(M,se,Bt,"⊞","\\boxplus",!0),E(M,se,Bt,"⋇","\\divideontimes",!0),E(M,se,Bt,"⋉","\\ltimes",!0),E(M,se,Bt,"⋊","\\rtimes",!0),E(M,se,Bt,"⋋","\\leftthreetimes",!0),E(M,se,Bt,"⋌","\\rightthreetimes",!0),E(M,se,Bt,"⋏","\\curlywedge",!0),E(M,se,Bt,"⋎","\\curlyvee",!0),E(M,se,Bt,"⊝","\\circleddash",!0),E(M,se,Bt,"⊛","\\circledast",!0),E(M,se,Bt,"⋅","\\centerdot"),E(M,se,Bt,"⊺","\\intercal",!0),E(M,se,Bt,"⋒","\\doublecap"),E(M,se,Bt,"⋓","\\doublecup"),E(M,se,Bt,"⊠","\\boxtimes",!0),E(M,se,ue,"⇢","\\dashrightarrow",!0),E(M,se,ue,"⇠","\\dashleftarrow",!0),E(M,se,ue,"⇇","\\leftleftarrows",!0),E(M,se,ue,"⇆","\\leftrightarrows",!0),E(M,se,ue,"⇚","\\Lleftarrow",!0),E(M,se,ue,"↞","\\twoheadleftarrow",!0),E(M,se,ue,"↢","\\leftarrowtail",!0),E(M,se,ue,"↫","\\looparrowleft",!0),E(M,se,ue,"⇋","\\leftrightharpoons",!0),E(M,se,ue,"↶","\\curvearrowleft",!0),E(M,se,ue,"↺","\\circlearrowleft",!0),E(M,se,ue,"↰","\\Lsh",!0),E(M,se,ue,"⇈","\\upuparrows",!0),E(M,se,ue,"↿","\\upharpoonleft",!0),E(M,se,ue,"⇃","\\downharpoonleft",!0),E(M,G,ue,"⊶","\\origof",!0),E(M,G,ue,"⊷","\\imageof",!0),E(M,se,ue,"⊸","\\multimap",!0),E(M,se,ue,"↭","\\leftrightsquigarrow",!0),E(M,se,ue,"⇉","\\rightrightarrows",!0),E(M,se,ue,"⇄","\\rightleftarrows",!0),E(M,se,ue,"↠","\\twoheadrightarrow",!0),E(M,se,ue,"↣","\\rightarrowtail",!0),E(M,se,ue,"↬","\\looparrowright",!0),E(M,se,ue,"↷","\\curvearrowright",!0),E(M,se,ue,"↻","\\circlearrowright",!0),E(M,se,ue,"↱","\\Rsh",!0),E(M,se,ue,"⇊","\\downdownarrows",!0),E(M,se,ue,"↾","\\upharpoonright",!0),E(M,se,ue,"⇂","\\downharpoonright",!0),E(M,se,ue,"⇝","\\rightsquigarrow",!0),E(M,se,ue,"⇝","\\leadsto"),E(M,se,ue,"⇛","\\Rrightarrow",!0),E(M,se,ue,"↾","\\restriction"),E(M,G,we,"","`"),E(M,G,we,"$","\\$"),E(rt,G,we,"$","\\$"),E(rt,G,we,"$","\\textdollar"),E(M,G,we,"%","\\%"),E(rt,G,we,"%","\\%"),E(M,G,we,"_","\\_"),E(rt,G,we,"_","\\_"),E(rt,G,we,"_","\\textunderscore"),E(M,G,we,"∠","\\angle",!0),E(M,G,we,"∞","\\infty",!0),E(M,G,we,"","\\prime"),E(M,G,we,"△","\\triangle"),E(M,G,we,"Γ","\\Gamma",!0),E(M,G,we,"Δ","\\Delta",!0),E(M,G,we,"Θ","\\Theta",!0),E(M,G,we,"Λ","\\Lambda",!0),E(M,G,we,"Ξ","\\Xi",!0),E(M,G,we,"Π","\\Pi",!0),E(M,G,we,"Σ","\\Sigma",!0),E(M,G,we,"Υ","\\Upsilon",!0),E(M,G,we,"Φ","\\Phi",!0),E(M,G,we,"Ψ","\\Psi",!0),E(M,G,we,"Ω","\\Omega",!0),E(M,G,we,"A","Α"),E(M,G,we,"B","Β"),E(M,G,we,"E","Ε"),E(M,G,we,"Z","Ζ"),E(M,G,we,"H","Η"),E(M,G,we,"I","Ι"),E(M,G,we,"K","Κ"),E(M,G,we,"M","Μ"),E(M,G,we,"N","Ν"),E(M,G,we,"O","Ο"),E(M,G,we,"P","Ρ"),E(M,G,we,"T","Τ"),E(M,G,we,"X","Χ"),E(M,G,we,"¬","\\neg",!0),E(M,G,we,"¬","\\lnot"),E(M,G,we,"","\\top"),E(M,G,we,"⊥","\\bot"),E(M,G,we,"∅","\\emptyset"),E(M,se,we,"∅","\\varnothing"),E(M,G,cr,"α","\\alpha",!0),E(M,G,cr,"β","\\beta",!0),E(M,G,cr,"γ","\\gamma",!0),E(M,G,cr,"δ","\\delta",!0),E(M,G,cr,"ϵ","\\epsilon",!0),E(M,G,cr,"ζ","\\zeta",!0),E(M,G,cr,"η","\\eta",!0),E(M,G,cr,"θ","\\theta",!0),E(M,G,cr,"ι","\\iota",!0),E(M,G,cr,"κ","\\kappa",!0),E(M,G,cr,"λ","\\lambda",!0),E(M,G,cr,"μ","\\mu",!0),E(M,G,cr,"ν","\\nu",!0),E(M,G,cr,"ξ","\\xi",!0),E(M,G,cr,"ο","\\omicron",!0),E(M,G,cr,"π","\\pi",!0),E(M,G,cr,"ρ","\\rho",!0),E(M,G,cr,"σ","\\sigma",!0),E(M,G,cr,"τ","\\tau",!0),E(M,G,cr,"υ","\\upsilon",!0),E(M,G,cr,"ϕ","\\phi",!0),E(M,G,cr,"χ","\\chi",!0),E(M,G,cr,"ψ","\\psi",!0),E(M,G,cr,"ω","\\omega",!0),E(M,G,cr,"ε","\\varepsilon",!0),E(M,G,cr,"ϑ","\\vartheta",!0),E(M,G,cr,"ϖ","\\varpi",!0),E(M,G,cr,"ϱ","\\varrho",!0),E(M,G,cr,"ς","\\varsigma",!0),E(M,G,cr,"φ","\\varphi",!0),E(M,G,Bt,"","*",!0),E(M,G,Bt,"+","+"),E(M,G,Bt,"","-",!0),E(M,G,Bt,"⋅","\\cdot",!0),E(M,G,Bt,"∘","\\circ",!0),E(M,G,Bt,"÷","\\div",!0),E(M,G,Bt,"±","\\pm",!0),E(M,G,Bt,"×","\\times",!0),E(M,G,Bt,"∩","\\cap",!0),E(M,G,Bt,"","\\cup",!0),E(M,G,Bt,"","\\setminus",!0),E(M,G,Bt,"∧","\\land"),E(M,G,Bt,"","\\lor"),E(M,G,Bt,"∧","\\wedge",!0),E(M,G,Bt,"","\\vee",!0),E(M,G,we,"√","\\surd"),E(M,G,ya,"⟨","\\langle",!0),E(M,G,ya,"","\\lvert"),E(M,G,ya,"∥","\\lVert"),E(M,G,ji,"?","?"),E(M,G,ji,"!","!"),E(M,G,ji,"⟩","\\rangle",!0),E(M,G,ji,"","\\rvert"),E(M,G,ji,"∥","\\rVert"),E(M,G,ue,"=","="),E(M,G,ue,":",":"),E(M,G,ue,"≈","\\approx",!0),E(M,G,ue,"≅","\\cong",!0),E(M,G,ue,"≥","\\ge"),E(M,G,ue,"≥","\\geq",!0),E(M,G,ue,"←","\\gets"),E(M,G,ue,">","\\gt",!0),E(M,G,ue,"∈","\\in",!0),E(M,G,ue,"","\\@not"),E(M,G,ue,"⊂","\\subset",!0),E(M,G,ue,"⊃","\\supset",!0),E(M,G,ue,"⊆","\\subseteq",!0),E(M,G,ue,"⊇","\\supseteq",!0),E(M,se,ue,"⊈","\\nsubseteq",!0),E(M,se,ue,"⊉","\\nsupseteq",!0),E(M,G,ue,"⊨","\\models"),E(M,G,ue,"←","\\leftarrow",!0),E(M,G,ue,"≤","\\le"),E(M,G,ue,"≤","\\leq",!0),E(M,G,ue,"<","\\lt",!0),E(M,G,ue,"→","\\rightarrow",!0),E(M,G,ue,"→","\\to"),E(M,se,ue,"≱","\\ngeq",!0),E(M,se,ue,"≰","\\nleq",!0),E(M,G,mo," ","\\ "),E(M,G,mo," ","\\space"),E(M,G,mo," ","\\nobreakspace"),E(rt,G,mo," ","\\ "),E(rt,G,mo," "," "),E(rt,G,mo," ","\\space"),E(rt,G,mo," ","\\nobreakspace"),E(M,G,mo,null,"\\nobreak"),E(M,G,mo,null,"\\allowbreak"),E(M,G,t1,",",","),E(M,G,t1,";",";"),E(M,se,Bt,"⊼","\\barwedge",!0),E(M,se,Bt,"⊻","\\veebar",!0),E(M,G,Bt,"⊙","\\odot",!0),E(M,G,Bt,"⊕","\\oplus",!0),E(M,G,Bt,"⊗","\\otimes",!0),E(M,G,we,"∂","\\partial",!0),E(M,G,Bt,"⊘","\\oslash",!0),E(M,se,Bt,"⊚","\\circledcirc",!0),E(M,se,Bt,"⊡","\\boxdot",!0),E(M,G,Bt,"△","\\bigtriangleup"),E(M,G,Bt,"▽","\\bigtriangledown"),E(M,G,Bt,"†","\\dagger"),E(M,G,Bt,"⋄","\\diamond"),E(M,G,Bt,"⋆","\\star"),E(M,G,Bt,"◃","\\triangleleft"),E(M,G,Bt,"▹","\\triangleright"),E(M,G,ya,"{","\\{"),E(rt,G,we,"{","\\{"),E(rt,G,we,"{","\\textbraceleft"),E(M,G,ji,"}","\\}"),E(rt,G,we,"}","\\}"),E(rt,G,we,"}","\\textbraceright"),E(M,G,ya,"{","\\lbrace"),E(M,G,ji,"}","\\rbrace"),E(M,G,ya,"[","\\lbrack",!0),E(rt,G,we,"[","\\lbrack",!0),E(M,G,ji,"]","\\rbrack",!0),E(rt,G,we,"]","\\rbrack",!0),E(M,G,ya,"(","\\lparen",!0),E(M,G,ji,")","\\rparen",!0),E(rt,G,we,"<","\\textless",!0),E(rt,G,we,">","\\textgreater",!0),E(M,G,ya,"⌊","\\lfloor",!0),E(M,G,ji,"⌋","\\rfloor",!0),E(M,G,ya,"⌈","\\lceil",!0),E(M,G,ji,"⌉","\\rceil",!0),E(M,G,we,"\\","\\backslash"),E(M,G,we,"","|"),E(M,G,we,"","\\vert"),E(rt,G,we,"|","\\textbar",!0),E(M,G,we,"∥","\\|"),E(M,G,we,"∥","\\Vert"),E(rt,G,we,"∥","\\textbardbl"),E(rt,G,we,"~","\\textasciitilde"),E(rt,G,we,"\\","\\textbackslash"),E(rt,G,we,"^","\\textasciicircum"),E(M,G,ue,"↑","\\uparrow",!0),E(M,G,ue,"⇑","\\Uparrow",!0),E(M,G,ue,"↓","\\downarrow",!0),E(M,G,ue,"⇓","\\Downarrow",!0),E(M,G,ue,"↕","\\updownarrow",!0),E(M,G,ue,"⇕","\\Updownarrow",!0),E(M,G,Jn,"∐","\\coprod"),E(M,G,Jn,"","\\bigvee"),E(M,G,Jn,"⋀","\\bigwedge"),E(M,G,Jn,"⨄","\\biguplus"),E(M,G,Jn,"⋂","\\bigcap"),E(M,G,Jn,"","\\bigcup"),E(M,G,Jn,"∫","\\int"),E(M,G,Jn,"∫","\\intop"),E(M,G,Jn,"∬","\\iint"),E(M,G,Jn,"∭","\\iiint"),E(M,G,Jn,"∏","\\prod"),E(M,G,Jn,"∑","\\sum"),E(M,G,Jn,"⨂","\\bigotimes"),E(M,G,Jn,"⨁","\\bigoplus"),E(M,G,Jn,"⨀","\\bigodot"),E(M,G,Jn,"∮","\\oint"),E(M,G,Jn,"∯","\\oiint"),E(M,G,Jn,"∰","\\oiiint"),E(M,G,Jn,"⨆","\\bigsqcup"),E(M,G,Jn,"∫","\\smallint"),E(rt,G,ku,"…","\\textellipsis"),E(M,G,ku,"…","\\mathellipsis"),E(rt,G,ku,"…","\\ldots",!0),E(M,G,ku,"…","\\ldots",!0),E(M,G,ku,"⋯","\\@cdots",!0),E(M,G,ku,"⋱","\\ddots",!0),E(M,G,we,"⋮","\\varvdots"),E(rt,G,we,"⋮","\\varvdots"),E(M,G,Cn,"ˊ","\\acute"),E(M,G,Cn,"ˋ","\\grave"),E(M,G,Cn,"¨","\\ddot"),E(M,G,Cn,"~","\\tilde"),E(M,G,Cn,"ˉ","\\bar"),E(M,G,Cn,"˘","\\breve"),E(M,G,Cn,"ˇ","\\check"),E(M,G,Cn,"^","\\hat"),E(M,G,Cn,"⃗","\\vec"),E(M,G,Cn,"˙","\\dot"),E(M,G,Cn,"˚","\\mathring"),E(M,G,cr,"","\\@imath"),E(M,G,cr,"","\\@jmath"),E(M,G,we,"ı","ı"),E(M,G,we,"ȷ","ȷ"),E(rt,G,we,"ı","\\i",!0),E(rt,G,we,"ȷ","\\j",!0),E(rt,G,we,"ß","\\ss",!0),E(rt,G,we,"æ","\\ae",!0),E(rt,G,we,"œ","\\oe",!0),E(rt,G,we,"ø","\\o",!0),E(rt,G,we,"Æ","\\AE",!0),E(rt,G,we,"Œ","\\OE",!0),E(rt,G,we,"Ø","\\O",!0),E(rt,G,Cn,"ˊ","\\'"),E(rt,G,Cn,"ˋ","\\`"),E(rt,G,Cn,"ˆ","\\^"),E(rt,G,Cn,"˜","\\~"),E(rt,G,Cn,"ˉ","\\="),E(rt,G,Cn,"˘","\\u"),E(rt,G,Cn,"˙","\\."),E(rt,G,Cn,"¸","\\c"),E(rt,G,Cn,"˚","\\r"),E(rt,G,Cn,"ˇ","\\v"),E(rt,G,Cn,"¨",'\\"'),E(rt,G,Cn,"˝","\\H"),E(rt,G,Cn,"◯","\\textcircled");var Qw={"--":!0,"---":!0,"``":!0,"''":!0};E(rt,G,we,"","--",!0),E(rt,G,we,"","\\textendash"),E(rt,G,we,"—","---",!0),E(rt,G,we,"—","\\textemdash"),E(rt,G,we,"","`",!0),E(rt,G,we,"","\\textquoteleft"),E(rt,G,we,"","'",!0),E(rt,G,we,"","\\textquoteright"),E(rt,G,we,"“","``",!0),E(rt,G,we,"“","\\textquotedblleft"),E(rt,G,we,"”","''",!0),E(rt,G,we,"”","\\textquotedblright"),E(M,G,we,"°","\\degree",!0),E(rt,G,we,"°","\\degree"),E(rt,G,we,"°","\\textdegree",!0),E(M,G,we,"£","\\pounds"),E(M,G,we,"£","\\mathsterling",!0),E(rt,G,we,"£","\\pounds"),E(rt,G,we,"£","\\textsterling",!0),E(M,se,we,"✠","\\maltese"),E(rt,se,we,"✠","\\maltese");for(var Zw='0123456789/@."',h3=0;h3<Zw.length;h3++){var ex=Zw.charAt(h3);E(M,G,we,ex,ex)}for(var tx='0123456789!@*()-=+";:?/.,',d3=0;d3<tx.length;d3++){var rx=tx.charAt(d3);E(rt,G,we,rx,rx)}for(var r1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",f3=0;f3<r1.length;f3++){var n1=r1.charAt(f3);E(M,G,cr,n1,n1),E(rt,G,we,n1,n1)}E(M,se,we,"C",""),E(rt,se,we,"C",""),E(M,se,we,"H",""),E(rt,se,we,"H",""),E(M,se,we,"N",""),E(rt,se,we,"N",""),E(M,se,we,"P",""),E(rt,se,we,"P",""),E(M,se,we,"Q",""),E(rt,se,we,"Q",""),E(M,se,we,"R",""),E(rt,se,we,"R",""),E(M,se,we,"Z",""),E(rt,se,we,"Z",""),E(M,G,cr,"h",""),E(rt,G,cr,"h","");for(var pr="",Hi=0;Hi<r1.length;Hi++){var Fn=r1.charAt(Hi);pr=String.fromCharCode(55349,56320+Hi),E(M,G,cr,Fn,pr),E(rt,G,we,Fn,pr),pr=String.fromCharCode(55349,56372+Hi),E(M,G,cr,Fn,pr),E(rt,G,we,Fn,pr),pr=String.fromCharCode(55349,56424+Hi),E(M,G,cr,Fn,pr),E(rt,G,we,Fn,pr),pr=String.fromCharCode(55349,56580+Hi),E(M,G,cr,Fn,pr),E(rt,G,we,Fn,pr),pr=String.fromCharCode(55349,56684+Hi),E(M,G,cr,Fn,pr),E(rt,G,we,Fn,pr),pr=String.fromCharCode(55349,56736+Hi),E(M,G,cr,Fn,pr),E(rt,G,we,Fn,pr),pr=String.fromCharCode(55349,56788+Hi),E(M,G,cr,Fn,pr),E(rt,G,we,Fn,pr),pr=String.fromCharCode(55349,56840+Hi),E(M,G,cr,Fn,pr),E(rt,G,we,Fn,pr),pr=String.fromCharCode(55349,56944+Hi),E(M,G,cr,Fn,pr),E(rt,G,we,Fn,pr),Hi<26&&(pr=String.fromCharCode(55349,56632+Hi),E(M,G,cr,Fn,pr),E(rt,G,we,Fn,pr),pr=String.fromCharCode(55349,56476+Hi),E(M,G,cr,Fn,pr),E(rt,G,we,Fn,pr))}pr="𝕜",E(M,G,cr,"k",pr),E(rt,G,we,"k",pr);for(var oc=0;oc<10;oc++){var ll=oc.toString();pr=String.fromCharCode(55349,57294+oc),E(M,G,cr,ll,pr),E(rt,G,we,ll,pr),pr=String.fromCharCode(55349,57314+oc),E(M,G,cr,ll,pr),E(rt,G,we,ll,pr),pr=String.fromCharCode(55349,57324+oc),E(M,G,cr,ll,pr),E(rt,G,we,ll,pr),pr=String.fromCharCode(55349,57334+oc),E(M,G,cr,ll,pr),E(rt,G,we,ll,pr)}for(var g3="ÐÞþ",p3=0;p3<g3.length;p3++){var i1=g3.charAt(p3);E(M,G,cr,i1,i1),E(rt,G,we,i1,i1)}var a1=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],nx=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],WY=function(e,t){var n=e.charCodeAt(0),i=e.charCodeAt(1),a=(n-55296)*1024+(i-56320)+65536,s=t==="math"?0:1;if(119808<=a&&a<120484){var o=Math.floor((a-119808)/26);return[a1[o][2],a1[o][s]]}else if(120782<=a&&a<=120831){var l=Math.floor((a-120782)/10);return[nx[l][2],nx[l][s]]}else{if(a===120485||a===120486)return[a1[0][2],a1[0][s]];if(120486<a&&a<120782)return["",""];throw new ut("Unsupported character: "+e)}},s1=function(e,t,n){return wn[n][e]&&wn[n][e].replace&&(e=wn[n][e].replace),{value:e,metrics:s3(e,t,n)}},rs=function(e,t,n,i,a){var s=s1(e,t,n),o=s.metrics;e=s.value;var l;if(o){var c=o.italic;(n==="text"||i&&i.font==="mathit")&&(c=0),l=new ja(e,o.height,o.depth,c,o.skew,o.width,a)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+t+"' and mode '"+n+"'")),l=new ja(e,0,0,0,0,0,a);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var u=i.getColor();u&&(l.style.color=u)}return l},VY=function(e,t,n,i){return i===void 0&&(i=[]),n.font==="boldsymbol"&&s1(e,"Main-Bold",t).metrics?rs(e,"Main-Bold",t,n,i.concat(["mathbf"])):e==="\\"||wn[t][e].font==="main"?rs(e,"Main-Regular",t,n,i):rs(e,"AMS-Regular",t,n,i.concat(["amsrm"]))},XY=function(e,t,n,i,a){return a!=="textord"&&s1(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},$Y=function(e,t,n){var i=e.mode,a=e.text,s=["mord"],o=i==="math"||i==="text"&&t.font,l=o?t.font:t.fontFamily,c="",u="";if(a.charCodeAt(0)===55349&&([c,u]=WY(a,i)),c.length>0)return rs(a,c,i,t,s.concat(u));if(l){var h,d;if(l==="boldsymbol"){var f=XY(a,i,t,s,n);h=f.fontName,d=[f.fontClass]}else o?(h=sx[l].fontName,d=[l]):(h=o1(l,t.fontWeight,t.fontShape),d=[l,t.fontWeight,t.fontShape]);if(s1(a,h,i).metrics)return rs(a,h,i,t,s.concat(d));if(Qw.hasOwnProperty(a)&&h.slice(0,10)==="Typewriter"){for(var p=[],m=0;m<a.length;m++)p.push(rs(a[m],h,i,t,s.concat(d)));return ax(p)}}if(n==="mathord")return rs(a,"Math-Italic",i,t,s.concat(["mathnormal"]));if(n==="textord"){var y=wn[i][a]&&wn[i][a].font;if(y==="ams"){var v=o1("amsrm",t.fontWeight,t.fontShape);return rs(a,v,i,t,s.concat("amsrm",t.fontWeight,t.fontShape))}else if(y==="main"||!y){var x=o1("textrm",t.fontWeight,t.fontShape);return rs(a,x,i,t,s.concat(t.fontWeight,t.fontShape))}else{var S=o1(y,t.fontWeight,t.fontShape);return rs(a,S,i,t,s.concat(S,t.fontWeight,t.fontShape))}}else throw new Error("unexpected type: "+n+" in makeOrd")},KY=(r,e)=>{if(sl(r.classes)!==sl(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize)return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var n in r.style)if(r.style.hasOwnProperty(n)&&r.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&r.style[i]!==e.style[i])return!1;return!0},YY=r=>{for(var e=0;e<r.length-1;e++){var t=r[e],n=r[e+1];t instanceof ja&&n instanceof ja&&KY(t,n)&&(t.text+=n.text,t.height=Math.max(t.height,n.height),t.depth=Math.max(t.depth,n.depth),t.italic=n.italic,r.splice(e+1,1),e--)}return r},m3=function(e){for(var t=0,n=0,i=0,a=0;a<e.children.length;a++){var s=e.children[a];s.height>t&&(t=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},ra=function(e,t,n,i){var a=new dd(e,t,n,i);return m3(a),a},ix=(r,e,t,n)=>new dd(r,e,t,n),JY=function(e,t,n){var i=ra([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=xt(i.height),i.maxFontSize=1,i},QY=function(e,t,n,i){var a=new c3(e,t,n,i);return m3(a),a},ax=function(e){var t=new hd(e);return m3(t),t},ZY=function(e,t){return e instanceof hd?ra([],[e],t):e},eJ=function(e){if(e.positionType==="individualShift"){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,a=i,s=1;s<t.length;s++){var o=-t[s].shift-a-t[s].elem.depth,l=o-(t[s-1].elem.height+t[s-1].elem.depth);a=a+o,n.push({type:"kern",size:l}),n.push(t[s])}return{children:n,depth:i}}var c;if(e.positionType==="top"){for(var u=e.positionData,h=0;h<e.children.length;h++){var d=e.children[h];u-=d.type==="kern"?d.size:d.elem.height+d.elem.depth}c=u}else if(e.positionType==="bottom")c=-e.positionData;else{var f=e.children[0];if(f.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")c=-f.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")c=-f.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:c}},tJ=function(e,t){for(var{children:n,depth:i}=eJ(e),a=0,s=0;s<n.length;s++){var o=n[s];if(o.type==="elem"){var l=o.elem;a=Math.max(a,l.maxFontSize,l.height)}}a+=2;var c=ra(["pstrut"],[]);c.style.height=xt(a);for(var u=[],h=i,d=i,f=i,p=0;p<n.length;p++){var m=n[p];if(m.type==="kern")f+=m.size;else{var y=m.elem,v=m.wrapperClasses||[],x=m.wrapperStyle||{},S=ra(v,[c,y],void 0,x);S.style.top=xt(-a-f-y.depth),m.marginLeft&&(S.style.marginLeft=m.marginLeft),m.marginRight&&(S.style.marginRight=m.marginRight),u.push(S),f+=y.height+y.depth}h=Math.min(h,f),d=Math.max(d,f)}var A=ra(["vlist"],u);A.style.height=xt(d);var C;if(h<0){var k=ra([],[]),I=ra(["vlist"],[k]);I.style.height=xt(-h);var R=ra(["vlist-s"],[new ja("")]);C=[ra(["vlist-r"],[A,R]),ra(["vlist-r"],[I])]}else C=[ra(["vlist-r"],[A])];var U=ra(["vlist-t"],C);return C.length===2&&U.classes.push("vlist-t2"),U.height=d,U.depth=-h,U},rJ=(r,e)=>{var t=ra(["mspace"],[],e),n=On(r,e);return t.style.marginRight=xt(n),t},o1=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var a;return t==="textbf"&&n==="textit"?a="BoldItalic":t==="textbf"?a="Bold":t==="textit"?a="Italic":a="Regular",i+"-"+a},sx={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},ox={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},nJ=function(e,t){var[n,i,a]=ox[e],s=new ol(n),o=new po([s],{width:xt(i),height:xt(a),style:"width:"+xt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=ix(["overlay"],[o],t);return l.height=a,l.style.height=xt(a),l.style.width=xt(i),l},Ne={fontMap:sx,makeSymbol:rs,mathsym:VY,makeSpan:ra,makeSvgSpan:ix,makeLineSpan:JY,makeAnchor:QY,makeFragment:ax,wrapFragment:ZY,makeVList:tJ,makeOrd:$Y,makeGlue:rJ,staticSvg:nJ,svgData:ox,tryCombineChars:YY},Nn={number:3,unit:"mu"},lc={number:4,unit:"mu"},bo={number:5,unit:"mu"},iJ={mord:{mop:Nn,mbin:lc,mrel:bo,minner:Nn},mop:{mord:Nn,mop:Nn,mrel:bo,minner:Nn},mbin:{mord:lc,mop:lc,mopen:lc,minner:lc},mrel:{mord:bo,mop:bo,mopen:bo,minner:bo},mopen:{},mclose:{mop:Nn,mbin:lc,mrel:bo,minner:Nn},mpunct:{mord:Nn,mop:Nn,mrel:bo,mopen:Nn,mclose:Nn,mpunct:Nn,minner:Nn},minner:{mord:Nn,mop:Nn,mbin:lc,mrel:bo,mopen:Nn,mpunct:Nn,minner:Nn}},aJ={mord:{mop:Nn},mop:{mord:Nn,mop:Nn},mbin:{},mrel:{},mopen:{},mclose:{mop:Nn},mpunct:{},minner:{mop:Nn}},lx={},l1={},c1={};function Pt(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=r,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l<t.length;++l)lx[t[l]]=o;e&&(a&&(l1[e]=a),s&&(c1[e]=s))}function cc(r){var{type:e,htmlBuilder:t,mathmlBuilder:n}=r;Pt({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:t,mathmlBuilder:n})}var u1=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},Hn=function(e){return e.type==="ordgroup"?e.body:[e]},vo=Ne.makeSpan,sJ=["leftmost","mbin","mopen","mrel","mop","mpunct"],oJ=["rightmost","mrel","mclose","mpunct"],lJ={display:lr.DISPLAY,text:lr.TEXT,script:lr.SCRIPT,scriptscript:lr.SCRIPTSCRIPT},cJ={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},ti=function(e,t,n,i){i===void 0&&(i=[null,null]);for(var a=[],s=0;s<e.length;s++){var o=an(e[s],t);if(o instanceof hd){var l=o.children;a.push(...l)}else a.push(o)}if(Ne.tryCombineChars(a),!n)return a;var c=t;if(e.length===1){var u=e[0];u.type==="sizing"?c=t.havingSize(u.size):u.type==="styling"&&(c=t.havingStyle(lJ[u.style]))}var h=vo([i[0]||"leftmost"],[],t),d=vo([i[1]||"rightmost"],[],t),f=n==="root";return cx(a,(p,m)=>{var y=m.classes[0],v=p.classes[0];y==="mbin"&&ar.contains(oJ,v)?m.classes[0]="mord":v==="mbin"&&ar.contains(sJ,y)&&(p.classes[0]="mord")},{node:h},d,f),cx(a,(p,m)=>{var y=b3(m),v=b3(p),x=y&&v?p.hasClass("mtight")?aJ[y][v]:iJ[y][v]:null;if(x)return Ne.makeGlue(x,c)},{node:h},d,f),a},cx=function r(e,t,n,i,a){i&&e.push(i);for(var s=0;s<e.length;s++){var o=e[s],l=ux(o);if(l){r(l.children,t,n,null,a);continue}var c=!o.hasClass("mspace");if(c){var u=t(o,n.node);u&&(n.insertAfter?n.insertAfter(u):(e.unshift(u),s++))}c?n.node=o:a&&o.hasClass("newline")&&(n.node=vo(["leftmost"])),n.insertAfter=(h=>d=>{e.splice(h+1,0,d),s++})(s)}i&&e.pop()},ux=function(e){return e instanceof hd||e instanceof c3||e instanceof dd&&e.hasClass("enclosing")?e:null},uJ=function r(e,t){var n=ux(e);if(n){var i=n.children;if(i.length){if(t==="right")return r(i[i.length-1],"right");if(t==="left")return r(i[0],"left")}}return e},b3=function(e,t){return e?(t&&(e=uJ(e,t)),cJ[e.classes[0]]||null):null},fd=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return vo(t.concat(n))},an=function(e,t,n){if(!e)return vo();if(l1[e.type]){var i=l1[e.type](e,t);if(n&&t.size!==n.size){i=vo(t.sizingClasses(n),[i],t);var a=t.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new ut("Got group of unknown type: '"+e.type+"'")};function h1(r,e){var t=vo(["base"],r,e),n=vo(["strut"]);return n.style.height=xt(t.height+t.depth),t.depth&&(n.style.verticalAlign=xt(-t.depth)),t.children.unshift(n),t}function v3(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var n=ti(r,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o<n.length;o++)if(s.push(n[o]),n[o].hasClass("mbin")||n[o].hasClass("mrel")||n[o].hasClass("allowbreak")){for(var l=!1;o<n.length-1&&n[o+1].hasClass("mspace")&&!n[o+1].hasClass("newline");)o++,s.push(n[o]),n[o].hasClass("nobreak")&&(l=!0);l||(a.push(h1(s,e)),s=[])}else n[o].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(h1(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(h1(s,e));var c;t?(c=h1(ti(t,e,!0)),c.classes=["tag"],a.push(c)):i&&a.push(i);var u=vo(["katex-html"],a);if(u.setAttribute("aria-hidden","true"),c){var h=c.children[0];h.style.height=xt(u.height+u.depth),u.depth&&(h.style.verticalAlign=xt(-u.depth))}return u}function hx(r){return new hd(r)}class wa{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=sl(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Is&&this.children[n+1]instanceof Is){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Is;)i+=this.children[++n].toText();e.appendChild(new Is(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=ar.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+ar.escape(sl(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Is{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return ar.escape(this.toText())}toText(){return this.text}}class hJ{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character="":e>=.1666&&e<=.1667?this.character="":e>=.2222&&e<=.2223?this.character="":e>=.2777&&e<=.2778?this.character="":e>=-.05556&&e<=-.05555?this.character="":e>=-.1667&&e<=-.1666?this.character="":e>=-.2223&&e<=-.2222?this.character="":e>=-.2778&&e<=-.2777?this.character="":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",xt(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+xt(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var st={MathNode:wa,TextNode:Is,SpaceNode:hJ,newDocumentFragment:hx},Ha=function(e,t,n){return wn[t][e]&&wn[t][e].replace&&e.charCodeAt(0)!==55349&&!(Qw.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=wn[t][e].replace),new st.TextNode(e)},y3=function(e){return e.length===1?e[0]:new st.MathNode("mrow",e)},w3=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var n=t.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var a=e.text;if(ar.contains(["\\imath","\\jmath"],a))return null;wn[i][a]&&wn[i][a].replace&&(a=wn[i][a].replace);var s=Ne.fontMap[n].fontName;return s3(a,s,i)?Ne.fontMap[n].variant:null};function x3(r){if(!r)return!1;if(r.type==="mi"&&r.children.length===1){var e=r.children[0];return e instanceof Is&&e.text==="."}else if(r.type==="mo"&&r.children.length===1&&r.getAttribute("separator")==="true"&&r.getAttribute("lspace")==="0em"&&r.getAttribute("rspace")==="0em"){var t=r.children[0];return t instanceof Is&&t.text===","}else return!1}var na=function(e,t,n){if(e.length===1){var i=yn(e[0],t);return n&&i instanceof wa&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o<e.length;o++){var l=yn(e[o],t);if(l instanceof wa&&s instanceof wa){if(l.type==="mtext"&&s.type==="mtext"&&l.getAttribute("mathvariant")===s.getAttribute("mathvariant")){s.children.push(...l.children);continue}else if(l.type==="mn"&&s.type==="mn"){s.children.push(...l.children);continue}else if(x3(l)&&s.type==="mn"){s.children.push(...l.children);continue}else if(l.type==="mn"&&x3(s))l.children=[...s.children,...l.children],a.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(s.type==="mn"||x3(s))){var c=l.children[0];c instanceof wa&&c.type==="mn"&&(c.children=[...s.children,...c.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var u=s.children[0];if(u instanceof Is&&u.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var h=l.children[0];h instanceof Is&&h.text.length>0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),a.pop())}}}a.push(l),s=l}return a},cl=function(e,t,n){return y3(na(e,t,n))},yn=function(e,t){if(!e)return new st.MathNode("mrow");if(c1[e.type]){var n=c1[e.type](e,t);return n}else throw new ut("Got group of unknown type: '"+e.type+"'")};function dx(r,e,t,n,i){var a=na(r,t),s;a.length===1&&a[0]instanceof wa&&ar.contains(["mrow","mtable"],a[0].type)?s=a[0]:s=new st.MathNode("mrow",a);var o=new st.MathNode("annotation",[new st.TextNode(e)]);o.setAttribute("encoding","application/x-tex");var l=new st.MathNode("semantics",[s,o]),c=new st.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");var u=i?"katex":"katex-mathml";return Ne.makeSpan([u],[c])}var fx=function(e){return new go({style:e.displayMode?lr.DISPLAY:lr.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},gx=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Ne.makeSpan(n,[e])}return e},dJ=function(e,t,n){var i=fx(n),a;if(n.output==="mathml")return dx(e,t,i,n.displayMode,!0);if(n.output==="html"){var s=v3(e,i);a=Ne.makeSpan(["katex"],[s])}else{var o=dx(e,t,i,n.displayMode,!1),l=v3(e,i);a=Ne.makeSpan(["katex"],[o,l])}return gx(a,n)},fJ=function(e,t,n){var i=fx(n),a=v3(e,i),s=Ne.makeSpan(["katex"],[a]);return gx(s,n)},gJ={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},pJ=function(e){var t=new st.MathNode("mo",[new st.TextNode(gJ[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},mJ={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},bJ=function(e){return e.type==="ordgroup"?e.body.length:1},vJ=function(e,t){function n(){var o=4e5,l=e.label.slice(1);if(ar.contains(["widehat","widecheck","widetilde","utilde"],l)){var c=e,u=bJ(c.base),h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var m=new ol(d),y=new po([m],{width:"100%",height:xt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:Ne.makeSvgSpan([],[y],t),minWidth:0,height:f}}else{var v=[],x=mJ[l],[S,A,C]=x,k=C/1e3,I=S.length,R,U;if(I===1){var D=x[3];R=["hide-tail"],U=[D]}else if(I===2)R=["halfarrow-left","halfarrow-right"],U=["xMinYMin","xMaxYMin"];else if(I===3)R=["brace-left","brace-center","brace-right"],U=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
`+I+" children.");for(var $=0;$<I;$++){var H=new ol(S[$]),V=new po([H],{width:"400em",height:xt(k),viewBox:"0 0 "+o+" "+C,preserveAspectRatio:U[$]+" slice"}),z=Ne.makeSvgSpan([R[$]],[V],t);if(I===1)return{span:z,minWidth:A,height:k};z.style.height=xt(k),v.push(z)}return{span:Ne.makeSpan(["stretchy"],v,t),minWidth:A,height:k}}}var{span:i,minWidth:a,height:s}=n();return i.height=s,i.style.height=xt(s),a>0&&(i.style.minWidth=xt(a)),i},yJ=function(e,t,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(s=Ne.makeSpan(["stretchy",t],[],a),t==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new u3({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&c.push(new u3({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new po(c,{width:"100%",height:xt(o)});s=Ne.makeSvgSpan([],[u],a)}return s.height=o,s.style.height=xt(o),s},yo={encloseSpan:yJ,mathMLnode:pJ,svgSpan:vJ};function Or(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function S3(r){var e=d1(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function d1(r){return r&&(r.type==="atom"||GY.hasOwnProperty(r.type))?r:null}var k3=(r,e)=>{var t,n,i;r&&r.type==="supsub"?(n=Or(r.base,"accent"),t=n.base,r.base=t,i=HY(an(r,e)),r.base=n):(n=Or(r,"accent"),t=n.base);var a=an(t,e.havingCrampedStyle()),s=n.isShifty&&ar.isCharacterBox(t),o=0;if(s){var l=ar.getBaseElem(t),c=an(l,e.havingCrampedStyle());o=Jw(c).skew}var u=n.label==="\\c",h=u?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),d;if(n.isStretchy)d=yo.svgSpan(n,e),d=Ne.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:d,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+xt(2*o)+")",marginLeft:xt(2*o)}:void 0}]},e);else{var f,p;n.label==="\\vec"?(f=Ne.staticSvg("vec",e),p=Ne.svgData.vec[1]):(f=Ne.makeOrd({mode:n.mode,text:n.label},e,"textord"),f=Jw(f),f.italic=0,p=f.width,u&&(h+=f.depth)),d=Ne.makeSpan(["accent-body"],[f]);var m=n.label==="\\textcircled";m&&(d.classes.push("accent-full"),h=a.height);var y=o;m||(y-=p/2),d.style.left=xt(y),n.label==="\\textcircled"&&(d.style.top=".2em"),d=Ne.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-h},{type:"elem",elem:d}]},e)}var v=Ne.makeSpan(["mord","accent"],[d],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},px=(r,e)=>{var t=r.isStretchy?yo.mathMLnode(r.label):new st.MathNode("mo",[Ha(r.label,r.mode)]),n=new st.MathNode("mover",[yn(r.base,e),t]);return n.setAttribute("accent","true"),n},wJ=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));Pt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=u1(e[0]),n=!wJ.test(r.funcName),i=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:i,base:t}},htmlBuilder:k3,mathmlBuilder:px}),Pt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:k3,mathmlBuilder:px}),Pt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:i}},htmlBuilder:(r,e)=>{var t=an(r.base,e),n=yo.svgSpan(r,e),i=r.label==="\\utilde"?.12:0,a=Ne.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]},e);return Ne.makeSpan(["mord","accentunder"],[a],e)},mathmlBuilder:(r,e)=>{var t=yo.mathMLnode(r.label),n=new st.MathNode("munder",[yn(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var f1=r=>{var e=new st.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Pt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n,funcName:i}=r;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,n=e.havingStyle(t.sup()),i=Ne.wrapFragment(an(r.body,n,e),e),a=r.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;r.below&&(n=e.havingStyle(t.sub()),s=Ne.wrapFragment(an(r.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=yo.svgSpan(r,e),l=-e.fontMetrics().axisHeight+.5*o.height,c=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||r.label==="\\xleftequilibrium")&&(c-=i.depth);var u;if(s){var h=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;u=Ne.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:o,shift:l},{type:"elem",elem:s,shift:h}]},e)}else u=Ne.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:o,shift:l}]},e);return u.children[0].children[0].children[1].classes.push("svg-align"),Ne.makeSpan(["mrel","x-arrow"],[u],e)},mathmlBuilder(r,e){var t=yo.mathMLnode(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(r.body){var i=f1(yn(r.body,e));if(r.below){var a=f1(yn(r.below,e));n=new st.MathNode("munderover",[t,a,i])}else n=new st.MathNode("mover",[t,i])}else if(r.below){var s=f1(yn(r.below,e));n=new st.MathNode("munder",[t,s])}else n=f1(),n=new st.MathNode("mover",[t,n]);return n}});var xJ=Ne.makeSpan;function mx(r,e){var t=ti(r.body,e,!0);return xJ([r.mclass],t,e)}function bx(r,e){var t,n=na(r.body,e);return r.mclass==="minner"?t=new st.MathNode("mpadded",n):r.mclass==="mord"?r.isCharacterBox?(t=n[0],t.type="mi"):t=new st.MathNode("mi",n):(r.isCharacterBox?(t=n[0],t.type="mo"):t=new st.MathNode("mo",n),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}Pt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+n.slice(5),body:Hn(i),isCharacterBox:ar.isCharacterBox(i)}},htmlBuilder:mx,mathmlBuilder:bx});var g1=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Pt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:g1(e[0]),body:Hn(e[1]),isCharacterBox:ar.isCharacterBox(e[1])}}}),Pt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:n}=r,i=e[1],a=e[0],s;n!=="\\stackrel"?s=g1(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Hn(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:t.mode,mclass:s,body:[l],isCharacterBox:ar.isCharacterBox(l)}},htmlBuilder:mx,mathmlBuilder:bx}),Pt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:g1(e[0]),body:Hn(e[0])}},htmlBuilder(r,e){var t=ti(r.body,e,!0),n=Ne.makeSpan([r.mclass],t,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(r,e){var t=na(r.body,e),n=new st.MathNode("mstyle",t);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var SJ={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},vx=()=>({type:"styling",body:[],mode:"math",style:"display"}),yx=r=>r.type==="textord"&&r.text==="@",kJ=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function AJ(r,e,t){var n=SJ[r];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=t.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=t.callFunction("\\Big",[a],[]),o=t.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function _J(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new ut("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var n=[],i=[n],a=0;a<e.length;a++){for(var s=e[a],o=vx(),l=0;l<s.length;l++)if(!yx(s[l]))o.body.push(s[l]);else{n.push(o),l+=1;var c=S3(s[l]).text,u=new Array(2);if(u[0]={type:"ordgroup",mode:"math",body:[]},u[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(c)>-1))if("<>AV".indexOf(c)>-1)for(var h=0;h<2;h++){for(var d=!0,f=l+1;f<s.length;f++){if(kJ(s[f],c)){d=!1,l=f;break}if(yx(s[f]))throw new ut("Missing a "+c+" character to complete a CD arrow.",s[f]);u[h].body.push(s[f])}if(d)throw new ut("Missing a "+c+" character to complete a CD arrow.",s[l])}else throw new ut('Expected one of "<>AV=|." after @',s[l]);var p=AJ(c,u,r),m={type:"styling",body:[p],mode:"math",style:"display"};n.push(m),o=vx()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}r.gullet.endGroup(),r.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Pt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"cdlabel",mode:t.mode,side:n.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),n=Ne.wrapFragment(an(r.label,t,e),e);return n.classes.push("cd-label-"+r.side),n.style.bottom=xt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(r,e){var t=new st.MathNode("mrow",[yn(r.label,e)]);return t=new st.MathNode("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new st.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}}),Pt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=Ne.wrapFragment(an(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new st.MathNode("mrow",[yn(r.fragment,e)])}}),Pt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,n=Or(e[0],"ordgroup"),i=n.body,a="",s=0;s<i.length;s++){var o=Or(i[s],"textord");a+=o.text}var l=parseInt(a),c;if(isNaN(l))throw new ut("\\@char has non-numeric argument "+a);if(l<0||l>=1114111)throw new ut("\\@char with invalid code point "+a);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:c}}});var wx=(r,e)=>{var t=ti(r.body,e.withColor(r.color),!1);return Ne.makeFragment(t)},xx=(r,e)=>{var t=na(r.body,e.withColor(r.color)),n=new st.MathNode("mstyle",t);return n.setAttribute("mathcolor",r.color),n};Pt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,n=Or(e[0],"color-token").color,i=e[1];return{type:"color",mode:t.mode,color:n,body:Hn(i)}},htmlBuilder:wx,mathmlBuilder:xx}),Pt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:n}=r,i=Or(e[0],"color-token").color;t.gullet.macros.set("\\current@color",i);var a=t.parseExpression(!0,n);return{type:"color",mode:t.mode,color:i,body:a}},htmlBuilder:wx,mathmlBuilder:xx}),Pt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:n}=r,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Or(i,"size").value}},htmlBuilder(r,e){var t=Ne.makeSpan(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=xt(On(r.size,e)))),t},mathmlBuilder(r,e){var t=new st.MathNode("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",xt(On(r.size,e)))),t}});var A3={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Sx=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new ut("Expected a control sequence",r);return e},CJ=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},kx=(r,e,t,n)=>{var i=r.gullet.macros.get(t.text);i==null&&(t.noexpand=!0,i={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,i,n)};Pt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var n=e.fetch();if(A3[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=A3[n.text]),Or(e.parseFunction(),"internal");throw new ut("Invalid token after macro prefix",n)}}),Pt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new ut("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new ut('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new ut('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new ut("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(t==="\\edef"||t==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},t===A3[t]),{type:"internal",mode:e.mode}}}),Pt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=Sx(e.gullet.popToken());e.gullet.consumeSpaces();var i=CJ(e);return kx(e,n,i,t==="\\\\globallet"),{type:"internal",mode:e.mode}}}),Pt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=Sx(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return kx(e,n,a,t==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var gd=function(e,t,n){var i=wn.math[e]&&wn.math[e].replace,a=s3(i||e,t,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return a},_3=function(e,t,n,i){var a=n.havingBaseStyle(t),s=Ne.makeSpan(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},Ax=function(e,t,n){var i=t.havingBaseStyle(n),a=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=xt(a),e.height-=a,e.depth+=a},EJ=function(e,t,n,i,a,s){var o=Ne.makeSymbol(e,"Main-Regular",a,i),l=_3(o,t,i,s);return n&&Ax(l,i,t),l},TJ=function(e,t,n,i){return Ne.makeSymbol(e,"Size"+t+"-Regular",n,i)},_x=function(e,t,n,i,a,s){var o=TJ(e,t,a,i),l=_3(Ne.makeSpan(["delimsizing","size"+t],[o],i),lr.TEXT,i,s);return n&&Ax(l,i,lr.TEXT),l},C3=function(e,t,n){var i;t==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Ne.makeSpan(["delimsizinginner",i],[Ne.makeSpan([],[Ne.makeSymbol(e,t,n)])]);return{type:"elem",elem:a}},E3=function(e,t,n){var i=Ts["Size4-Regular"][e.charCodeAt(0)]?Ts["Size4-Regular"][e.charCodeAt(0)][4]:Ts["Size1-Regular"][e.charCodeAt(0)][4],a=new ol("inner",RY(e,Math.round(1e3*t))),s=new po([a],{width:xt(i),height:xt(t),style:"width:"+xt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=Ne.makeSvgSpan([],[s],n);return o.height=t,o.style.height=xt(t),o.style.width=xt(i),{type:"elem",elem:o}},T3=.008,p1={type:"kern",size:-1*T3},IJ=["|","\\lvert","\\rvert","\\vert"],MJ=["\\|","\\lVert","\\rVert","\\Vert"],Cx=function(e,t,n,i,a,s){var o,l,c,u,h="",d=0;o=c=u=e,l=null;var f="Size1-Regular";e==="\\uparrow"?c=u="⏐":e==="\\Uparrow"?c=u="‖":e==="\\downarrow"?o=c="⏐":e==="\\Downarrow"?o=c="‖":e==="\\updownarrow"?(o="\\uparrow",c="⏐",u="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",c="‖",u="\\Downarrow"):ar.contains(IJ,e)?(c="",h="vert",d=333):ar.contains(MJ,e)?(c="∥",h="doublevert",d=556):e==="["||e==="\\lbrack"?(o="⎡",c="⎢",u="⎣",f="Size4-Regular",h="lbrack",d=667):e==="]"||e==="\\rbrack"?(o="⎤",c="⎥",u="⎦",f="Size4-Regular",h="rbrack",d=667):e==="\\lfloor"||e==="⌊"?(c=o="⎢",u="⎣",f="Size4-Regular",h="lfloor",d=667):e==="\\lceil"||e==="⌈"?(o="⎡",c=u="⎢",f="Size4-Regular",h="lceil",d=667):e==="\\rfloor"||e==="⌋"?(c=o="⎥",u="⎦",f="Size4-Regular",h="rfloor",d=667):e==="\\rceil"||e==="⌉"?(o="⎤",c=u="⎥",f="Size4-Regular",h="rceil",d=667):e==="("||e==="\\lparen"?(o="⎛",c="⎜",u="⎝",f="Size4-Regular",h="lparen",d=875):e===")"||e==="\\rparen"?(o="⎞",c="⎟",u="⎠",f="Size4-Regular",h="rparen",d=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",u="⎩",c="⎪",f="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",u="⎭",c="⎪",f="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",u="⎩",c="⎪",f="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",u="⎭",c="⎪",f="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",u="⎭",c="⎪",f="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",u="⎩",c="⎪",f="Size4-Regular");var p=gd(o,f,a),m=p.height+p.depth,y=gd(c,f,a),v=y.height+y.depth,x=gd(u,f,a),S=x.height+x.depth,A=0,C=1;if(l!==null){var k=gd(l,f,a);A=k.height+k.depth,C=2}var I=m+S+A,R=Math.max(0,Math.ceil((t-I)/(C*v))),U=I+R*C*v,D=i.fontMetrics().axisHeight;n&&(D*=i.sizeMultiplier);var $=U/2-D,H=[];if(h.length>0){var V=U-m-S,z=Math.round(U*1e3),Z=PY(h,Math.round(V*1e3)),q=new ol(h,Z),re=(d/1e3).toFixed(3)+"em",X=(z/1e3).toFixed(3)+"em",ie=new po([q],{width:re,height:X,viewBox:"0 0 "+d+" "+z}),P=Ne.makeSvgSpan([],[ie],i);P.height=z/1e3,P.style.width=re,P.style.height=X,H.push({type:"elem",elem:P})}else{if(H.push(C3(u,f,a)),H.push(p1),l===null){var be=U-m-S+2*T3;H.push(E3(c,be,i))}else{var _e=(U-m-S-A)/2+2*T3;H.push(E3(c,_e,i)),H.push(p1),H.push(C3(l,f,a)),H.push(p1),H.push(E3(c,_e,i))}H.push(p1),H.push(C3(o,f,a))}var W=i.havingBaseStyle(lr.TEXT),me=Ne.makeVList({positionType:"bottom",positionData:$,children:H},W);return _3(Ne.makeSpan(["delimsizing","mult"],[me],W),lr.TEXT,i,s)},I3=80,M3=.08,O3=function(e,t,n,i,a){var s=NY(e,i,n),o=new ol(e,s),l=new po([o],{width:"400em",height:xt(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Ne.makeSvgSpan(["hide-tail"],[l],a)},OJ=function(e,t){var n=t.havingBaseSizing(),i=Mx("\\surd",e*n.sizeMultiplier,Ix,n),a=n.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l=0,c=0,u=0,h;return i.type==="small"?(u=1e3+1e3*s+I3,e<1?a=1:e<1.4&&(a=.7),l=(1+s+M3)/a,c=(1+s)/a,o=O3("sqrtMain",l,u,s,t),o.style.minWidth="0.853em",h=.833/a):i.type==="large"?(u=(1e3+I3)*pd[i.size],c=(pd[i.size]+s)/a,l=(pd[i.size]+s+M3)/a,o=O3("sqrtSize"+i.size,l,u,s,t),o.style.minWidth="1.02em",h=1/a):(l=e+s+M3,c=e+s,u=Math.floor(1e3*e+s)+I3,o=O3("sqrtTall",l,u,s,t),o.style.minWidth="0.742em",h=1.056),o.height=c,o.style.height=xt(l),{span:o,advanceWidth:h,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*a}},Ex=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],NJ=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Tx=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],pd=[0,1.2,1.8,2.4,3],RJ=function(e,t,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),ar.contains(Ex,e)||ar.contains(Tx,e))return _x(e,t,!1,n,i,a);if(ar.contains(NJ,e))return Cx(e,pd[t],!1,n,i,a);throw new ut("Illegal delimiter: '"+e+"'")},PJ=[{type:"small",style:lr.SCRIPTSCRIPT},{type:"small",style:lr.SCRIPT},{type:"small",style:lr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],FJ=[{type:"small",style:lr.SCRIPTSCRIPT},{type:"small",style:lr.SCRIPT},{type:"small",style:lr.TEXT},{type:"stack"}],Ix=[{type:"small",style:lr.SCRIPTSCRIPT},{type:"small",style:lr.SCRIPT},{type:"small",style:lr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],DJ=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Mx=function(e,t,n,i){for(var a=Math.min(2,3-i.style.size),s=a;s<n.length&&n[s].type!=="stack";s++){var o=gd(e,DJ(n[s]),"math"),l=o.height+o.depth;if(n[s].type==="small"){var c=i.havingBaseStyle(n[s].style);l*=c.sizeMultiplier}if(l>t)return n[s]}return n[n.length-1]},Ox=function(e,t,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;ar.contains(Tx,e)?o=PJ:ar.contains(Ex,e)?o=Ix:o=FJ;var l=Mx(e,t,o,i);return l.type==="small"?EJ(e,l.style,n,i,a,s):l.type==="large"?_x(e,l.size,n,i,a,s):Cx(e,t,n,i,a,s)},LJ=function(e,t,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,c=5/i.fontMetrics().ptPerEm,u=Math.max(t-o,n+o),h=Math.max(u/500*l,2*u-c);return Ox(e,h,!0,i,a,s)},wo={sqrtImage:OJ,sizedDelim:RJ,sizeToMaxHeight:pd,customSizedDelim:Ox,leftRightDelim:LJ},Nx={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},BJ=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function m1(r,e){var t=d1(r);if(t&&ar.contains(BJ,t.text))return t;throw t?new ut("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new ut("Invalid delimiter type '"+r.type+"'",r)}Pt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=m1(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:Nx[r.funcName].size,mclass:Nx[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?Ne.makeSpan([r.mclass]):wo.sizedDelim(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(Ha(r.delim,r.mode));var t=new st.MathNode("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var n=xt(wo.sizeToMaxHeight[r.size]);return t.setAttribute("minsize",n),t.setAttribute("maxsize",n),t}});function Rx(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Pt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new ut("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:m1(e[0],r).text,color:t}}}),Pt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=m1(e[0],r),n=r.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Or(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:t.text,right:a.delim,rightColor:a.color}},htmlBuilder:(r,e)=>{Rx(r);for(var t=ti(r.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s<t.length;s++)t[s].isMiddle?a=!0:(n=Math.max(t[s].height,n),i=Math.max(t[s].depth,i));n*=e.sizeMultiplier,i*=e.sizeMultiplier;var o;if(r.left==="."?o=fd(e,["mopen"]):o=wo.leftRightDelim(r.left,n,i,e,r.mode,["mopen"]),t.unshift(o),a)for(var l=1;l<t.length;l++){var c=t[l],u=c.isMiddle;u&&(t[l]=wo.leftRightDelim(u.delim,n,i,u.options,r.mode,[]))}var h;if(r.right===".")h=fd(e,["mclose"]);else{var d=r.rightColor?e.withColor(r.rightColor):e;h=wo.leftRightDelim(r.right,n,i,d,r.mode,["mclose"])}return t.push(h),Ne.makeSpan(["minner"],t,e)},mathmlBuilder:(r,e)=>{Rx(r);var t=na(r.body,e);if(r.left!=="."){var n=new st.MathNode("mo",[Ha(r.left,r.mode)]);n.setAttribute("fence","true"),t.unshift(n)}if(r.right!=="."){var i=new st.MathNode("mo",[Ha(r.right,r.mode)]);i.setAttribute("fence","true"),r.rightColor&&i.setAttribute("mathcolor",r.rightColor),t.push(i)}return y3(t)}}),Pt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=m1(e[0],r);if(!r.parser.leftrightDepth)throw new ut("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=fd(e,[]);else{t=wo.sizedDelim(r.delim,1,e,r.mode,[]);var n={delim:r.delim,options:e};t.isMiddle=n}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?Ha("|","text"):Ha(r.delim,r.mode),n=new st.MathNode("mo",[t]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var N3=(r,e)=>{var t=Ne.wrapFragment(an(r.body,e),e),n=r.label.slice(1),i=e.sizeMultiplier,a,s=0,o=ar.isCharacterBox(r.body);if(n==="sout")a=Ne.makeSpan(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=On({number:.6,unit:"pt"},e),c=On({number:.35,unit:"ex"},e),u=e.havingBaseSizing();i=i/u.sizeMultiplier;var h=t.height+t.depth+l+c;t.style.paddingLeft=xt(h/2+l);var d=Math.floor(1e3*h*i),f=MY(d),p=new po([new ol("phase",f)],{width:"400em",height:xt(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});a=Ne.makeSvgSpan(["hide-tail"],[p],e),a.style.height=xt(h),s=t.depth+l+c}else{/cancel/.test(n)?o||t.classes.push("cancel-pad"):n==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var m=0,y=0,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-t.depth)):(m=o?.2:0,y=m),a=yo.encloseSpan(t,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=xt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=xt(v),a.style.borderRightWidth=xt(v)),s=t.depth+y,r.backgroundColor&&(a.style.backgroundColor=r.backgroundColor,r.borderColor&&(a.style.borderColor=r.borderColor))}var x;if(r.backgroundColor)x=Ne.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:t,shift:0}]},e);else{var S=/cancel|phase/.test(n)?["svg-align"]:[];x=Ne.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:S}]},e)}return/cancel/.test(n)&&(x.height=t.height,x.depth=t.depth),/cancel/.test(n)&&!o?Ne.makeSpan(["mord","cancel-lap"],[x],e):Ne.makeSpan(["mord"],[x],e)},R3=(r,e)=>{var t=0,n=new st.MathNode(r.label.indexOf("colorbox")>-1?"mpadded":"menclose",[yn(r.body,e)]);switch(r.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*t+"pt"),n.setAttribute("height","+"+2*t+"pt"),n.setAttribute("lspace",t+"pt"),n.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(r.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&n.setAttribute("mathbackground",r.backgroundColor),n};Pt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,a=Or(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:N3,mathmlBuilder:R3}),Pt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,a=Or(e[0],"color-token").color,s=Or(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:N3,mathmlBuilder:R3}),Pt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}}),Pt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}},htmlBuilder:N3,mathmlBuilder:R3}),Pt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var Px={};function Ms(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=r,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<t.length;++l)Px[t[l]]=o;a&&(l1[e]=a),s&&(c1[e]=s)}var Fx={};function Y(r,e){Fx[r]=e}function Dx(r){var e=[];r.consumeSpaces();var t=r.fetch().text;for(t==="\\relax"&&(r.consume(),r.consumeSpaces(),t=r.fetch().text);t==="\\hline"||t==="\\hdashline";)r.consume(),e.push(t==="\\hdashline"),r.consumeSpaces(),t=r.fetch().text;return e}var b1=r=>{var e=r.parser.settings;if(!e.displayMode)throw new ut("{"+r.envName+"} can be used only in display mode.")};function P3(r){if(r.indexOf("ed")===-1)return r.indexOf("*")===-1}function ul(r,e,t){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:h,leqno:d}=e;if(r.gullet.beginGroup(),c||r.gullet.macros.set("\\cr","\\\\\\relax"),!s){var f=r.gullet.expandMacroAsText("\\arraystretch");if(f==null)s=1;else if(s=parseFloat(f),!s||s<0)throw new ut("Invalid \\arraystretch: "+f)}r.gullet.beginGroup();var p=[],m=[p],y=[],v=[],x=l!=null?[]:void 0;function S(){l&&r.gullet.macros.set("\\@eqnsw","1",!0)}function A(){x&&(r.gullet.macros.get("\\df@tag")?(x.push(r.subparse([new Ua("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(S(),v.push(Dx(r));;){var C=r.parseExpression(!1,c?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup(),C={type:"ordgroup",mode:r.mode,body:C},t&&(C={type:"styling",mode:r.mode,style:t,body:[C]}),p.push(C);var k=r.fetch().text;if(k==="&"){if(h&&p.length===h){if(c||o)throw new ut("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(k==="\\end"){A(),p.length===1&&C.type==="styling"&&C.body[0].body.length===0&&(m.length>1||!u)&&m.pop(),v.length<m.length+1&&v.push([]);break}else if(k==="\\\\"){r.consume();var I=void 0;r.gullet.future().text!==" "&&(I=r.parseSizeGroup(!0)),y.push(I?I.value:null),A(),v.push(Dx(r)),p=[],m.push(p),S()}else throw new ut("Expected & or \\\\ or \\cr or \\end",r.nextToken)}return r.gullet.endGroup(),r.gullet.endGroup(),{type:"array",mode:r.mode,addJot:i,arraystretch:s,body:m,cols:a,rowGaps:y,hskipBeforeAndAfter:n,hLinesBeforeRow:v,colSeparationType:o,tags:x,leqno:d}}function F3(r){return r.slice(0,1)==="d"?"display":"text"}var Os=function(e,t){var n,i,a=e.body.length,s=e.hLinesBeforeRow,o=0,l=new Array(a),c=[],u=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),h=1/t.fontMetrics().ptPerEm,d=5*h;if(e.colSeparationType&&e.colSeparationType==="small"){var f=t.havingStyle(lr.SCRIPT).sizeMultiplier;d=.2778*(f/t.sizeMultiplier)}var p=e.colSeparationType==="CD"?On({number:3,unit:"ex"},t):12*h,m=3*h,y=e.arraystretch*p,v=.7*y,x=.3*y,S=0;function A(lt){for(var ct=0;ct<lt.length;++ct)ct>0&&(S+=.25),c.push({pos:S,isDashed:lt[ct]})}for(A(s[0]),n=0;n<e.body.length;++n){var C=e.body[n],k=v,I=x;o<C.length&&(o=C.length);var R=new Array(C.length);for(i=0;i<C.length;++i){var U=an(C[i],t);I<U.depth&&(I=U.depth),k<U.height&&(k=U.height),R[i]=U}var D=e.rowGaps[n],$=0;D&&($=On(D,t),$>0&&($+=x,I<$&&(I=$),$=0)),e.addJot&&(I+=m),R.height=k,R.depth=I,S+=k,R.pos=S,S+=I+$,l[n]=R,A(s[n+1])}var H=S/2+t.fontMetrics().axisHeight,V=e.cols||[],z=[],Z,q,re=[];if(e.tags&&e.tags.some(lt=>lt))for(n=0;n<a;++n){var X=l[n],ie=X.pos-H,P=e.tags[n],be=void 0;P===!0?be=Ne.makeSpan(["eqn-num"],[],t):P===!1?be=Ne.makeSpan([],[],t):be=Ne.makeSpan([],ti(P,t,!0),t),be.depth=X.depth,be.height=X.height,re.push({type:"elem",elem:be,shift:ie})}for(i=0,q=0;i<o||q<V.length;++i,++q){for(var _e=V[q]||{},W=!0;_e.type==="separator";){if(W||(Z=Ne.makeSpan(["arraycolsep"],[]),Z.style.width=xt(t.fontMetrics().doubleRuleSep),z.push(Z)),_e.separator==="|"||_e.separator===":"){var me=_e.separator==="|"?"solid":"dashed",He=Ne.makeSpan(["vertical-separator"],[],t);He.style.height=xt(S),He.style.borderRightWidth=xt(u),He.style.borderRightStyle=me,He.style.margin="0 "+xt(-u/2);var Xe=S-H;Xe&&(He.style.verticalAlign=xt(-Xe)),z.push(He)}else throw new ut("Invalid separator type: "+_e.separator);q++,_e=V[q]||{},W=!1}if(!(i>=o)){var Le=void 0;(i>0||e.hskipBeforeAndAfter)&&(Le=ar.deflt(_e.pregap,d),Le!==0&&(Z=Ne.makeSpan(["arraycolsep"],[]),Z.style.width=xt(Le),z.push(Z)));var bt=[];for(n=0;n<a;++n){var Ie=l[n],Ve=Ie[i];if(Ve){var We=Ie.pos-H;Ve.depth=Ie.depth,Ve.height=Ie.height,bt.push({type:"elem",elem:Ve,shift:We})}}bt=Ne.makeVList({positionType:"individualShift",children:bt},t),bt=Ne.makeSpan(["col-align-"+(_e.align||"c")],[bt]),z.push(bt),(i<o-1||e.hskipBeforeAndAfter)&&(Le=ar.deflt(_e.postgap,d),Le!==0&&(Z=Ne.makeSpan(["arraycolsep"],[]),Z.style.width=xt(Le),z.push(Z)))}}if(l=Ne.makeSpan(["mtable"],z),c.length>0){for(var Qe=Ne.makeLineSpan("hline",t,u),mt=Ne.makeLineSpan("hdashline",t,u),Ke=[{type:"elem",elem:l,shift:0}];c.length>0;){var ze=c.pop(),Ge=ze.pos-H;ze.isDashed?Ke.push({type:"elem",elem:mt,shift:Ge}):Ke.push({type:"elem",elem:Qe,shift:Ge})}l=Ne.makeVList({positionType:"individualShift",children:Ke},t)}if(re.length===0)return Ne.makeSpan(["mord"],[l],t);var ot=Ne.makeVList({positionType:"individualShift",children:re},t);return ot=Ne.makeSpan(["tag"],[ot],t),Ne.makeFragment([l,ot])},UJ={c:"center ",l:"left ",r:"right "},Ns=function(e,t){for(var n=[],i=new st.MathNode("mtd",[],["mtr-glue"]),a=new st.MathNode("mtd",[],["mml-eqn-num"]),s=0;s<e.body.length;s++){for(var o=e.body[s],l=[],c=0;c<o.length;c++)l.push(new st.MathNode("mtd",[yn(o[c],t)]));e.tags&&e.tags[s]&&(l.unshift(i),l.push(i),e.leqno?l.unshift(a):l.push(a)),n.push(new st.MathNode("mtr",l))}var u=new st.MathNode("mtable",n),h=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);u.setAttribute("rowspacing",xt(h));var d="",f="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",y=!1,v=0,x=p.length;p[0].type==="separator"&&(d+="top ",v=1),p[p.length-1].type==="separator"&&(d+="bottom ",x-=1);for(var S=v;S<x;S++)p[S].type==="align"?(f+=UJ[p[S].align],y&&(m+="none "),y=!0):p[S].type==="separator"&&y&&(m+=p[S].separator==="|"?"solid ":"dashed ",y=!1);u.setAttribute("columnalign",f.trim()),/[sd]/.test(m)&&u.setAttribute("columnlines",m.trim())}if(e.colSeparationType==="align"){for(var A=e.cols||[],C="",k=1;k<A.length;k++)C+=k%2?"0em ":"1em ";u.setAttribute("columnspacing",C.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?u.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?u.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?u.setAttribute("columnspacing","0.5em"):u.setAttribute("columnspacing","1em");var I="",R=e.hLinesBeforeRow;d+=R[0].length>0?"left ":"",d+=R[R.length-1].length>0?"right ":"";for(var U=1;U<R.length-1;U++)I+=R[U].length===0?"none ":R[U][0]?"dashed ":"solid ";return/[sd]/.test(I)&&u.setAttribute("rowlines",I.trim()),d!==""&&(u=new st.MathNode("menclose",[u]),u.setAttribute("notation",d.trim())),e.arraystretch&&e.arraystretch<1&&(u=new st.MathNode("mstyle",[u]),u.setAttribute("scriptlevel","1")),u},Lx=function(e,t){e.envName.indexOf("ed")===-1&&b1(e);var n=[],i=e.envName.indexOf("at")>-1?"alignat":"align",a=e.envName==="split",s=ul(e.parser,{cols:n,addJot:!0,autoTag:a?void 0:P3(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),o,l=0,c={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var u="",h=0;h<t[0].body.length;h++){var d=Or(t[0].body[h],"textord");u+=d.text}o=Number(u),l=o*2}var f=!l;s.body.forEach(function(v){for(var x=1;x<v.length;x+=2){var S=Or(v[x],"styling"),A=Or(S.body[0],"ordgroup");A.body.unshift(c)}if(f)l<v.length&&(l=v.length);else{var C=v.length/2;if(o<C)throw new ut("Too many math in a row: "+("expected "+o+", but got "+C),v[0])}});for(var p=0;p<l;++p){var m="r",y=0;p%2===1?m="l":p>0&&f&&(y=1),n[p]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=f?"align":"alignat",s};Ms({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=d1(e[0]),n=t?[e[0]]:Or(e[0],"ordgroup").body,i=n.map(function(s){var o=S3(s),l=o.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new ut("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return ul(r.parser,a,F3(r.envName))},htmlBuilder:Os,mathmlBuilder:Ns}),Ms({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var i=r.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),t=i.fetch().text,"lcr".indexOf(t)===-1)throw new ut("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:t}]}}var a=ul(r.parser,n,F3(r.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:Os,mathmlBuilder:Ns}),Ms({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=ul(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:Os,mathmlBuilder:Ns}),Ms({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=d1(e[0]),n=t?[e[0]]:Or(e[0],"ordgroup").body,i=n.map(function(s){var o=S3(s),l=o.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new ut("Unknown column alignment: "+l,s)});if(i.length>1)throw new ut("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(a=ul(r.parser,a,"script"),a.body.length>0&&a.body[0].length>1)throw new ut("{subarray} can contain only one column");return a},htmlBuilder:Os,mathmlBuilder:Ns}),Ms({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=ul(r.parser,e,F3(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.indexOf("r")>-1?".":"\\{",right:r.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Os,mathmlBuilder:Ns}),Ms({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Lx,htmlBuilder:Os,mathmlBuilder:Ns}),Ms({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){ar.contains(["gather","gather*"],r.envName)&&b1(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:P3(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return ul(r.parser,e,"display")},htmlBuilder:Os,mathmlBuilder:Ns}),Ms({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Lx,htmlBuilder:Os,mathmlBuilder:Ns}),Ms({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){b1(r);var e={autoTag:P3(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return ul(r.parser,e,"display")},htmlBuilder:Os,mathmlBuilder:Ns}),Ms({type:"array",names:["CD"],props:{numArgs:0},handler(r){return b1(r),_J(r.parser)},htmlBuilder:Os,mathmlBuilder:Ns}),Y("\\nonumber","\\gdef\\@eqnsw{0}"),Y("\\notag","\\nonumber"),Pt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new ut(r.funcName+" valid only within array environment")}});var Bx=Px;Pt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];if(i.type!=="ordgroup")throw new ut("Invalid environment name",i);for(var a="",s=0;s<i.body.length;++s)a+=Or(i.body[s],"textord").text;if(n==="\\begin"){if(!Bx.hasOwnProperty(a))throw new ut("No such environment: "+a,i);var o=Bx[a],{args:l,optArgs:c}=t.parseArguments("\\begin{"+a+"}",o),u={mode:t.mode,envName:a,parser:t},h=o.handler(u,l,c);t.expect("\\end",!1);var d=t.nextToken,f=Or(t.parseFunction(),"environment");if(f.name!==a)throw new ut("Mismatch: \\begin{"+a+"} matched by \\end{"+f.name+"}",d);return h}return{type:"environment",mode:t.mode,name:a,nameGroup:i}}});var Ux=(r,e)=>{var t=r.font,n=e.withFont(t);return an(r.body,n)},zx=(r,e)=>{var t=r.font,n=e.withFont(t);return yn(r.body,n)},jx={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Pt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=u1(e[0]),a=n;return a in jx&&(a=jx[a]),{type:"font",mode:t.mode,font:a.slice(1),body:i}},htmlBuilder:Ux,mathmlBuilder:zx}),Pt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,n=e[0],i=ar.isCharacterBox(n);return{type:"mclass",mode:t.mode,mclass:g1(n),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}}),Pt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,breakOnTokenText:i}=r,{mode:a}=t,s=t.parseExpression(!0,i),o="math"+n.slice(1);return{type:"font",mode:a,font:o,body:{type:"ordgroup",mode:t.mode,body:s}}},htmlBuilder:Ux,mathmlBuilder:zx});var Hx=(r,e)=>{var t=e;return r==="display"?t=t.id>=lr.SCRIPT.id?t.text():lr.DISPLAY:r==="text"&&t.size===lr.DISPLAY.size?t=lr.TEXT:r==="script"?t=lr.SCRIPT:r==="scriptscript"&&(t=lr.SCRIPTSCRIPT),t},D3=(r,e)=>{var t=Hx(r.size,e.style),n=t.fracNum(),i=t.fracDen(),a;a=e.havingStyle(n);var s=an(r.numer,a,e);if(r.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height<o?o:s.height,s.depth=s.depth<l?l:s.depth}a=e.havingStyle(i);var c=an(r.denom,a,e),u,h,d;r.hasBarLine?(r.barSize?(h=On(r.barSize,e),u=Ne.makeLineSpan("frac-line",e,h)):u=Ne.makeLineSpan("frac-line",e),h=u.height,d=u.height):(u=null,h=0,d=e.fontMetrics().defaultRuleThickness);var f,p,m;t.size===lr.DISPLAY.size||r.size==="display"?(f=e.fontMetrics().num1,h>0?p=3*d:p=7*d,m=e.fontMetrics().denom1):(h>0?(f=e.fontMetrics().num2,p=d):(f=e.fontMetrics().num3,p=3*d),m=e.fontMetrics().denom2);var y;if(u){var x=e.fontMetrics().axisHeight;f-s.depth-(x+.5*h)<p&&(f+=p-(f-s.depth-(x+.5*h))),x-.5*h-(c.height-m)<p&&(m+=p-(x-.5*h-(c.height-m)));var S=-(x-.5*h);y=Ne.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:m},{type:"elem",elem:u,shift:S},{type:"elem",elem:s,shift:-f}]},e)}else{var v=f-s.depth-(c.height-m);v<p&&(f+=.5*(p-v),m+=.5*(p-v)),y=Ne.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:m},{type:"elem",elem:s,shift:-f}]},e)}a=e.havingStyle(t),y.height*=a.sizeMultiplier/e.sizeMultiplier,y.depth*=a.sizeMultiplier/e.sizeMultiplier;var A;t.size===lr.DISPLAY.size?A=e.fontMetrics().delim1:t.size===lr.SCRIPTSCRIPT.size?A=e.havingStyle(lr.SCRIPT).fontMetrics().delim2:A=e.fontMetrics().delim2;var C,k;return r.leftDelim==null?C=fd(e,["mopen"]):C=wo.customSizedDelim(r.leftDelim,A,!0,e.havingStyle(t),r.mode,["mopen"]),r.continued?k=Ne.makeSpan([]):r.rightDelim==null?k=fd(e,["mclose"]):k=wo.customSizedDelim(r.rightDelim,A,!0,e.havingStyle(t),r.mode,["mclose"]),Ne.makeSpan(["mord"].concat(a.sizingClasses(e)),[C,Ne.makeSpan(["mfrac"],[y]),k],e)},L3=(r,e)=>{var t=new st.MathNode("mfrac",[yn(r.numer,e),yn(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var n=On(r.barSize,e);t.setAttribute("linethickness",xt(n))}var i=Hx(r.size,e.style);if(i.size!==e.style.size){t=new st.MathNode("mstyle",[t]);var a=i.size===lr.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",a),t.setAttribute("scriptlevel","0")}if(r.leftDelim!=null||r.rightDelim!=null){var s=[];if(r.leftDelim!=null){var o=new st.MathNode("mo",[new st.TextNode(r.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(t),r.rightDelim!=null){var l=new st.MathNode("mo",[new st.TextNode(r.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return y3(s)}return t};Pt({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],a=e[1],s,o=null,l=null,c="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:i,denom:a,hasBarLine:s,leftDelim:o,rightDelim:l,size:c,barSize:null}},htmlBuilder:D3,mathmlBuilder:L3}),Pt({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],a=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),Pt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:n}=r,i;switch(t){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var qx=["display","text","script","scriptscript"],Gx=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};Pt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,n=e[4],i=e[5],a=u1(e[0]),s=a.type==="atom"&&a.family==="open"?Gx(a.text):null,o=u1(e[1]),l=o.type==="atom"&&o.family==="close"?Gx(o.text):null,c=Or(e[2],"size"),u,h=null;c.isBlank?u=!0:(h=c.value,u=h.number>0);var d="auto",f=e[3];if(f.type==="ordgroup"){if(f.body.length>0){var p=Or(f.body[0],"textord");d=qx[Number(p.text)]}}else f=Or(f,"textord"),d=qx[Number(f.text)];return{type:"genfrac",mode:t.mode,numer:n,denom:i,continued:!1,hasBarLine:u,barSize:h,leftDelim:s,rightDelim:l,size:d}},htmlBuilder:D3,mathmlBuilder:L3}),Pt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:n,token:i}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:Or(e[0],"size").value,token:i}}}),Pt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],a=pY(Or(e[1],"infix").size),s=e[2],o=a.number>0;return{type:"genfrac",mode:t.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:D3,mathmlBuilder:L3});var Wx=(r,e)=>{var t=e.style,n,i;r.type==="supsub"?(n=r.sup?an(r.sup,e.havingStyle(t.sup()),e):an(r.sub,e.havingStyle(t.sub()),e),i=Or(r.base,"horizBrace")):i=Or(r,"horizBrace");var a=an(i.base,e.havingBaseStyle(lr.DISPLAY)),s=yo.svgSpan(i,e),o;if(i.isOver?(o=Ne.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),o.children[0].children[0].children[1].classes.push("svg-align")):(o=Ne.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),o.children[0].children[0].children[0].classes.push("svg-align")),n){var l=Ne.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e);i.isOver?o=Ne.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):o=Ne.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return Ne.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e)},zJ=(r,e)=>{var t=yo.mathMLnode(r.label);return new st.MathNode(r.isOver?"mover":"munder",[yn(r.base,e),t])};Pt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"horizBrace",mode:t.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:Wx,mathmlBuilder:zJ}),Pt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[1],i=Or(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:t.mode,href:i,body:Hn(n)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=ti(r.body,e,!1);return Ne.makeAnchor(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=cl(r.body,e);return t instanceof wa||(t=new wa("mrow",[t])),t.setAttribute("href",r.href),t}}),Pt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=Or(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:n}))return t.formatUnsupportedCmd("\\url");for(var i=[],a=0;a<n.length;a++){var s=n[a];s==="~"&&(s="\\textasciitilde"),i.push({type:"textord",mode:"text",text:s})}var o={type:"text",mode:t.mode,font:"\\texttt",body:i};return{type:"href",mode:t.mode,href:n,body:Hn(o)}}}),Pt({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(r,e){var{parser:t}=r;return{type:"hbox",mode:t.mode,body:Hn(e[0])}},htmlBuilder(r,e){var t=ti(r.body,e,!1);return Ne.makeFragment(t)},mathmlBuilder(r,e){return new st.MathNode("mrow",na(r.body,e))}}),Pt({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,token:i}=r,a=Or(e[0],"raw").string,s=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var c=a.split(","),u=0;u<c.length;u++){var h=c[u].split("=");if(h.length!==2)throw new ut("Error parsing key-value for \\htmlData");l["data-"+h[0].trim()]=h[1].trim()}o={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return t.settings.isTrusted(o)?{type:"html",mode:t.mode,attributes:l,body:Hn(s)}:t.formatUnsupportedCmd(n)},htmlBuilder:(r,e)=>{var t=ti(r.body,e,!1),n=["enclosing"];r.attributes.class&&n.push(...r.attributes.class.trim().split(/\s+/));var i=Ne.makeSpan(n,t,e);for(var a in r.attributes)a!=="class"&&r.attributes.hasOwnProperty(a)&&i.setAttribute(a,r.attributes[a]);return i},mathmlBuilder:(r,e)=>cl(r.body,e)}),Pt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:Hn(e[0]),mathml:Hn(e[1])}},htmlBuilder:(r,e)=>{var t=ti(r.html,e,!1);return Ne.makeFragment(t)},mathmlBuilder:(r,e)=>cl(r.mathml,e)});var B3=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new ut("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Xw(n))throw new ut("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Pt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:n}=r,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(t[0])for(var l=Or(t[0],"raw").string,c=l.split(","),u=0;u<c.length;u++){var h=c[u].split("=");if(h.length===2){var d=h[1].trim();switch(h[0].trim()){case"alt":o=d;break;case"width":i=B3(d);break;case"height":a=B3(d);break;case"totalheight":s=B3(d);break;default:throw new ut("Invalid key: '"+h[0]+"' in \\includegraphics.")}}}var f=Or(e[0],"url").url;return o===""&&(o=f,o=o.replace(/^.*[\\/]/,""),o=o.substring(0,o.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:f})?{type:"includegraphics",mode:n.mode,alt:o,width:i,height:a,totalheight:s,src:f}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(r,e)=>{var t=On(r.height,e),n=0;r.totalheight.number>0&&(n=On(r.totalheight,e)-t);var i=0;r.width.number>0&&(i=On(r.width,e));var a={height:xt(t+n)};i>0&&(a.width=xt(i)),n>0&&(a.verticalAlign=xt(-n));var s=new zY(r.src,r.alt,a);return s.height=t,s.depth=n,s},mathmlBuilder:(r,e)=>{var t=new st.MathNode("mglyph",[]);t.setAttribute("alt",r.alt);var n=On(r.height,e),i=0;if(r.totalheight.number>0&&(i=On(r.totalheight,e)-n,t.setAttribute("valign",xt(-i))),t.setAttribute("height",xt(n+i)),r.width.number>0){var a=On(r.width,e);t.setAttribute("width",xt(a))}return t.setAttribute("src",r.src),t}}),Pt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=Or(e[0],"size");if(t.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:i.value}},htmlBuilder(r,e){return Ne.makeGlue(r.dimension,e)},mathmlBuilder(r,e){var t=On(r.dimension,e);return new st.SpaceNode(t)}}),Pt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"lap",mode:t.mode,alignment:n.slice(5),body:i}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=Ne.makeSpan([],[an(r.body,e)]),t=Ne.makeSpan(["inner"],[t],e)):t=Ne.makeSpan(["inner"],[an(r.body,e)]);var n=Ne.makeSpan(["fix"],[]),i=Ne.makeSpan([r.alignment],[t,n],e),a=Ne.makeSpan(["strut"]);return a.style.height=xt(i.height+i.depth),i.depth&&(a.style.verticalAlign=xt(-i.depth)),i.children.unshift(a),i=Ne.makeSpan(["thinbox"],[i],e),Ne.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(r,e)=>{var t=new st.MathNode("mpadded",[yn(r.body,e)]);if(r.alignment!=="rlap"){var n=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",n+"width")}return t.setAttribute("width","0px"),t}}),Pt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:n}=r,i=n.mode;n.switchMode("math");var a=t==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:s}}}),Pt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new ut("Mismatched "+r.funcName)}});var Vx=(r,e)=>{switch(e.style.size){case lr.DISPLAY.size:return r.display;case lr.TEXT.size:return r.text;case lr.SCRIPT.size:return r.script;case lr.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};Pt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:Hn(e[0]),text:Hn(e[1]),script:Hn(e[2]),scriptscript:Hn(e[3])}},htmlBuilder:(r,e)=>{var t=Vx(r,e),n=ti(t,e,!1);return Ne.makeFragment(n)},mathmlBuilder:(r,e)=>{var t=Vx(r,e);return cl(t,e)}});var Xx=(r,e,t,n,i,a,s)=>{r=Ne.makeSpan([],[r]);var o=t&&ar.isCharacterBox(t),l,c;if(e){var u=an(e,n.havingStyle(i.sup()),n);c={elem:u,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-u.depth)}}if(t){var h=an(t,n.havingStyle(i.sub()),n);l={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-h.height)}}var d;if(c&&l){var f=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+r.depth+s;d=Ne.makeVList({positionType:"bottom",positionData:f,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:xt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:xt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var p=r.height-s;d=Ne.makeVList({positionType:"top",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:xt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:r}]},n)}else if(c){var m=r.depth+s;d=Ne.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:xt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return r;var y=[d];if(l&&a!==0&&!o){var v=Ne.makeSpan(["mspace"],[],n);v.style.marginRight=xt(a),y.unshift(v)}return Ne.makeSpan(["mop","op-limits"],y,n)},$x=["\\smallint"],Au=(r,e)=>{var t,n,i=!1,a;r.type==="supsub"?(t=r.sup,n=r.sub,a=Or(r.base,"op"),i=!0):a=Or(r,"op");var s=e.style,o=!1;s.size===lr.DISPLAY.size&&a.symbol&&!ar.contains($x,a.name)&&(o=!0);var l;if(a.symbol){var c=o?"Size2-Regular":"Size1-Regular",u="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(u=a.name.slice(1),a.name=u==="oiint"?"\\iint":"\\iiint"),l=Ne.makeSymbol(a.name,c,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u.length>0){var h=l.italic,d=Ne.staticSvg(u+"Size"+(o?"2":"1"),e);l=Ne.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:d,shift:o?.08:0}]},e),a.name="\\"+u,l.classes.unshift("mop"),l.italic=h}}else if(a.body){var f=ti(a.body,e,!0);f.length===1&&f[0]instanceof ja?(l=f[0],l.classes[0]="mop"):l=Ne.makeSpan(["mop"],f,e)}else{for(var p=[],m=1;m<a.name.length;m++)p.push(Ne.mathsym(a.name[m],a.mode,e));l=Ne.makeSpan(["mop"],p,e)}var y=0,v=0;return(l instanceof ja||a.name==="\\oiint"||a.name==="\\oiiint")&&!a.suppressBaseShift&&(y=(l.height-l.depth)/2-e.fontMetrics().axisHeight,v=l.italic),i?Xx(l,t,n,e,s,v,y):(y&&(l.style.position="relative",l.style.top=xt(y)),l)},md=(r,e)=>{var t;if(r.symbol)t=new wa("mo",[Ha(r.name,r.mode)]),ar.contains($x,r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new wa("mo",na(r.body,e));else{t=new wa("mi",[new Is(r.name.slice(1))]);var n=new wa("mo",[Ha("","text")]);r.parentIsSupSub?t=new wa("mrow",[t,n]):t=hx([t,n])}return t},jJ={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","":"\\bigvee","⋂":"\\bigcap","":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Pt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","","⋂","","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=n;return i.length===1&&(i=jJ[i]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Au,mathmlBuilder:md}),Pt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Hn(n)}},htmlBuilder:Au,mathmlBuilder:md});var HJ={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Pt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Au,mathmlBuilder:md}),Pt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Au,mathmlBuilder:md}),Pt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r,n=t;return n.length===1&&(n=HJ[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Au,mathmlBuilder:md});var Kx=(r,e)=>{var t,n,i=!1,a;r.type==="supsub"?(t=r.sup,n=r.sub,a=Or(r.base,"operatorname"),i=!0):a=Or(r,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(h=>{var d=h.text;return typeof d=="string"?{type:"textord",mode:h.mode,text:d}:h}),l=ti(o,e.withFont("mathrm"),!0),c=0;c<l.length;c++){var u=l[c];u instanceof ja&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=Ne.makeSpan(["mop"],l,e)}else s=Ne.makeSpan(["mop"],[],e);return i?Xx(s,t,n,e,e.style,0,0):s},qJ=(r,e)=>{for(var t=na(r.body,e.withFont("mathrm")),n=!0,i=0;i<t.length;i++){var a=t[i];if(!(a instanceof st.SpaceNode))if(a instanceof st.MathNode)switch(a.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var s=a.children[0];a.children.length===1&&s instanceof st.TextNode?s.text=s.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){var o=t.map(u=>u.toText()).join("");t=[new st.TextNode(o)]}var l=new st.MathNode("mi",t);l.setAttribute("mathvariant","normal");var c=new st.MathNode("mo",[Ha("","text")]);return r.parentIsSupSub?new st.MathNode("mrow",[l,c]):st.newDocumentFragment([l,c])};Pt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"operatorname",mode:t.mode,body:Hn(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Kx,mathmlBuilder:qJ}),Y("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),cc({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?Ne.makeFragment(ti(r.body,e,!1)):Ne.makeSpan(["mord"],ti(r.body,e,!0),e)},mathmlBuilder(r,e){return cl(r.body,e,!0)}}),Pt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,n=e[0];return{type:"overline",mode:t.mode,body:n}},htmlBuilder(r,e){var t=an(r.body,e.havingCrampedStyle()),n=Ne.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Ne.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return Ne.makeSpan(["mord","overline"],[a],e)},mathmlBuilder(r,e){var t=new st.MathNode("mo",[new st.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new st.MathNode("mover",[yn(r.body,e),t]);return n.setAttribute("accent","true"),n}}),Pt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"phantom",mode:t.mode,body:Hn(n)}},htmlBuilder:(r,e)=>{var t=ti(r.body,e.withPhantom(),!1);return Ne.makeFragment(t)},mathmlBuilder:(r,e)=>{var t=na(r.body,e);return new st.MathNode("mphantom",t)}}),Pt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"hphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=Ne.makeSpan([],[an(r.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var n=0;n<t.children.length;n++)t.children[n].height=0,t.children[n].depth=0;return t=Ne.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e),Ne.makeSpan(["mord"],[t],e)},mathmlBuilder:(r,e)=>{var t=na(Hn(r.body),e),n=new st.MathNode("mphantom",t),i=new st.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),Pt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"vphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=Ne.makeSpan(["inner"],[an(r.body,e.withPhantom())]),n=Ne.makeSpan(["fix"],[]);return Ne.makeSpan(["mord","rlap"],[t,n],e)},mathmlBuilder:(r,e)=>{var t=na(Hn(r.body),e),n=new st.MathNode("mphantom",t),i=new st.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}}),Pt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,n=Or(e[0],"size").value,i=e[1];return{type:"raisebox",mode:t.mode,dy:n,body:i}},htmlBuilder(r,e){var t=an(r.body,e),n=On(r.dy,e);return Ne.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){var t=new st.MathNode("mpadded",[yn(r.body,e)]),n=r.dy.number+r.dy.unit;return t.setAttribute("voffset",n),t}}),Pt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}}),Pt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(r,e,t){var{parser:n}=r,i=t[0],a=Or(e[0],"size"),s=Or(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Or(i,"size").value,width:a.value,height:s.value}},htmlBuilder(r,e){var t=Ne.makeSpan(["mord","rule"],[],e),n=On(r.width,e),i=On(r.height,e),a=r.shift?On(r.shift,e):0;return t.style.borderRightWidth=xt(n),t.style.borderTopWidth=xt(i),t.style.bottom=xt(a),t.width=n,t.height=i+a,t.depth=-a,t.maxFontSize=i*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=On(r.width,e),n=On(r.height,e),i=r.shift?On(r.shift,e):0,a=e.color&&e.getColor()||"black",s=new st.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",xt(t)),s.setAttribute("height",xt(n));var o=new st.MathNode("mpadded",[s]);return i>=0?o.setAttribute("height",xt(i)):(o.setAttribute("height",xt(i)),o.setAttribute("depth",xt(-i))),o.setAttribute("voffset",xt(i)),o}});function Yx(r,e,t){for(var n=ti(r,e,!1),i=e.sizeMultiplier/t.sizeMultiplier,a=0;a<n.length;a++){var s=n[a].classes.indexOf("sizing");s<0?Array.prototype.push.apply(n[a].classes,e.sizingClasses(t)):n[a].classes[s+1]==="reset-size"+e.size&&(n[a].classes[s+1]="reset-size"+t.size),n[a].height*=i,n[a].depth*=i}return Ne.makeFragment(n)}var Jx=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],GJ=(r,e)=>{var t=e.havingSize(r.size);return Yx(r.body,t,e)};Pt({type:"sizing",names:Jx,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:n,parser:i}=r,a=i.parseExpression(!1,t);return{type:"sizing",mode:i.mode,size:Jx.indexOf(n)+1,body:a}},htmlBuilder:GJ,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),n=na(r.body,t),i=new st.MathNode("mstyle",n);return i.setAttribute("mathsize",xt(t.sizeMultiplier)),i}}),Pt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:n}=r,i=!1,a=!1,s=t[0]&&Or(t[0],"ordgroup");if(s)for(var o="",l=0;l<s.body.length;++l){var c=s.body[l];if(o=c.text,o==="t")i=!0;else if(o==="b")a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=e[0];return{type:"smash",mode:n.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(r,e)=>{var t=Ne.makeSpan([],[an(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0,t.children))for(var n=0;n<t.children.length;n++)t.children[n].height=0;if(r.smashDepth&&(t.depth=0,t.children))for(var i=0;i<t.children.length;i++)t.children[i].depth=0;var a=Ne.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e);return Ne.makeSpan(["mord"],[a],e)},mathmlBuilder:(r,e)=>{var t=new st.MathNode("mpadded",[yn(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}}),Pt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n}=r,i=t[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(r,e){var t=an(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=Ne.wrapFragment(t,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.id<lr.TEXT.id&&(a=e.fontMetrics().xHeight);var s=i+a/4,o=t.height+t.depth+s+i,{span:l,ruleWidth:c,advanceWidth:u}=wo.sqrtImage(o,e),h=l.height-c;h>t.height+t.depth+s&&(s=(s+h-t.height-t.depth)/2);var d=l.height-t.height-s-c;t.style.paddingLeft=xt(u);var f=Ne.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+d)},{type:"elem",elem:l},{type:"kern",size:c}]},e);if(r.index){var p=e.havingStyle(lr.SCRIPTSCRIPT),m=an(r.index,p,e),y=.6*(f.height-f.depth),v=Ne.makeVList({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]},e),x=Ne.makeSpan(["root"],[v]);return Ne.makeSpan(["mord","sqrt"],[x,f],e)}else return Ne.makeSpan(["mord","sqrt"],[f],e)},mathmlBuilder(r,e){var{body:t,index:n}=r;return n?new st.MathNode("mroot",[yn(t,e),yn(n,e)]):new st.MathNode("msqrt",[yn(t,e)])}});var Qx={display:lr.DISPLAY,text:lr.TEXT,script:lr.SCRIPT,scriptscript:lr.SCRIPTSCRIPT};Pt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:n,parser:i}=r,a=i.parseExpression(!0,t),s=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(r,e){var t=Qx[r.style],n=e.havingStyle(t).withFont("");return Yx(r.body,n,e)},mathmlBuilder(r,e){var t=Qx[r.style],n=e.havingStyle(t),i=na(r.body,n),a=new st.MathNode("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[r.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var WJ=function(e,t){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(t.style.size===lr.DISPLAY.size||n.alwaysHandleSupSub);return i?Au:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(t.style.size===lr.DISPLAY.size||n.limits);return a?Kx:null}else{if(n.type==="accent")return ar.isCharacterBox(n.base)?k3:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?Wx:null}else return null}else return null};cc({type:"supsub",htmlBuilder(r,e){var t=WJ(r,e);if(t)return t(r,e);var{base:n,sup:i,sub:a}=r,s=an(n,e),o,l,c=e.fontMetrics(),u=0,h=0,d=n&&ar.isCharacterBox(n);if(i){var f=e.havingStyle(e.style.sup());o=an(i,f,e),d||(u=s.height-f.fontMetrics().supDrop*f.sizeMultiplier/e.sizeMultiplier)}if(a){var p=e.havingStyle(e.style.sub());l=an(a,p,e),d||(h=s.depth+p.fontMetrics().subDrop*p.sizeMultiplier/e.sizeMultiplier)}var m;e.style===lr.DISPLAY?m=c.sup1:e.style.cramped?m=c.sup3:m=c.sup2;var y=e.sizeMultiplier,v=xt(.5/c.ptPerEm/y),x=null;if(l){var S=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(s instanceof ja||S)&&(x=xt(-s.italic))}var A;if(o&&l){u=Math.max(u,m,o.depth+.25*c.xHeight),h=Math.max(h,c.sub2);var C=c.defaultRuleThickness,k=4*C;if(u-o.depth-(l.height-h)<k){h=k-(u-o.depth)+l.height;var I=.8*c.xHeight-(u-o.depth);I>0&&(u+=I,h-=I)}var R=[{type:"elem",elem:l,shift:h,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-u,marginRight:v}];A=Ne.makeVList({positionType:"individualShift",children:R},e)}else if(l){h=Math.max(h,c.sub1,l.height-.8*c.xHeight);var U=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];A=Ne.makeVList({positionType:"shift",positionData:h,children:U},e)}else if(o)u=Math.max(u,m,o.depth+.25*c.xHeight),A=Ne.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:o,marginRight:v}]},e);else throw new Error("supsub must have either sup or sub.");var D=b3(s,"right")||"mord";return Ne.makeSpan([D],[s,Ne.makeSpan(["msupsub"],[A])],e)},mathmlBuilder(r,e){var t=!1,n,i;r.base&&r.base.type==="horizBrace"&&(i=!!r.sup,i===r.base.isOver&&(t=!0,n=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var a=[yn(r.base,e)];r.sub&&a.push(yn(r.sub,e)),r.sup&&a.push(yn(r.sup,e));var s;if(t)s=n?"mover":"munder";else if(r.sub)if(r.sup){var c=r.base;c&&c.type==="op"&&c.limits&&e.style===lr.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(e.style===lr.DISPLAY||c.limits)?s="munderover":s="msubsup"}else{var l=r.base;l&&l.type==="op"&&l.limits&&(e.style===lr.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===lr.DISPLAY)?s="munder":s="msub"}else{var o=r.base;o&&o.type==="op"&&o.limits&&(e.style===lr.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===lr.DISPLAY)?s="mover":s="msup"}return new st.MathNode(s,a)}}),cc({type:"atom",htmlBuilder(r,e){return Ne.mathsym(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new st.MathNode("mo",[Ha(r.text,r.mode)]);if(r.family==="bin"){var n=w3(r,e);n==="bold-italic"&&t.setAttribute("mathvariant",n)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var Zx={mi:"italic",mn:"normal",mtext:"normal"};cc({type:"mathord",htmlBuilder(r,e){return Ne.makeOrd(r,e,"mathord")},mathmlBuilder(r,e){var t=new st.MathNode("mi",[Ha(r.text,r.mode,e)]),n=w3(r,e)||"italic";return n!==Zx[t.type]&&t.setAttribute("mathvariant",n),t}}),cc({type:"textord",htmlBuilder(r,e){return Ne.makeOrd(r,e,"textord")},mathmlBuilder(r,e){var t=Ha(r.text,r.mode,e),n=w3(r,e)||"normal",i;return r.mode==="text"?i=new st.MathNode("mtext",[t]):/[0-9]/.test(r.text)?i=new st.MathNode("mn",[t]):r.text==="\\prime"?i=new st.MathNode("mo",[t]):i=new st.MathNode("mi",[t]),n!==Zx[i.type]&&i.setAttribute("mathvariant",n),i}});var U3={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},z3={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};cc({type:"spacing",htmlBuilder(r,e){if(z3.hasOwnProperty(r.text)){var t=z3[r.text].className||"";if(r.mode==="text"){var n=Ne.makeOrd(r,e,"textord");return n.classes.push(t),n}else return Ne.makeSpan(["mspace",t],[Ne.mathsym(r.text,r.mode,e)],e)}else{if(U3.hasOwnProperty(r.text))return Ne.makeSpan(["mspace",U3[r.text]],[],e);throw new ut('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(z3.hasOwnProperty(r.text))t=new st.MathNode("mtext",[new st.TextNode(" ")]);else{if(U3.hasOwnProperty(r.text))return new st.MathNode("mspace");throw new ut('Unknown type of space "'+r.text+'"')}return t}});var eS=()=>{var r=new st.MathNode("mtd",[]);return r.setAttribute("width","50%"),r};cc({type:"tag",mathmlBuilder(r,e){var t=new st.MathNode("mtable",[new st.MathNode("mtr",[eS(),new st.MathNode("mtd",[cl(r.body,e)]),eS(),new st.MathNode("mtd",[cl(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var tS={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},rS={"\\textbf":"textbf","\\textmd":"textmd"},VJ={"\\textit":"textit","\\textup":"textup"},nS=(r,e)=>{var t=r.font;if(t){if(tS[t])return e.withTextFontFamily(tS[t]);if(rS[t])return e.withTextFontWeight(rS[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(VJ[t])};Pt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"text",mode:t.mode,body:Hn(i),font:n}},htmlBuilder(r,e){var t=nS(r,e),n=ti(r.body,t,!0);return Ne.makeSpan(["mord","text"],n,t)},mathmlBuilder(r,e){var t=nS(r,e);return cl(r.body,t)}}),Pt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=an(r.body,e),n=Ne.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Ne.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:t}]},e);return Ne.makeSpan(["mord","underline"],[a],e)},mathmlBuilder(r,e){var t=new st.MathNode("mo",[new st.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new st.MathNode("munder",[yn(r.body,e),t]);return n.setAttribute("accentunder","true"),n}}),Pt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=an(r.body,e),n=e.fontMetrics().axisHeight,i=.5*(t.height-n-(t.depth+n));return Ne.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){return new st.MathNode("mpadded",[yn(r.body,e)],["vcenter"])}}),Pt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new ut("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=iS(r),n=[],i=e.havingStyle(e.style.text()),a=0;a<t.length;a++){var s=t[a];s==="~"&&(s="\\textasciitilde"),n.push(Ne.makeSymbol(s,"Typewriter-Regular",r.mode,i,["mord","texttt"]))}return Ne.makeSpan(["mord","text"].concat(i.sizingClasses(e)),Ne.tryCombineChars(n),i)},mathmlBuilder(r,e){var t=new st.TextNode(iS(r)),n=new st.MathNode("mtext",[t]);return n.setAttribute("mathvariant","monospace"),n}});var iS=r=>r.body.replace(/ /g,r.star?"␣":" "),hl=lx,aS=`[ \r
]`,XJ="\\\\[a-zA-Z@]+",$J="\\\\[^\uD800-\uDFFF]",KJ="("+XJ+")"+aS+"*",YJ=`\\\\(
|[ \r ]+
?)[ \r ]*`,j3="[̀-ͯ]",JJ=new RegExp(j3+"+$"),QJ="("+aS+"+)|"+(YJ+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(j3+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(j3+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+KJ)+("|"+$J+")");class sS{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(QJ,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Ua("EOF",new va(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new ut("Unexpected character: '"+e[t]+"'",new Ua(e[t],new va(this,t,t+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(`
`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Ua(i,new va(this,t,this.tokenRegex.lastIndex))}}class ZJ{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new ut("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var eQ=Fx;Y("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),Y("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}}),Y("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}}),Y("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}}),Y("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),Y("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Y("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var oS={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Y("\\char",function(r){var e=r.popToken(),t,n="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new ut("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=oS[e.text],n==null||n>=t)throw new ut("Invalid base-"+t+" digit "+e.text);for(var i;(i=oS[r.future().text])!=null&&i<t;)n*=t,n+=i,r.popToken()}return"\\@char{"+n+"}"});var H3=(r,e,t,n)=>{var i=r.consumeArg().tokens;if(i.length!==1)throw new ut("\\newcommand's first argument must be a macro name");var a=i[0].text,s=r.isDefined(a);if(s&&!e)throw new ut("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!t)throw new ut("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=r.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=r.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new ut("Invalid number of arguments: "+l);o=parseInt(l),i=r.consumeArg().tokens}return s&&n||r.macros.set(a,{tokens:i,numArgs:o}),""};Y("\\newcommand",r=>H3(r,!1,!0,!1)),Y("\\renewcommand",r=>H3(r,!0,!1,!1)),Y("\\providecommand",r=>H3(r,!0,!0,!0)),Y("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""}),Y("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""}),Y("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),hl[t],wn.math[t],wn.text[t]),""}),Y("\\bgroup","{"),Y("\\egroup","}"),Y("~","\\nobreakspace"),Y("\\lq","`"),Y("\\rq","'"),Y("\\aa","\\r a"),Y("\\AA","\\r A"),Y("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Y("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Y("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Y("","\\mathscr{B}"),Y("","\\mathscr{E}"),Y("","\\mathscr{F}"),Y("","\\mathscr{H}"),Y("","\\mathscr{I}"),Y("","\\mathscr{L}"),Y("","\\mathscr{M}"),Y("","\\mathscr{R}"),Y("","\\mathfrak{C}"),Y("","\\mathfrak{H}"),Y("","\\mathfrak{Z}"),Y("\\Bbbk","\\Bbb{k}"),Y("·","\\cdotp"),Y("\\llap","\\mathllap{\\textrm{#1}}"),Y("\\rlap","\\mathrlap{\\textrm{#1}}"),Y("\\clap","\\mathclap{\\textrm{#1}}"),Y("\\mathstrut","\\vphantom{(}"),Y("\\underbar","\\underline{\\text{#1}}"),Y("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Y("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Y("\\ne","\\neq"),Y("≠","\\neq"),Y("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Y("∉","\\notin"),Y("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Y("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Y("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Y("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Y("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Y("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Y("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Y("⟂","\\perp"),Y("‼","\\mathclose{!\\mkern-0.8mu!}"),Y("∌","\\notni"),Y("⌜","\\ulcorner"),Y("⌝","\\urcorner"),Y("⌞","\\llcorner"),Y("⌟","\\lrcorner"),Y("©","\\copyright"),Y("®","\\textregistered"),Y("","\\textregistered"),Y("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Y("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Y("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Y("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Y("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Y("⋮","\\vdots"),Y("\\varGamma","\\mathit{\\Gamma}"),Y("\\varDelta","\\mathit{\\Delta}"),Y("\\varTheta","\\mathit{\\Theta}"),Y("\\varLambda","\\mathit{\\Lambda}"),Y("\\varXi","\\mathit{\\Xi}"),Y("\\varPi","\\mathit{\\Pi}"),Y("\\varSigma","\\mathit{\\Sigma}"),Y("\\varUpsilon","\\mathit{\\Upsilon}"),Y("\\varPhi","\\mathit{\\Phi}"),Y("\\varPsi","\\mathit{\\Psi}"),Y("\\varOmega","\\mathit{\\Omega}"),Y("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Y("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Y("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Y("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Y("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Y("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Y("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Y("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var lS={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Y("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in lS?e=lS[t]:(t.slice(0,4)==="\\not"||t in wn.math&&ar.contains(["bin","rel"],wn.math[t].group))&&(e="\\dotsb"),e});var q3={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Y("\\dotso",function(r){var e=r.future().text;return e in q3?"\\ldots\\,":"\\ldots"}),Y("\\dotsc",function(r){var e=r.future().text;return e in q3&&e!==","?"\\ldots\\,":"\\ldots"}),Y("\\cdots",function(r){var e=r.future().text;return e in q3?"\\@cdots\\,":"\\@cdots"}),Y("\\dotsb","\\cdots"),Y("\\dotsm","\\cdots"),Y("\\dotsi","\\!\\cdots"),Y("\\dotsx","\\ldots\\,"),Y("\\DOTSI","\\relax"),Y("\\DOTSB","\\relax"),Y("\\DOTSX","\\relax"),Y("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Y("\\,","\\tmspace+{3mu}{.1667em}"),Y("\\thinspace","\\,"),Y("\\>","\\mskip{4mu}"),Y("\\:","\\tmspace+{4mu}{.2222em}"),Y("\\medspace","\\:"),Y("\\;","\\tmspace+{5mu}{.2777em}"),Y("\\thickspace","\\;"),Y("\\!","\\tmspace-{3mu}{.1667em}"),Y("\\negthinspace","\\!"),Y("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Y("\\negthickspace","\\tmspace-{5mu}{.277em}"),Y("\\enspace","\\kern.5em "),Y("\\enskip","\\hskip.5em\\relax"),Y("\\quad","\\hskip1em\\relax"),Y("\\qquad","\\hskip2em\\relax"),Y("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Y("\\tag@paren","\\tag@literal{({#1})}"),Y("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new ut("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Y("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Y("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Y("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Y("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Y("\\newline","\\\\\\relax"),Y("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var cS=xt(Ts["Main-Regular"][84][1]-.7*Ts["Main-Regular"][65][1]);Y("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+cS+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),Y("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+cS+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),Y("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Y("\\@hspace","\\hskip #1\\relax"),Y("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Y("\\ordinarycolon",":"),Y("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Y("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Y("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Y("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Y("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Y("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Y("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Y("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Y("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Y("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Y("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Y("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Y("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Y("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Y("∷","\\dblcolon"),Y("∹","\\eqcolon"),Y("≔","\\coloneqq"),Y("≕","\\eqqcolon"),Y("⩴","\\Coloneqq"),Y("\\ratio","\\vcentcolon"),Y("\\coloncolon","\\dblcolon"),Y("\\colonequals","\\coloneqq"),Y("\\coloncolonequals","\\Coloneqq"),Y("\\equalscolon","\\eqqcolon"),Y("\\equalscoloncolon","\\Eqqcolon"),Y("\\colonminus","\\coloneq"),Y("\\coloncolonminus","\\Coloneq"),Y("\\minuscolon","\\eqcolon"),Y("\\minuscoloncolon","\\Eqcolon"),Y("\\coloncolonapprox","\\Colonapprox"),Y("\\coloncolonsim","\\Colonsim"),Y("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Y("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Y("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Y("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Y("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Y("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Y("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Y("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Y("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Y("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Y("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Y("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Y("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Y("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Y("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Y("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Y("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Y("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Y("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Y("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Y("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Y("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Y("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Y("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Y("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Y("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Y("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Y("\\imath","\\html@mathml{\\@imath}{ı}"),Y("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Y("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Y("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Y("⟦","\\llbracket"),Y("⟧","\\rrbracket"),Y("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Y("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Y("⦃","\\lBrace"),Y("⦄","\\rBrace"),Y("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Y("⦵","\\minuso"),Y("\\darr","\\downarrow"),Y("\\dArr","\\Downarrow"),Y("\\Darr","\\Downarrow"),Y("\\lang","\\langle"),Y("\\rang","\\rangle"),Y("\\uarr","\\uparrow"),Y("\\uArr","\\Uparrow"),Y("\\Uarr","\\Uparrow"),Y("\\N","\\mathbb{N}"),Y("\\R","\\mathbb{R}"),Y("\\Z","\\mathbb{Z}"),Y("\\alef","\\aleph"),Y("\\alefsym","\\aleph"),Y("\\Alpha","\\mathrm{A}"),Y("\\Beta","\\mathrm{B}"),Y("\\bull","\\bullet"),Y("\\Chi","\\mathrm{X}"),Y("\\clubs","\\clubsuit"),Y("\\cnums","\\mathbb{C}"),Y("\\Complex","\\mathbb{C}"),Y("\\Dagger","\\ddagger"),Y("\\diamonds","\\diamondsuit"),Y("\\empty","\\emptyset"),Y("\\Epsilon","\\mathrm{E}"),Y("\\Eta","\\mathrm{H}"),Y("\\exist","\\exists"),Y("\\harr","\\leftrightarrow"),Y("\\hArr","\\Leftrightarrow"),Y("\\Harr","\\Leftrightarrow"),Y("\\hearts","\\heartsuit"),Y("\\image","\\Im"),Y("\\infin","\\infty"),Y("\\Iota","\\mathrm{I}"),Y("\\isin","\\in"),Y("\\Kappa","\\mathrm{K}"),Y("\\larr","\\leftarrow"),Y("\\lArr","\\Leftarrow"),Y("\\Larr","\\Leftarrow"),Y("\\lrarr","\\leftrightarrow"),Y("\\lrArr","\\Leftrightarrow"),Y("\\Lrarr","\\Leftrightarrow"),Y("\\Mu","\\mathrm{M}"),Y("\\natnums","\\mathbb{N}"),Y("\\Nu","\\mathrm{N}"),Y("\\Omicron","\\mathrm{O}"),Y("\\plusmn","\\pm"),Y("\\rarr","\\rightarrow"),Y("\\rArr","\\Rightarrow"),Y("\\Rarr","\\Rightarrow"),Y("\\real","\\Re"),Y("\\reals","\\mathbb{R}"),Y("\\Reals","\\mathbb{R}"),Y("\\Rho","\\mathrm{P}"),Y("\\sdot","\\cdot"),Y("\\sect","\\S"),Y("\\spades","\\spadesuit"),Y("\\sub","\\subset"),Y("\\sube","\\subseteq"),Y("\\supe","\\supseteq"),Y("\\Tau","\\mathrm{T}"),Y("\\thetasym","\\vartheta"),Y("\\weierp","\\wp"),Y("\\Zeta","\\mathrm{Z}"),Y("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Y("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Y("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Y("\\bra","\\mathinner{\\langle{#1}|}"),Y("\\ket","\\mathinner{|{#1}\\rangle}"),Y("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Y("\\Bra","\\left\\langle#1\\right|"),Y("\\Ket","\\left|#1\\right\\rangle");var uS=r=>e=>{var t=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=h=>d=>{r&&(d.macros.set("|",s),i.length&&d.macros.set("\\|",o));var f=h;if(!h&&i.length){var p=d.future();p.text==="|"&&(d.popToken(),f=!0)}return{tokens:f?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var c=e.consumeArg().tokens,u=e.expandTokens([...a,...c,...t]);return e.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};Y("\\bra@ket",uS(!1)),Y("\\bra@set",uS(!0)),Y("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Y("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Y("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Y("\\angln","{\\angl n}"),Y("\\blue","\\textcolor{##6495ed}{#1}"),Y("\\orange","\\textcolor{##ffa500}{#1}"),Y("\\pink","\\textcolor{##ff00af}{#1}"),Y("\\red","\\textcolor{##df0030}{#1}"),Y("\\green","\\textcolor{##28ae7b}{#1}"),Y("\\gray","\\textcolor{gray}{#1}"),Y("\\purple","\\textcolor{##9d38bd}{#1}"),Y("\\blueA","\\textcolor{##ccfaff}{#1}"),Y("\\blueB","\\textcolor{##80f6ff}{#1}"),Y("\\blueC","\\textcolor{##63d9ea}{#1}"),Y("\\blueD","\\textcolor{##11accd}{#1}"),Y("\\blueE","\\textcolor{##0c7f99}{#1}"),Y("\\tealA","\\textcolor{##94fff5}{#1}"),Y("\\tealB","\\textcolor{##26edd5}{#1}"),Y("\\tealC","\\textcolor{##01d1c1}{#1}"),Y("\\tealD","\\textcolor{##01a995}{#1}"),Y("\\tealE","\\textcolor{##208170}{#1}"),Y("\\greenA","\\textcolor{##b6ffb0}{#1}"),Y("\\greenB","\\textcolor{##8af281}{#1}"),Y("\\greenC","\\textcolor{##74cf70}{#1}"),Y("\\greenD","\\textcolor{##1fab54}{#1}"),Y("\\greenE","\\textcolor{##0d923f}{#1}"),Y("\\goldA","\\textcolor{##ffd0a9}{#1}"),Y("\\goldB","\\textcolor{##ffbb71}{#1}"),Y("\\goldC","\\textcolor{##ff9c39}{#1}"),Y("\\goldD","\\textcolor{##e07d10}{#1}"),Y("\\goldE","\\textcolor{##a75a05}{#1}"),Y("\\redA","\\textcolor{##fca9a9}{#1}"),Y("\\redB","\\textcolor{##ff8482}{#1}"),Y("\\redC","\\textcolor{##f9685d}{#1}"),Y("\\redD","\\textcolor{##e84d39}{#1}"),Y("\\redE","\\textcolor{##bc2612}{#1}"),Y("\\maroonA","\\textcolor{##ffbde0}{#1}"),Y("\\maroonB","\\textcolor{##ff92c6}{#1}"),Y("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Y("\\maroonD","\\textcolor{##ca337c}{#1}"),Y("\\maroonE","\\textcolor{##9e034e}{#1}"),Y("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Y("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Y("\\purpleC","\\textcolor{##aa87ff}{#1}"),Y("\\purpleD","\\textcolor{##7854ab}{#1}"),Y("\\purpleE","\\textcolor{##543b78}{#1}"),Y("\\mintA","\\textcolor{##f5f9e8}{#1}"),Y("\\mintB","\\textcolor{##edf2df}{#1}"),Y("\\mintC","\\textcolor{##e0e5cc}{#1}"),Y("\\grayA","\\textcolor{##f6f7f7}{#1}"),Y("\\grayB","\\textcolor{##f0f1f2}{#1}"),Y("\\grayC","\\textcolor{##e3e5e6}{#1}"),Y("\\grayD","\\textcolor{##d6d8da}{#1}"),Y("\\grayE","\\textcolor{##babec2}{#1}"),Y("\\grayF","\\textcolor{##888d93}{#1}"),Y("\\grayG","\\textcolor{##626569}{#1}"),Y("\\grayH","\\textcolor{##3b3e40}{#1}"),Y("\\grayI","\\textcolor{##21242c}{#1}"),Y("\\kaBlue","\\textcolor{##314453}{#1}"),Y("\\kaGreen","\\textcolor{##71B307}{#1}");var hS={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class tQ{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new ZJ(eQ,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new sS(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new Ua("EOF",n.loc)),this.pushTokens(i),t.range(n,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),t.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new ut("Extra }",a)}else if(a.text==="EOF")throw new ut("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:a}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new ut("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;i<n.length;i++){var a=this.popToken();if(n[i]!==a.text)throw new ut("Use of the macro doesn't match its definition",a)}}for(var s=[],o=0;o<e;o++)s.push(this.consumeArg(t&&t[o+1]).tokens);return s}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new ut("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,i=t.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new ut("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new ut("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new ut("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Ua(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(n=>n.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof t=="function"?t(this):t;if(typeof i=="string"){var a=0;if(i.indexOf("#")!==-1)for(var s=i.replace(/##/g,"");s.indexOf("#"+(a+1))!==-1;)++a;for(var o=new sS(i,this.settings),l=[],c=o.lex();c.text!=="EOF";)l.push(c),c=o.lex();l.reverse();var u={tokens:l,numArgs:a};return u}return i}isDefined(e){return this.macros.has(e)||hl.hasOwnProperty(e)||wn.math.hasOwnProperty(e)||wn.text.hasOwnProperty(e)||hS.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:hl.hasOwnProperty(e)&&!hl[e].primitive}}var dS=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,v1=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),G3={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},fS={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class y1{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new tQ(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new ut("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Ua("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(y1.endOfExpression.indexOf(i.text)!==-1||t&&i.text===t||e&&hl[i.text]&&hl[i.text].infix)break;var a=this.parseAtom(t);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t=-1,n,i=0;i<e.length;i++)if(e[i].type==="infix"){if(t!==-1)throw new ut("only one infix operator per group",e[i].token);t=i,n=e[i].replaceWith}if(t!==-1&&n){var a,s,o=e.slice(0,t),l=e.slice(t+1);o.length===1&&o[0].type==="ordgroup"?a=o[0]:a={type:"ordgroup",mode:this.mode,body:o},l.length===1&&l[0].type==="ordgroup"?s=l[0]:s={type:"ordgroup",mode:this.mode,body:l};var c;return n==="\\\\abovefrac"?c=this.callFunction(n,[a,e[t],s],[]):c=this.callFunction(n,[a,s],[]),[c]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var i;do{var a;i=this.parseGroup(e)}while(((a=i)==null?void 0:a.type)==="internal");if(!i)throw new ut("Expected group after '"+n+"'",t);return i}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:t},a={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return a}parseAtom(e){var t=this.parseGroup("atom",e);if(t?.type==="internal"||this.mode==="text")return t;for(var n,i;;){this.consumeSpaces();var a=this.fetch();if(a.text==="\\limits"||a.text==="\\nolimits"){if(t&&t.type==="op"){var s=a.text==="\\limits";t.limits=s,t.alwaysHandleSupSub=!0}else if(t&&t.type==="operatorname")t.alwaysHandleSupSub&&(t.limits=a.text==="\\limits");else throw new ut("Limit controls must follow a math operator",a);this.consume()}else if(a.text==="^"){if(n)throw new ut("Double superscript",a);n=this.handleSupSubscript("superscript")}else if(a.text==="_"){if(i)throw new ut("Double subscript",a);i=this.handleSupSubscript("subscript")}else if(a.text==="'"){if(n)throw new ut("Double superscript",a);var o={type:"textord",mode:this.mode,text:"\\prime"},l=[o];for(this.consume();this.fetch().text==="'";)l.push(o),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:l}}else if(v1[a.text]){var c=dS.test(a.text),u=[];for(u.push(new Ua(v1[a.text])),this.consume();;){var h=this.fetch().text;if(!v1[h]||dS.test(h)!==c)break;u.unshift(new Ua(v1[h])),this.consume()}var d=this.subparse(u);c?i={type:"ordgroup",mode:"math",body:d}:n={type:"ordgroup",mode:"math",body:d}}else break}return n||i?{type:"supsub",mode:this.mode,base:t,sup:n,sub:i}:t}parseFunction(e,t){var n=this.fetch(),i=n.text,a=hl[i];if(!a)return null;if(this.consume(),t&&t!=="atom"&&!a.allowedInArgument)throw new ut("Got function '"+i+"' with no arguments"+(t?" as "+t:""),n);if(this.mode==="text"&&!a.allowedInText)throw new ut("Can't use function '"+i+"' in text mode",n);if(this.mode==="math"&&a.allowedInMath===!1)throw new ut("Can't use function '"+i+"' in math mode",n);var{args:s,optArgs:o}=this.parseArguments(i,a);return this.callFunction(i,s,o,n,e)}callFunction(e,t,n,i,a){var s={funcName:e,parser:this,token:i,breakOnTokenText:a},o=hl[e];if(o&&o.handler)return o.handler(s,t,n);throw new ut("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var i=[],a=[],s=0;s<n;s++){var o=t.argTypes&&t.argTypes[s],l=s<t.numOptionalArgs;(t.primitive&&o==null||t.type==="sqrt"&&s===1&&a[0]==null)&&(o="primitive");var c=this.parseGroupOfType("argument to '"+e+"'",o,l);if(l)a.push(c);else if(c!=null)i.push(c);else throw new ut("Null argument, please report this as a bug")}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":{var i=this.parseArgumentGroup(n,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text"}:null}case"raw":{var a=this.parseStringGroup("raw",n);return a!=null?{type:"raw",mode:"text",string:a.text}:null}case"primitive":{if(n)throw new ut("A primitive argument cannot be optional");var s=this.parseGroup(e);if(s==null)throw new ut("Expected group as "+e,this.fetch());return s}case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new ut("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var i="",a;(a=this.fetch()).text!=="EOF";)i+=a.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,t){for(var n=this.fetch(),i=n,a="",s;(s=this.fetch()).text!=="EOF"&&e.test(a+s.text);)i=s,a+=i.text,this.consume();if(a==="")throw new ut("Invalid "+t+": '"+n.text+"'",n);return n.range(i,a)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(t==null)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new ut("Invalid color: '"+t.text+"'",t);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?t=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):t=this.parseStringGroup("size",e),!t)return null;!e&&t.text.length===0&&(t.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!i)throw new ut("Invalid size: '"+t.text+"'",t);var a={number:+(i[1]+i[2]),unit:i[3]};if(!Xw(a))throw new ut("Invalid unit: '"+a.unit+"'",t);return{type:"size",mode:this.mode,value:a,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var i=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var a=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:a};return t&&this.switchMode(i),s}parseGroup(e,t){var n=this.fetch(),i=n.text,a;if(i==="{"||i==="\\begingroup"){this.consume();var s=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,s),l=this.fetch();this.expect(s),this.gullet.endGroup(),a={type:"ordgroup",mode:this.mode,loc:va.range(n,l),body:o,semisimple:i==="\\begingroup"||void 0}}else if(a=this.parseFunction(t,e)||this.parseSymbol(),a==null&&i[0]==="\\"&&!hS.hasOwnProperty(i)){if(this.settings.throwOnError)throw new ut("Undefined control sequence: "+i,n);a=this.formatUnsupportedCmd(i),this.consume()}return a}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var i=e[n],a=i.text;a==="-"&&e[n+1].text==="-"&&(n+1<t&&e[n+2].text==="-"?(e.splice(n,3,{type:"textord",mode:"text",loc:va.range(i,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:va.range(i,e[n+1]),text:"--"}),t-=1)),(a==="'"||a==="`")&&e[n+1].text===a&&(e.splice(n,2,{type:"textord",mode:"text",loc:va.range(i,e[n+1]),text:a+a}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),i=n.charAt(0)==="*";if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new ut(`\\verb assertion failed --
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}fS.hasOwnProperty(t[0])&&!wn[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=fS[t[0]]+t.slice(1));var a=JJ.exec(t);a&&(t=t.substring(0,a.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var s;if(wn[this.mode][t]){this.settings.strict&&this.mode==="math"&&g3.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o=wn[this.mode][t].group,l=va.range(e),c;if(qY.hasOwnProperty(o)){var u=o;c={type:"atom",mode:this.mode,family:u,loc:l,text:t}}else c={type:o,mode:this.mode,loc:l,text:t};s=c}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Hw(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:va.range(e),text:t};else return null;if(this.consume(),a)for(var h=0;h<a[0].length;h++){var d=a[0][h];if(!G3[d])throw new ut("Unknown accent ' "+d+"'",e);var f=G3[d][this.mode]||G3[d].text;if(!f)throw new ut("Accent "+d+" unsupported in "+this.mode+" mode",e);s={type:"accent",mode:this.mode,loc:va.range(e),label:f,isStretchy:!1,isShifty:!0,base:s}}return s}}y1.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var W3=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new y1(e,t);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new ut("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new Ua("\\df@tag")])}]}return i},gS=function(e,t,n){t.textContent="";var i=V3(e,n).toNode();t.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),gS=function(){throw new ut("KaTeX doesn't work in quirks mode.")});var rQ=function(e,t){var n=V3(e,t).toMarkup();return n},nQ=function(e,t){var n=new n3(t);return W3(e,n)},pS=function(e,t,n){if(n.throwOnError||!(e instanceof ut))throw e;var i=Ne.makeSpan(["katex-error"],[new ja(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},V3=function(e,t){var n=new n3(t);try{var i=W3(e,n);return dJ(i,e,n)}catch(a){return pS(a,e,n)}},iQ=function(e,t){var n=new n3(t);try{var i=W3(e,n);return fJ(i,e,n)}catch(a){return pS(a,e,n)}},aQ="0.16.22",sQ={Span:dd,Anchor:c3,SymbolNode:ja,SvgNode:po,PathNode:ol,LineNode:u3},mS={version:aQ,render:gS,renderToString:rQ,ParseError:ut,SETTINGS_SCHEMA:Jf,__parse:nQ,__renderToDomTree:V3,__renderToHTMLTree:iQ,__setFontMetrics:FY,__defineSymbol:E,__defineFunction:Pt,__defineMacro:Y,__domTree:sQ};const oQ={};function lQ(r){const e=this,t=r||oQ,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),a=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(sY(t)),a.push(QK()),s.push(ZK(t))}const bS=function(r,e,t){const n=ld(t);if(!r||!r.type||!r.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=r.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<r.children.length;)if(n(r.children[e],e,r))return r.children[e]},uc=function(r){if(r==null)return hQ;if(typeof r=="string")return uQ(r);if(typeof r=="object")return cQ(r);if(typeof r=="function")return X3(r);throw new Error("Expected function, string, or array as `test`")};function cQ(r){const e=[];let t=-1;for(;++t<r.length;)e[t]=uc(r[t]);return X3(n);function n(...i){let a=-1;for(;++a<e.length;)if(e[a].apply(this,i))return!0;return!1}}function uQ(r){return X3(e);function e(t){return t.tagName===r}}function X3(r){return e;function e(t,n,i){return!!(dQ(t)&&r.call(this,t,typeof n=="number"?n:void 0,i||void 0))}}function hQ(r){return!!(r&&typeof r=="object"&&"type"in r&&r.type==="element"&&"tagName"in r&&typeof r.tagName=="string")}function dQ(r){return r!==null&&typeof r=="object"&&"type"in r&&"tagName"in r}const vS=/\n/g,yS=/[\t ]+/g,$3=uc("br"),wS=uc(yQ),fQ=uc("p"),xS=uc("tr"),gQ=uc(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",vQ,wQ]),SS=uc(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function kS(r,e){const t=e||{},n="children"in r?r.children:[],i=SS(r),a=CS(r,{whitespace:t.whitespace||"normal"}),s=[];(r.type==="text"||r.type==="comment")&&s.push(..._S(r,{breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<n.length;)s.push(...AS(n[o],r,{whitespace:a,breakBefore:o?void 0:i,breakAfter:o<n.length-1?$3(n[o+1]):i}));const l=[];let c;for(o=-1;++o<s.length;){const u=s[o];typeof u=="number"?c!==void 0&&u>c&&(c=u):u&&(c!==void 0&&c>-1&&l.push(`
`.repeat(c)||" "),c=-1,l.push(u))}return l.join("")}function AS(r,e,t){return r.type==="element"?pQ(r,e,t):r.type==="text"?t.whitespace==="normal"?_S(r,t):mQ(r):[]}function pQ(r,e,t){const n=CS(r,t),i=r.children||[];let a=-1,s=[];if(gQ(r))return s;let o,l;for($3(r)||xS(r)&&bS(e,r,xS)?l=`
`:fQ(r)?(o=2,l=2):SS(r)&&(o=1,l=1);++a<i.length;)s=s.concat(AS(i[a],r,{whitespace:n,breakBefore:a?void 0:o,breakAfter:a<i.length-1?$3(i[a+1]):l}));return wS(r)&&bS(e,r,wS)&&s.push(" "),o&&s.unshift(o),l&&s.push(l),s}function _S(r,e){const t=String(r.value),n=[],i=[];let a=0;for(;a<=t.length;){vS.lastIndex=a;const l=vS.exec(t),c=l&&"index"in l?l.index:t.length;n.push(bQ(t.slice(a,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),a===0?e.breakBefore:!0,c===t.length?e.breakAfter:!0)),a=c+1}let s=-1,o;for(;++s<n.length;)n[s].charCodeAt(n[s].length-1)===8203||s<n.length-1&&n[s+1].charCodeAt(0)===8203?(i.push(n[s]),o=void 0):n[s]?(typeof o=="number"&&i.push(o),i.push(n[s]),o=0):(s===0||s===n.length-1)&&i.push(0);return i}function mQ(r){return[String(r.value)]}function bQ(r,e,t){const n=[];let i=0,a;for(;i<r.length;){yS.lastIndex=i;const s=yS.exec(r);a=s?s.index:r.length,!i&&!a&&s&&!e&&n.push(""),i!==a&&n.push(r.slice(i,a)),i=s?a+s[0].length:a}return i!==a&&!t&&n.push(""),n.join(" ")}function CS(r,e){if(r.type==="element"){const t=r.properties||{};switch(r.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.wrap?"pre-wrap":"pre";case"td":case"th":return t.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function vQ(r){return!!(r.properties||{}).hidden}function yQ(r){return r.tagName==="td"||r.tagName==="th"}function wQ(r){return r.tagName==="dialog"&&!(r.properties||{}).open}function xQ(r){const e=r.regex,t=r.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+n+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[r.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},r.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},r.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},t,r.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:e.optional(i)+r.IDENT_RE,relevance:0},f=e.optional(i)+r.IDENT_RE+"\\s*\\(",p=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],v=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:m,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},C={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,r.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},k=[C,h,o,t,r.C_BLOCK_COMMENT_MODE,u,c],I={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:k.concat([{begin:/\(/,end:/\)/,keywords:A,contains:k.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+s+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:A,relevance:0},{begin:f,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[t,r.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",t,r.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,t,r.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(I,R,C,k,[h,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",o]},{begin:r.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function SQ(r){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},t=xQ(r),n=t.keywords;return n.type=[...n.type,...e.type],n.literal=[...n.literal,...e.literal],n.built_in=[...n.built_in,...e.built_in],n._hints=e._hints,t.name="Arduino",t.aliases=["ino"],t.supersetOf="cpp",t}function kQ(r){const e=r.regex,t={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[r.BACKSLASH_ESCAPE]},a=r.inherit(r.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[r.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[r.BACKSLASH_ESCAPE,t,i]};i.contains.push(o);const l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},h={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},r.NUMBER_MODE,t]},d=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],f=r.SHEBANG({binary:`(${d.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[r.inherit(r.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],v={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],C=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:y,built_in:[...x,...S,"set","shopt",...A,...C]},contains:[f,r.SHEBANG(),p,h,a,s,v,o,l,c,u,t]}}function AQ(r){const e=r.regex,t=r.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+n+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[r.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},r.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},r.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},t,r.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:e.optional(i)+r.IDENT_RE,relevance:0},f=e.optional(i)+r.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},v=[h,o,t,r.C_BLOCK_COMMENT_MODE,u,c],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:v.concat([{begin:/\(/,end:/\)/,keywords:y,contains:v.concat(["self"]),relevance:0}]),relevance:0},S={begin:"("+s+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:y,relevance:0},{begin:f,returnBegin:!0,contains:[r.inherit(d,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[t,r.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",t,r.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,t,r.C_BLOCK_COMMENT_MODE,h]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"</",contains:[].concat(x,S,v,[h,{begin:r.IDENT_RE+"::",keywords:y},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},r.TITLE_MODE]}]),exports:{preprocessor:h,strings:c,keywords:y}}}function _Q(r){const e=r.regex,t=r.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+n+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[r.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},r.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},r.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},t,r.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:e.optional(i)+r.IDENT_RE,relevance:0},f=e.optional(i)+r.IDENT_RE+"\\s*\\(",p=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],v=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:m,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},C={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,r.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},k=[C,h,o,t,r.C_BLOCK_COMMENT_MODE,u,c],I={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:k.concat([{begin:/\(/,end:/\)/,keywords:A,contains:k.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+s+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:A,relevance:0},{begin:f,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[t,r.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",t,r.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,t,r.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(I,R,C,k,[h,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",o]},{begin:r.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function CQ(r){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],t=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],n=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],a=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(a),built_in:e,literal:n},o=r.inherit(r.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},h=r.inherit(u,{illegal:/\n/}),d={className:"subst",begin:/\{/,end:/\}/,keywords:s},f=r.inherit(d,{illegal:/\n/}),p={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},r.BACKSLASH_ESCAPE,f]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]},y=r.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});d.contains=[m,p,u,r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,l,r.C_BLOCK_COMMENT_MODE],f.contains=[y,p,h,r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,l,r.inherit(r.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const v={variants:[c,m,p,u,r.APOS_STRING_MODE,r.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},S=r.IDENT_RE+"(<"+r.IDENT_RE+"(\\s*,\\s*"+r.IDENT_RE+")*>)?(\\[\\])?",A={begin:"@"+r.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[r.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},v,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,x,r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,x,r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+S+"\\s+)+"+r.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:r.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[r.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[v,l,r.C_BLOCK_COMMENT_MODE]},r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE]},A]}}const EQ=r=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:r.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:r.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),TQ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],IQ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],MQ=[...TQ,...IQ],OQ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),NQ=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),RQ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),PQ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function FQ(r){const e=r.regex,t=EQ(r),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",o=[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,n,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+NQ.join("|")+")"},{begin:":(:)?("+RQ.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+PQ.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:OQ.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+MQ.join("|")+")\\b"}]}}function DQ(r){const e=r.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function LQ(r){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,{className:"string",variants:[r.QUOTE_STRING_MODE,r.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[r.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}function BQ(r){const e=r.regex,t=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[r.HASH_COMMENT_MODE,r.QUOTE_STRING_MODE,r.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(t,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function UQ(r){const e=r.regex,t={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:r.NUMBER_RE}]},n=r.COMMENT();n.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[r.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},o={begin:/\[/,end:/\]/,contains:[n,a,i,s,t,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,u=/'[^']*'/,h=e.either(l,c,u),d=e.concat(h,"(\\s*\\.\\s*",h,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[n,{className:"section",begin:/\[+/,end:/\]+/},{begin:d,className:"attr",starts:{end:/$/,contains:[n,o,a,i,s,t]}}]}}var _u="[0-9](_*[0-9])*",w1=`\\.(${_u})`,x1="[0-9a-fA-F](_*[0-9a-fA-F])*",ES={className:"number",variants:[{begin:`(\\b(${_u})((${w1})|\\.)?|(${w1}))[eE][+-]?(${_u})[fFdD]?\\b`},{begin:`\\b(${_u})((${w1})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${w1})[fFdD]?\\b`},{begin:`\\b(${_u})[fFdD]\\b`},{begin:`\\b0[xX]((${x1})\\.?|(${x1})?\\.(${x1}))[pP][+-]?(${_u})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${x1})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function TS(r,e,t){return t===-1?"":r.replace(e,n=>TS(r,e,t-1))}function zQ(r){const e=r.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n=t+TS("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[r.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[r.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[r.BACKSLASH_ESCAPE]},r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[u,r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+n+"\\s+)",r.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,ES,r.C_BLOCK_COMMENT_MODE]},r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE]},ES,c]}}const IS="[A-Za-z$_][0-9A-Za-z$_]*",jQ=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],HQ=["true","false","null","undefined","NaN","Infinity"],MS=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],OS=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],NS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qQ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],GQ=[].concat(NS,MS,OS);function WQ(r){const e=r.regex,t=(X,{after:ie})=>{const P="</"+X[0].slice(1);return X.input.indexOf(P,ie)!==-1},n=IS,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(X,ie)=>{const P=X[0].length+X.index,be=X.input[P];if(be==="<"||be===","){ie.ignoreMatch();return}be===">"&&(t(X,{after:P})||ie.ignoreMatch());let _e;const W=X.input.substring(P);if(_e=W.match(/^\s*=/)){ie.ignoreMatch();return}if((_e=W.match(/^\s+extends\s+/))&&_e.index===0){ie.ignoreMatch();return}}},o={$pattern:IS,keyword:jQ,literal:HQ,built_in:GQ,"variable.language":qQ},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,d],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[r.BACKSLASH_ESCAPE,d]},x={className:"comment",variants:[r.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),r.C_BLOCK_COMMENT_MODE,r.C_LINE_COMMENT_MODE]},S=[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,f,p,m,y,{match:/\$\d+/},h];d.contains=S.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(S)});const A=[].concat(x,d.contains),C=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(A)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:C},I={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...MS,...OS]}},U={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},D={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function H(X){return e.concat("(?!",X.join("|"),")")}const V={match:e.concat(/\b/,H([...NS,"super","import"].map(X=>`${X}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},z={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+r.UNDERSCORE_IDENT_RE+")\\s*=>",re={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[r.SHEBANG({label:"shebang",binary:"node",relevance:5}),U,r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,f,p,m,y,x,{match:/\$\d+/},h,R,{scope:"attr",match:n+e.lookahead(":"),relevance:0},re,{begin:"("+r.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,r.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:r.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},D,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+r.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,r.inherit(r.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},z,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},V,$,I,Z,{match:/\$[(.]/}]}}function VQ(r){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],i={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[e,t,r.QUOTE_STRING_MODE,i,r.C_NUMBER_MODE,r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Cu="[0-9](_*[0-9])*",S1=`\\.(${Cu})`,k1="[0-9a-fA-F](_*[0-9a-fA-F])*",XQ={className:"number",variants:[{begin:`(\\b(${Cu})((${S1})|\\.)?|(${S1}))[eE][+-]?(${Cu})[fFdD]?\\b`},{begin:`\\b(${Cu})((${S1})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${S1})[fFdD]?\\b`},{begin:`\\b(${Cu})[fFdD]\\b`},{begin:`\\b0[xX]((${k1})\\.?|(${k1})?\\.(${k1}))[pP][+-]?(${Cu})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${k1})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function $Q(r){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},t={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n={className:"symbol",begin:r.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[r.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+r.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,i]},{begin:"'",end:"'",illegal:/\n/,contains:[r.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[r.BACKSLASH_ESCAPE,a,i]}]};i.contains.push(s);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+r.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+r.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[r.inherit(s,{className:"string"}),"self"]}]},c=XQ,u=r.COMMENT("/\\*","\\*/",{contains:[r.C_BLOCK_COMMENT_MODE]}),h={variants:[{className:"type",begin:r.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=h;return d.variants[1].contains=[h],h.variants[1].contains=[d],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[r.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),r.C_LINE_COMMENT_MODE,u,t,n,o,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:r.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[r.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[h,r.C_LINE_COMMENT_MODE,u],relevance:0},r.C_LINE_COMMENT_MODE,u,o,l,s,r.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,r.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},r.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
`},c]}}const KQ=r=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:r.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:r.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),YQ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],JQ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],QQ=[...YQ,...JQ],ZQ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),RS=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),PS=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),eZ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),tZ=RS.concat(PS).sort().reverse();function rZ(r){const e=KQ(r),t=tZ,n="and or not only",i="[\\w-]+",a="("+i+"|@\\{"+i+"\\})",s=[],o=[],l=function(S){return{className:"string",begin:"~?"+S+".*?"+S}},c=function(S,A,C){return{className:S,begin:A,relevance:C}},u={$pattern:/[a-z-]+/,keyword:n,attribute:ZQ.join(" ")},h={begin:"\\(",end:"\\)",contains:o,keywords:u,relevance:0};o.push(r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,h,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const d=o.concat({begin:/\{/,end:/\}/,contains:s}),f={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},p={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+eZ.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:o,relevance:0}},y={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:d}},v={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,f,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+QQ.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",a,0),c("selector-id","#"+a),c("selector-class","\\."+a,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+RS.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+PS.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},e.FUNCTION_DISPATCH]},x={begin:i+`:(:)?(${t.join("|")})`,returnBegin:!0,contains:[v]};return s.push(r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,m,y,x,p,v,f,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function nZ(r){const e="\\[=*\\[",t="\\]=*\\]",n={begin:e,end:t,contains:["self"]},i=[r.COMMENT("--(?!"+e+")","$"),r.COMMENT("--"+e,t,{contains:[n],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:r.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[r.inherit(r.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},r.C_NUMBER_MODE,r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,{className:"string",begin:e,end:t,contains:[n],relevance:5}])}}function iZ(r){const e={className:"variable",variants:[{begin:"\\$\\("+r.UNDERSCORE_IDENT_RE+"\\)",contains:[r.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},t={className:"string",begin:/"/,end:/"/,contains:[r.BACKSLASH_ESCAPE,e]},n={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,t]},i={begin:"^"+r.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},a={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[r.HASH_COMMENT_MODE,e,t,n,i,a,s]}}function aZ(r){const e=r.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},h=r.inherit(c,{contains:[]}),d=r.inherit(u,{contains:[]});c.contains.push(d),u.contains.push(h);let f=[t,l];return[c,u,h,d].forEach(v=>{v.contains=v.contains.concat(f)}),f=f.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},t,a,c,u,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},i,n,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function sZ(r){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},t=/[a-zA-Z@][a-zA-Z0-9_]*/,o={"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"</",contains:[e,r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,r.C_NUMBER_MODE,r.QUOTE_STRING_MODE,r.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[r.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},r.inherit(r.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[r.UNDERSCORE_TITLE_MODE]},{begin:"\\."+r.UNDERSCORE_IDENT_RE,relevance:0}]}}function oZ(r){const e=r.regex,t=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],n=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:t.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[r.BACKSLASH_ESCAPE,a,l],h=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],d=(m,y,v="\\1")=>{const x=v==="\\1"?v:e.concat(v,y);return e.concat(e.concat("(?:",m,")"),y,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,v,n)},f=(m,y,v)=>e.concat(e.concat("(?:",m,")"),y,/(?:\\.|[^\\\/])*?/,v,n),p=[l,r.HASH_COMMENT_MODE,r.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[r.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[r.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+r.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[r.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:d("s|tr|y",e.either(...h,{capture:!0}))},{begin:d("s|tr|y","\\(","\\)")},{begin:d("s|tr|y","\\[","\\]")},{begin:d("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:f("(?:m|qr)?",/\//,/\//)},{begin:f("m|qr",e.either(...h,{capture:!0}),/\1/)},{begin:f("m|qr",/\(/,/\)/)},{begin:f("m|qr",/\[/,/\]/)},{begin:f("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[r.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[r.TITLE_MODE,o,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=p,s.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:p}}function lZ(r){const e=r.regex,t=/(?![A-Za-z0-9])(?![$])/,n=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),a=e.concat(/[A-Z]+/,t),s={scope:"variable",match:"\\$+"+n},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=r.inherit(r.APOS_STRING_MODE,{illegal:null}),u=r.inherit(r.QUOTE_STRING_MODE,{illegal:null,contains:r.QUOTE_STRING_MODE.contains.concat(l)}),h={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:r.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(z,Z)=>{Z.data._beginMatch=z[1]||z[2]},"on:end":(z,Z)=>{Z.data._beginMatch!==z[1]&&Z.ignoreMatch()}},d=r.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[
]`,p={scope:"string",variants:[u,c,h,d]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],v=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],A={keyword:v,literal:(z=>{const Z=[];return z.forEach(q=>{Z.push(q),q.toLowerCase()===q?Z.push(q.toUpperCase()):Z.push(q.toLowerCase())}),Z})(y),built_in:x},C=z=>z.map(Z=>Z.replace(/\|\d+$/,"")),k={variants:[{match:[/new/,e.concat(f,"+"),e.concat("(?!",C(x).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},I=e.concat(n,"\\b(?!\\()"),R={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),I],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),I],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},U={scope:"attr",match:e.concat(n,e.lookahead(":"),e.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[U,s,R,r.C_BLOCK_COMMENT_MODE,p,m,k]},$={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",C(v).join("\\b|"),"|",C(x).join("\\b|"),"\\b)"),n,e.concat(f,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push($);const H=[U,R,r.C_BLOCK_COMMENT_MODE,p,m,k],V={begin:e.concat(/#\[\s*\\?/,e.either(i,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...H]},...H,{scope:"meta",variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:A,contains:[V,r.HASH_COMMENT_MODE,r.COMMENT("//","$"),r.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:r.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,$,R,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},k,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},r.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:A,contains:["self",V,s,R,r.C_BLOCK_COMMENT_MODE,p,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},r.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[r.inherit(r.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},r.UNDERSCORE_TITLE_MODE]},p,m]}}function cZ(r){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},r.inherit(r.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),r.inherit(r.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function uZ(r){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function hZ(r){const e=r.regex,t=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},u={begin:/\{\{/,relevance:0},h={className:"string",contains:[r.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[r.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[r.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[r.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[r.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[r.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[r.BACKSLASH_ESCAPE,u,c]},r.APOS_STRING_MODE,r.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",f=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,p=`\\b|${n.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${f}))[eE][+-]?(${d})[jJ]?(?=${p})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${d})[jJ](?=${p})`}]},y={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,m,h,r.HASH_COMMENT_MODE]}]};return c.contains=[h,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},h,y,r.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,v,h]}]}}function dZ(r){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function fZ(r){const e=r.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:t,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[r.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),r.HASH_COMMENT_MODE,{scope:"string",contains:[r.BACKSLASH_ESCAPE],variants:[r.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),r.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),r.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),r.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),r.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),r.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,n]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,n]},{scope:{1:"punctuation",2:"number"},match:[a,n]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,n]}]},{scope:{3:"operator"},match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function gZ(r){const e=r.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(n,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[r.COMMENT("#","$",{contains:[o]}),r.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),r.COMMENT("^__END__",r.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:s},h={className:"string",contains:[r.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[r.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[r.BACKSLASH_ESCAPE,u]})]}]},d="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},k=[h,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:r.IDENT_RE+"::"},{className:"symbol",begin:r.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[h,{begin:t}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+r.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[r.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=k,m.contains=k;const D=[{begin:/^\s*=>/,starts:{end:"$",contains:k}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:k}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[r.SHEBANG({binary:"ruby"})].concat(D).concat(c).concat(k)}}function pZ(r){const e=r.regex,t=/(r#)?/,n=e.concat(t,r.UNDERSCORE_IDENT_RE),i=e.concat(t,r.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:r.IDENT_RE+"!?",type:u,keyword:o,literal:l,built_in:c},illegal:"</",contains:[r.C_LINE_COMMENT_MODE,r.COMMENT("/\\*","\\*/",{contains:["self"]}),r.inherit(r.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,n],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[r.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,n],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,n,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{begin:r.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:u}},{className:"punctuation",begin:"->"},a]}}const mZ=r=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:r.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:r.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),bZ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],vZ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],yZ=[...bZ,...vZ],wZ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),xZ=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),SZ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),kZ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function AZ(r){const e=mZ(r),t=SZ,n=xZ,i="@[a-z-]+",a="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+yZ.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+t.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+kZ.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,o,e.HEXCOLOR,e.CSS_NUMBER_MODE,r.QUOTE_STRING_MODE,r.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:wZ.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,r.QUOTE_STRING_MODE,r.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function _Z(r){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function CZ(r){const e=r.regex,t=r.COMMENT("--","$"),n={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],h=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],d=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=u,p=[...c,...l].filter(C=>!u.includes(C)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},v={match:e.concat(/\b/,e.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function x(C){return e.concat(/\b/,e.either(...C.map(k=>k.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:x(d),relevance:0};function A(C,{exceptions:k,when:I}={}){const R=I;return k=k||[],C.map(U=>U.match(/\|\d+$/)||k.includes(U)?U:R(U)?`${U}|0`:U)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(p,{when:C=>C.length<3}),literal:a,type:o,built_in:h},contains:[{scope:"type",match:x(s)},S,v,m,n,i,r.C_NUMBER_MODE,r.C_BLOCK_COMMENT_MODE,t,y]}}function FS(r){return r?typeof r=="string"?r:r.source:null}function bd(r){return mn("(?=",r,")")}function mn(...r){return r.map(t=>FS(t)).join("")}function EZ(r){const e=r[r.length-1];return typeof e=="object"&&e.constructor===Object?(r.splice(r.length-1,1),e):{}}function qi(...r){return"("+(EZ(r).capture?"":"?:")+r.map(n=>FS(n)).join("|")+")"}const K3=r=>mn(/\b/,r,/\w$/.test(r)?/\b/:/\B/),TZ=["Protocol","Type"].map(K3),DS=["init","self"].map(K3),IZ=["Any","Self"],Y3=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],LS=["false","nil","true"],MZ=["assignment","associativity","higherThan","left","lowerThan","none","right"],OZ=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],BS=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],US=qi(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),zS=qi(US,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),J3=mn(US,zS,"*"),jS=qi(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),A1=qi(jS,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Rs=mn(jS,A1,"*"),_1=mn(/[A-Z]/,A1,"*"),NZ=["attached","autoclosure",mn(/convention\(/,qi("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",mn(/objc\(/,Rs,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],RZ=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function PZ(r){const e={match:/\s+/,relevance:0},t=r.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[r.C_LINE_COMMENT_MODE,t],i={match:[/\./,qi(...TZ,...DS)],className:{2:"keyword"}},a={match:mn(/\./,qi(...Y3)),relevance:0},s=Y3.filter(Ge=>typeof Ge=="string").concat(["_|0"]),o=Y3.filter(Ge=>typeof Ge!="string").concat(IZ).map(K3),l={variants:[{className:"keyword",match:qi(...o,...DS)}]},c={$pattern:qi(/\b\w+/,/#\w+/),keyword:s.concat(OZ),literal:LS},u=[i,a,l],h={match:mn(/\./,qi(...BS)),relevance:0},d={className:"built_in",match:mn(/\b/,qi(...BS),/(?=\()/)},f=[h,d],p={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:J3},{match:`\\.(\\.|${zS})+`}]},y=[p,m],v="([0-9]_*)+",x="([0-9a-fA-F]_*)+",S={className:"number",relevance:0,variants:[{match:`\\b(${v})(\\.(${v}))?([eE][+-]?(${v}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${v}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(Ge="")=>({className:"subst",variants:[{match:mn(/\\/,Ge,/[0\\tnr"']/)},{match:mn(/\\/,Ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),C=(Ge="")=>({className:"subst",match:mn(/\\/,Ge,/[\t ]*(?:[\r\n]|\r\n)/)}),k=(Ge="")=>({className:"subst",label:"interpol",begin:mn(/\\/,Ge,/\(/),end:/\)/}),I=(Ge="")=>({begin:mn(Ge,/"""/),end:mn(/"""/,Ge),contains:[A(Ge),C(Ge),k(Ge)]}),R=(Ge="")=>({begin:mn(Ge,/"/),end:mn(/"/,Ge),contains:[A(Ge),k(Ge)]}),U={className:"string",variants:[I(),I("#"),I("##"),I("###"),R(),R("#"),R("##"),R("###")]},D=[r.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[r.BACKSLASH_ESCAPE]}],$={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:D},H=Ge=>{const ot=mn(Ge,/\//),lt=mn(/\//,Ge);return{begin:ot,end:lt,contains:[...D,{scope:"comment",begin:`#(?!.*${lt})`,end:/$/}]}},V={scope:"regexp",variants:[H("###"),H("##"),H("#"),$]},z={match:mn(/`/,Rs,/`/)},Z={className:"variable",match:/\$\d+/},q={className:"variable",match:`\\$${A1}+`},re=[z,Z,q],X={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:RZ,contains:[...y,S,U]}]}},ie={scope:"keyword",match:mn(/@/,qi(...NZ),bd(qi(/\(/,/\s+/)))},P={scope:"meta",match:mn(/@/,Rs)},be=[X,ie,P],_e={match:bd(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:mn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,A1,"+")},{className:"type",match:_1,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:mn(/\s+&\s+/,bd(_1)),relevance:0}]},W={begin:/</,end:/>/,keywords:c,contains:[...n,...u,...be,p,_e]};_e.contains.push(W);const me={match:mn(Rs,/\s*:/),keywords:"_|0",relevance:0},He={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",me,...n,V,...u,...f,...y,S,U,...re,...be,_e]},Xe={begin:/</,end:/>/,keywords:"repeat each",contains:[...n,_e]},Le={begin:qi(bd(mn(Rs,/\s*:/)),bd(mn(Rs,/\s+/,Rs,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Rs}]},bt={begin:/\(/,end:/\)/,keywords:c,contains:[Le,...n,...u,...y,S,U,...be,_e,He],endsParent:!0,illegal:/["']/},Ie={match:[/(func|macro)/,/\s+/,qi(z.match,Rs,J3)],className:{1:"keyword",3:"title.function"},contains:[Xe,bt,e],illegal:[/\[/,/%/]},Ve={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Xe,bt,e],illegal:/\[|%/},We={match:[/operator/,/\s+/,J3],className:{1:"keyword",3:"title"}},Qe={begin:[/precedencegroup/,/\s+/,_1],className:{1:"keyword",3:"title"},contains:[_e],keywords:[...MZ,...LS],end:/}/},mt={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ke={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ze={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Rs,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[Xe,...u,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:_1},...u],relevance:0}]};for(const Ge of U.variants){const ot=Ge.contains.find(ct=>ct.label==="interpol");ot.keywords=c;const lt=[...u,...f,...y,S,U,...re];ot.contains=[...lt,{begin:/\(/,end:/\)/,contains:["self",...lt]}]}return{name:"Swift",keywords:c,contains:[...n,Ie,Ve,mt,Ke,ze,We,Qe,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},V,...u,...f,...y,S,U,...re,...be,_e,He]}}const C1="[A-Za-z$_][0-9A-Za-z$_]*",HS=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],qS=["true","false","null","undefined","NaN","Infinity"],GS=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],WS=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],VS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],XS=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],$S=[].concat(VS,GS,WS);function FZ(r){const e=r.regex,t=(X,{after:ie})=>{const P="</"+X[0].slice(1);return X.input.indexOf(P,ie)!==-1},n=C1,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(X,ie)=>{const P=X[0].length+X.index,be=X.input[P];if(be==="<"||be===","){ie.ignoreMatch();return}be===">"&&(t(X,{after:P})||ie.ignoreMatch());let _e;const W=X.input.substring(P);if(_e=W.match(/^\s*=/)){ie.ignoreMatch();return}if((_e=W.match(/^\s+extends\s+/))&&_e.index===0){ie.ignoreMatch();return}}},o={$pattern:C1,keyword:HS,literal:qS,built_in:$S,"variable.language":XS},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,d],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[r.BACKSLASH_ESCAPE,d]},x={className:"comment",variants:[r.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),r.C_BLOCK_COMMENT_MODE,r.C_LINE_COMMENT_MODE]},S=[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,f,p,m,y,{match:/\$\d+/},h];d.contains=S.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(S)});const A=[].concat(x,d.contains),C=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(A)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:C},I={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...GS,...WS]}},U={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},D={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function H(X){return e.concat("(?!",X.join("|"),")")}const V={match:e.concat(/\b/,H([...VS,"super","import"].map(X=>`${X}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},z={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+r.UNDERSCORE_IDENT_RE+")\\s*=>",re={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[r.SHEBANG({label:"shebang",binary:"node",relevance:5}),U,r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,f,p,m,y,x,{match:/\$\d+/},h,R,{scope:"attr",match:n+e.lookahead(":"),relevance:0},re,{begin:"("+r.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,r.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:r.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},D,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+r.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,r.inherit(r.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},z,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},V,$,I,Z,{match:/\$[(.]/}]}}function DZ(r){const e=r.regex,t=FZ(r),n=C1,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,r.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[t.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:C1,keyword:HS.concat(l),literal:qS,built_in:$S.concat(i),"variable.language":XS},u={className:"meta",begin:"@"+n},h=(m,y,v)=>{const x=m.contains.findIndex(S=>S.label===y);if(x===-1)throw new Error("can not find mode to replace");m.contains.splice(x,1,v)};Object.assign(t.keywords,c),t.exports.PARAMS_CONTAINS.push(u);const d=t.contains.find(m=>m.scope==="attr"),f=Object.assign({},d,{match:e.concat(n,e.lookahead(/\s*\?:/))});t.exports.PARAMS_CONTAINS.push([t.exports.CLASS_REFERENCE,d,f]),t.contains=t.contains.concat([u,a,s,f]),h(t,"shebang",r.SHEBANG()),h(t,"use_strict",o);const p=t.contains.find(m=>m.label==="func.def");return p.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}function LZ(r){const e=r.regex,t={className:"string",begin:/"(""|[^/n])"C\b/},n={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(a,i),/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(a,i),/ +/,e.either(s,o),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},h=r.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=r.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[t,n,l,c,u,h,d,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[d]}]}}function BZ(r){r.regex;const e=r.COMMENT(/\(;/,/;\)/);e.contains.push("self");const t=r.COMMENT(/;;/,/$/),n=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:n},contains:[t,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,s,i,r.QUOTE_STRING_MODE,l,c,o]}}function UZ(r){const e=r.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=r.inherit(a,{begin:/\(/,end:/\)/}),o=r.inherit(r.APOS_STRING_MODE,{className:"string"}),l=r.inherit(r.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:n,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,l,o,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,s,l,o]}]}]},r.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function zZ(r){const e="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[r.BACKSLASH_ESCAPE,i]},o=r.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),d={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},p={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},y=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+r.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+r.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},r.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},d,{className:"number",begin:r.C_NUMBER_RE+"\\b",relevance:0},p,m,a,s],v=[...y];return v.pop(),v.push(o),f.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}const jZ={arduino:SQ,bash:kQ,c:AQ,cpp:_Q,csharp:CQ,css:FQ,diff:DQ,go:LQ,graphql:BQ,ini:UQ,java:zQ,javascript:WQ,json:VQ,kotlin:$Q,less:rZ,lua:nZ,makefile:iZ,markdown:aZ,objectivec:sZ,perl:oZ,php:lZ,"php-template":cZ,plaintext:uZ,python:hZ,"python-repl":dZ,r:fZ,ruby:gZ,rust:pZ,scss:AZ,shell:_Z,sql:CZ,swift:PZ,typescript:DZ,vbnet:LZ,wasm:BZ,xml:UZ,yaml:zZ};var Q3,KS;function HZ(){if(KS)return Q3;KS=1;function r(le){return le instanceof Map?le.clear=le.delete=le.set=function(){throw new Error("map is read-only")}:le instanceof Set&&(le.add=le.clear=le.delete=function(){throw new Error("set is read-only")}),Object.freeze(le),Object.getOwnPropertyNames(le).forEach(Be=>{const et=le[Be],zt=typeof et;(zt==="object"||zt==="function")&&!Object.isFrozen(et)&&r(et)}),le}class e{constructor(Be){Be.data===void 0&&(Be.data={}),this.data=Be.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(le){return le.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function n(le,...Be){const et=Object.create(null);for(const zt in le)et[zt]=le[zt];return Be.forEach(function(zt){for(const wr in zt)et[wr]=zt[wr]}),et}const i="</span>",a=le=>!!le.scope,s=(le,{prefix:Be})=>{if(le.startsWith("language:"))return le.replace("language:","language-");if(le.includes(".")){const et=le.split(".");return[`${Be}${et.shift()}`,...et.map((zt,wr)=>`${zt}${"_".repeat(wr+1)}`)].join(" ")}return`${Be}${le}`};class o{constructor(Be,et){this.buffer="",this.classPrefix=et.classPrefix,Be.walk(this)}addText(Be){this.buffer+=t(Be)}openNode(Be){if(!a(Be))return;const et=s(Be.scope,{prefix:this.classPrefix});this.span(et)}closeNode(Be){a(Be)&&(this.buffer+=i)}value(){return this.buffer}span(Be){this.buffer+=`<span class="${Be}">`}}const l=(le={})=>{const Be={children:[]};return Object.assign(Be,le),Be};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Be){this.top.children.push(Be)}openNode(Be){const et=l({scope:Be});this.add(et),this.stack.push(et)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Be){return this.constructor._walk(Be,this.rootNode)}static _walk(Be,et){return typeof et=="string"?Be.addText(et):et.children&&(Be.openNode(et),et.children.forEach(zt=>this._walk(Be,zt)),Be.closeNode(et)),Be}static _collapse(Be){typeof Be!="string"&&Be.children&&(Be.children.every(et=>typeof et=="string")?Be.children=[Be.children.join("")]:Be.children.forEach(et=>{c._collapse(et)}))}}class u extends c{constructor(Be){super(),this.options=Be}addText(Be){Be!==""&&this.add(Be)}startScope(Be){this.openNode(Be)}endScope(){this.closeNode()}__addSublanguage(Be,et){const zt=Be.root;et&&(zt.scope=`language:${et}`),this.add(zt)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function h(le){return le?typeof le=="string"?le:le.source:null}function d(le){return m("(?=",le,")")}function f(le){return m("(?:",le,")*")}function p(le){return m("(?:",le,")?")}function m(...le){return le.map(et=>h(et)).join("")}function y(le){const Be=le[le.length-1];return typeof Be=="object"&&Be.constructor===Object?(le.splice(le.length-1,1),Be):{}}function v(...le){return"("+(y(le).capture?"":"?:")+le.map(zt=>h(zt)).join("|")+")"}function x(le){return new RegExp(le.toString()+"|").exec("").length-1}function S(le,Be){const et=le&&le.exec(Be);return et&&et.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(le,{joinWith:Be}){let et=0;return le.map(zt=>{et+=1;const wr=et;let en=h(zt),Dt="";for(;en.length>0;){const Mt=A.exec(en);if(!Mt){Dt+=en;break}Dt+=en.substring(0,Mt.index),en=en.substring(Mt.index+Mt[0].length),Mt[0][0]==="\\"&&Mt[1]?Dt+="\\"+String(Number(Mt[1])+wr):(Dt+=Mt[0],Mt[0]==="("&&et++)}return Dt}).map(zt=>`(${zt})`).join(Be)}const k=/\b\B/,I="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",U="\\b\\d+(\\.\\d+)?",D="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$="\\b(0b[01]+)",H="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",V=(le={})=>{const Be=/^#![ ]*\//;return le.binary&&(le.begin=m(Be,/.*\b/,le.binary,/\b.*/)),n({scope:"meta",begin:Be,end:/$/,relevance:0,"on:begin":(et,zt)=>{et.index!==0&&zt.ignoreMatch()}},le)},z={begin:"\\\\[\\s\\S]",relevance:0},Z={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[z]},q={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[z]},re={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},X=function(le,Be,et={}){const zt=n({scope:"comment",begin:le,end:Be,contains:[]},et);zt.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const wr=v("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return zt.contains.push({begin:m(/[ ]+/,"(",wr,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),zt},ie=X("//","$"),P=X("/\\*","\\*/"),be=X("#","$"),_e={scope:"number",begin:U,relevance:0},W={scope:"number",begin:D,relevance:0},me={scope:"number",begin:$,relevance:0},He={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[z,{begin:/\[/,end:/\]/,relevance:0,contains:[z]}]},Xe={scope:"title",begin:I,relevance:0},Le={scope:"title",begin:R,relevance:0},bt={begin:"\\.\\s*"+R,relevance:0};var Ve=Object.freeze({__proto__:null,APOS_STRING_MODE:Z,BACKSLASH_ESCAPE:z,BINARY_NUMBER_MODE:me,BINARY_NUMBER_RE:$,COMMENT:X,C_BLOCK_COMMENT_MODE:P,C_LINE_COMMENT_MODE:ie,C_NUMBER_MODE:W,C_NUMBER_RE:D,END_SAME_AS_BEGIN:function(le){return Object.assign(le,{"on:begin":(Be,et)=>{et.data._beginMatch=Be[1]},"on:end":(Be,et)=>{et.data._beginMatch!==Be[1]&&et.ignoreMatch()}})},HASH_COMMENT_MODE:be,IDENT_RE:I,MATCH_NOTHING_RE:k,METHOD_GUARD:bt,NUMBER_MODE:_e,NUMBER_RE:U,PHRASAL_WORDS_MODE:re,QUOTE_STRING_MODE:q,REGEXP_MODE:He,RE_STARTERS_RE:H,SHEBANG:V,TITLE_MODE:Xe,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:Le});function We(le,Be){le.input[le.index-1]==="."&&Be.ignoreMatch()}function Qe(le,Be){le.className!==void 0&&(le.scope=le.className,delete le.className)}function mt(le,Be){Be&&le.beginKeywords&&(le.begin="\\b("+le.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",le.__beforeBegin=We,le.keywords=le.keywords||le.beginKeywords,delete le.beginKeywords,le.relevance===void 0&&(le.relevance=0))}function Ke(le,Be){Array.isArray(le.illegal)&&(le.illegal=v(...le.illegal))}function ze(le,Be){if(le.match){if(le.begin||le.end)throw new Error("begin & end are not supported with match");le.begin=le.match,delete le.match}}function Ge(le,Be){le.relevance===void 0&&(le.relevance=1)}const ot=(le,Be)=>{if(!le.beforeMatch)return;if(le.starts)throw new Error("beforeMatch cannot be used with starts");const et=Object.assign({},le);Object.keys(le).forEach(zt=>{delete le[zt]}),le.keywords=et.keywords,le.begin=m(et.beforeMatch,d(et.begin)),le.starts={relevance:0,contains:[Object.assign(et,{endsParent:!0})]},le.relevance=0,delete et.beforeMatch},lt=["of","and","for","in","not","or","if","then","parent","list","value"],ct="keyword";function Ct(le,Be,et=ct){const zt=Object.create(null);return typeof le=="string"?wr(et,le.split(" ")):Array.isArray(le)?wr(et,le):Object.keys(le).forEach(function(en){Object.assign(zt,Ct(le[en],Be,en))}),zt;function wr(en,Dt){Be&&(Dt=Dt.map(Mt=>Mt.toLowerCase())),Dt.forEach(function(Mt){const Tt=Mt.split("|");zt[Tt[0]]=[en,St(Tt[0],Tt[1])]})}}function St(le,Be){return Be?Number(Be):Ze(le)?0:1}function Ze(le){return lt.includes(le.toLowerCase())}const nt={},ht=le=>{console.error(le)},kt=(le,...Be)=>{console.log(`WARN: ${le}`,...Be)},Se=(le,Be)=>{nt[`${le}/${Be}`]||(console.log(`Deprecated as of ${le}. ${Be}`),nt[`${le}/${Be}`]=!0)},Fe=new Error;function it(le,Be,{key:et}){let zt=0;const wr=le[et],en={},Dt={};for(let Mt=1;Mt<=Be.length;Mt++)Dt[Mt+zt]=wr[Mt],en[Mt+zt]=!0,zt+=x(Be[Mt-1]);le[et]=Dt,le[et]._emit=en,le[et]._multi=!0}function yt(le){if(Array.isArray(le.begin)){if(le.skip||le.excludeBegin||le.returnBegin)throw ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Fe;if(typeof le.beginScope!="object"||le.beginScope===null)throw ht("beginScope must be object"),Fe;it(le,le.begin,{key:"beginScope"}),le.begin=C(le.begin,{joinWith:""})}}function $t(le){if(Array.isArray(le.end)){if(le.skip||le.excludeEnd||le.returnEnd)throw ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Fe;if(typeof le.endScope!="object"||le.endScope===null)throw ht("endScope must be object"),Fe;it(le,le.end,{key:"endScope"}),le.end=C(le.end,{joinWith:""})}}function kr(le){le.scope&&typeof le.scope=="object"&&le.scope!==null&&(le.beginScope=le.scope,delete le.scope)}function Ar(le){kr(le),typeof le.beginScope=="string"&&(le.beginScope={_wrap:le.beginScope}),typeof le.endScope=="string"&&(le.endScope={_wrap:le.endScope}),yt(le),$t(le)}function mr(le){function Be(Dt,Mt){return new RegExp(h(Dt),"m"+(le.case_insensitive?"i":"")+(le.unicodeRegex?"u":"")+(Mt?"g":""))}class et{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Mt,Tt){Tt.position=this.position++,this.matchIndexes[this.matchAt]=Tt,this.regexes.push([Tt,Mt]),this.matchAt+=x(Mt)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Mt=this.regexes.map(Tt=>Tt[1]);this.matcherRe=Be(C(Mt,{joinWith:"|"}),!0),this.lastIndex=0}exec(Mt){this.matcherRe.lastIndex=this.lastIndex;const Tt=this.matcherRe.exec(Mt);if(!Tt)return null;const Cr=Tt.findIndex((qa,Ps)=>Ps>0&&qa!==void 0),Sn=this.matchIndexes[Cr];return Tt.splice(0,Cr),Object.assign(Tt,Sn)}}class zt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Mt){if(this.multiRegexes[Mt])return this.multiRegexes[Mt];const Tt=new et;return this.rules.slice(Mt).forEach(([Cr,Sn])=>Tt.addRule(Cr,Sn)),Tt.compile(),this.multiRegexes[Mt]=Tt,Tt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Mt,Tt){this.rules.push([Mt,Tt]),Tt.type==="begin"&&this.count++}exec(Mt){const Tt=this.getMatcher(this.regexIndex);Tt.lastIndex=this.lastIndex;let Cr=Tt.exec(Mt);if(this.resumingScanAtSamePosition()&&!(Cr&&Cr.index===this.lastIndex)){const Sn=this.getMatcher(0);Sn.lastIndex=this.lastIndex+1,Cr=Sn.exec(Mt)}return Cr&&(this.regexIndex+=Cr.position+1,this.regexIndex===this.count&&this.considerAll()),Cr}}function wr(Dt){const Mt=new zt;return Dt.contains.forEach(Tt=>Mt.addRule(Tt.begin,{rule:Tt,type:"begin"})),Dt.terminatorEnd&&Mt.addRule(Dt.terminatorEnd,{type:"end"}),Dt.illegal&&Mt.addRule(Dt.illegal,{type:"illegal"}),Mt}function en(Dt,Mt){const Tt=Dt;if(Dt.isCompiled)return Tt;[Qe,ze,Ar,ot].forEach(Sn=>Sn(Dt,Mt)),le.compilerExtensions.forEach(Sn=>Sn(Dt,Mt)),Dt.__beforeBegin=null,[mt,Ke,Ge].forEach(Sn=>Sn(Dt,Mt)),Dt.isCompiled=!0;let Cr=null;return typeof Dt.keywords=="object"&&Dt.keywords.$pattern&&(Dt.keywords=Object.assign({},Dt.keywords),Cr=Dt.keywords.$pattern,delete Dt.keywords.$pattern),Cr=Cr||/\w+/,Dt.keywords&&(Dt.keywords=Ct(Dt.keywords,le.case_insensitive)),Tt.keywordPatternRe=Be(Cr,!0),Mt&&(Dt.begin||(Dt.begin=/\B|\b/),Tt.beginRe=Be(Tt.begin),!Dt.end&&!Dt.endsWithParent&&(Dt.end=/\B|\b/),Dt.end&&(Tt.endRe=Be(Tt.end)),Tt.terminatorEnd=h(Tt.end)||"",Dt.endsWithParent&&Mt.terminatorEnd&&(Tt.terminatorEnd+=(Dt.end?"|":"")+Mt.terminatorEnd)),Dt.illegal&&(Tt.illegalRe=Be(Dt.illegal)),Dt.contains||(Dt.contains=[]),Dt.contains=[].concat(...Dt.contains.map(function(Sn){return Zr(Sn==="self"?Dt:Sn)})),Dt.contains.forEach(function(Sn){en(Sn,Tt)}),Dt.starts&&en(Dt.starts,Mt),Tt.matcher=wr(Tt),Tt}if(le.compilerExtensions||(le.compilerExtensions=[]),le.contains&&le.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return le.classNameAliases=n(le.classNameAliases||{}),en(le)}function sn(le){return le?le.endsWithParent||sn(le.starts):!1}function Zr(le){return le.variants&&!le.cachedVariants&&(le.cachedVariants=le.variants.map(function(Be){return n(le,{variants:null},Be)})),le.cachedVariants?le.cachedVariants:sn(le)?n(le,{starts:le.starts?n(le.starts):null}):Object.isFrozen(le)?n(le):le}var Je="11.11.1";class wt extends Error{constructor(Be,et){super(Be),this.name="HTMLInjectionError",this.html=et}}const Et=t,hr=n,tt=Symbol("nomatch"),Ut=7,ur=function(le){const Be=Object.create(null),et=Object.create(null),zt=[];let wr=!0;const en="Could not find the language '{}', did you forget to load/include a language module?",Dt={disableAutodetect:!0,name:"Plain text",contains:[]};let Mt={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function Tt(ft){return Mt.noHighlightRe.test(ft)}function Cr(ft){let Xt=ft.className+" ";Xt+=ft.parentNode?ft.parentNode.className:"";const qr=Mt.languageDetectRe.exec(Xt);if(qr){const cn=aa(qr[1]);return cn||(kt(en.replace("{}",qr[1])),kt("Falling back to no-highlight mode for this block.",ft)),cn?qr[1]:"no-highlight"}return Xt.split(/\s+/).find(cn=>Tt(cn)||aa(cn))}function Sn(ft,Xt,qr){let cn="",Dn="";typeof Xt=="object"?(cn=ft,qr=Xt.ignoreIllegals,Dn=Xt.language):(Se("10.7.0","highlight(lang, code, ...args) has been deprecated."),Se("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),Dn=ft,cn=Xt),qr===void 0&&(qr=!0);const vr={code:cn,language:Dn};ko("before:highlight",vr);const as=vr.result?vr.result:qa(vr.language,vr.code,qr);return as.code=vr.code,ko("after:highlight",as),as}function qa(ft,Xt,qr,cn){const Dn=Object.create(null);function vr(Nt,Kt){return Nt.keywords[Kt]}function as(){if(!Ot.keywords){ni.addText(bn);return}let Nt=0;Ot.keywordPatternRe.lastIndex=0;let Kt=Ot.keywordPatternRe.exec(bn),Zt="";for(;Kt;){Zt+=bn.substring(Nt,Kt.index);const Pr=Ii.case_insensitive?Kt[0].toLowerCase():Kt[0],Ln=vr(Ot,Pr);if(Ln){const[Vi,Ed]=Ln;if(ni.addText(Zt),Zt="",Dn[Pr]=(Dn[Pr]||0)+1,Dn[Pr]<=Ut&&(li+=Ed),Vi.startsWith("_"))Zt+=Kt[0];else{const Bs=Ii.classNameAliases[Vi]||Vi;Yr(Kt[0],Bs)}}else Zt+=Kt[0];Nt=Ot.keywordPatternRe.lastIndex,Kt=Ot.keywordPatternRe.exec(bn)}Zt+=bn.substring(Nt),ni.addText(Zt)}function mc(){if(bn==="")return;let Nt=null;if(typeof Ot.subLanguage=="string"){if(!Be[Ot.subLanguage]){ni.addText(bn);return}Nt=qa(Ot.subLanguage,bn,!0,Pu[Ot.subLanguage]),Pu[Ot.subLanguage]=Nt._top}else Nt=Wi(bn,Ot.subLanguage.length?Ot.subLanguage:null);Ot.relevance>0&&(li+=Nt.relevance),ni.__addSublanguage(Nt._emitter,Nt.language)}function Ti(){Ot.subLanguage!=null?mc():as(),bn=""}function Yr(Nt,Kt){Nt!==""&&(ni.startScope(Kt),ni.addText(Nt),ni.endScope())}function gl(Nt,Kt){let Zt=1;const Pr=Kt.length-1;for(;Zt<=Pr;){if(!Nt._emit[Zt]){Zt++;continue}const Ln=Ii.classNameAliases[Nt[Zt]]||Nt[Zt],Vi=Kt[Zt];Ln?Yr(Vi,Ln):(bn=Vi,as(),bn=""),Zt++}}function pl(Nt,Kt){return Nt.scope&&typeof Nt.scope=="string"&&ni.openNode(Ii.classNameAliases[Nt.scope]||Nt.scope),Nt.beginScope&&(Nt.beginScope._wrap?(Yr(bn,Ii.classNameAliases[Nt.beginScope._wrap]||Nt.beginScope._wrap),bn=""):Nt.beginScope._multi&&(gl(Nt.beginScope,Kt),bn="")),Ot=Object.create(Nt,{parent:{value:Ot}}),Ot}function Ao(Nt,Kt,Zt){let Pr=S(Nt.endRe,Zt);if(Pr){if(Nt["on:end"]){const Ln=new e(Nt);Nt["on:end"](Kt,Ln),Ln.isMatchIgnored&&(Pr=!1)}if(Pr){for(;Nt.endsParent&&Nt.parent;)Nt=Nt.parent;return Nt}}if(Nt.endsWithParent)return Ao(Nt.parent,Kt,Zt)}function kd(Nt){return Ot.matcher.regexIndex===0?(bn+=Nt[0],1):(Wa=!0,0)}function Ad(Nt){const Kt=Nt[0],Zt=Nt.rule,Pr=new e(Zt),Ln=[Zt.__beforeBegin,Zt["on:begin"]];for(const Vi of Ln)if(Vi&&(Vi(Nt,Pr),Pr.isMatchIgnored))return kd(Kt);return Zt.skip?bn+=Kt:(Zt.excludeBegin&&(bn+=Kt),Ti(),!Zt.returnBegin&&!Zt.excludeBegin&&(bn=Kt)),pl(Zt,Nt),Zt.returnBegin?0:Kt.length}function Ru(Nt){const Kt=Nt[0],Zt=Xt.substring(Nt.index),Pr=Ao(Ot,Nt,Zt);if(!Pr)return tt;const Ln=Ot;Ot.endScope&&Ot.endScope._wrap?(Ti(),Yr(Kt,Ot.endScope._wrap)):Ot.endScope&&Ot.endScope._multi?(Ti(),gl(Ot.endScope,Nt)):Ln.skip?bn+=Kt:(Ln.returnEnd||Ln.excludeEnd||(bn+=Kt),Ti(),Ln.excludeEnd&&(bn=Kt));do Ot.scope&&ni.closeNode(),!Ot.skip&&!Ot.subLanguage&&(li+=Ot.relevance),Ot=Ot.parent;while(Ot!==Pr.parent);return Pr.starts&&pl(Pr.starts,Nt),Ln.returnEnd?0:Kt.length}function L1(){const Nt=[];for(let Kt=Ot;Kt!==Ii;Kt=Kt.parent)Kt.scope&&Nt.unshift(Kt.scope);Nt.forEach(Kt=>ni.openNode(Kt))}let _o={};function _d(Nt,Kt){const Zt=Kt&&Kt[0];if(bn+=Nt,Zt==null)return Ti(),0;if(_o.type==="begin"&&Kt.type==="end"&&_o.index===Kt.index&&Zt===""){if(bn+=Xt.slice(Kt.index,Kt.index+1),!wr){const Pr=new Error(`0 width match regex (${ft})`);throw Pr.languageName=ft,Pr.badRule=_o.rule,Pr}return 1}if(_o=Kt,Kt.type==="begin")return Ad(Kt);if(Kt.type==="illegal"&&!qr){const Pr=new Error('Illegal lexeme "'+Zt+'" for mode "'+(Ot.scope||"<unnamed>")+'"');throw Pr.mode=Ot,Pr}else if(Kt.type==="end"){const Pr=Ru(Kt);if(Pr!==tt)return Pr}if(Kt.type==="illegal"&&Zt==="")return bn+=`
`,1;if(ml>1e5&&ml>Kt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return bn+=Zt,Zt.length}const Ii=aa(ft);if(!Ii)throw ht(en.replace("{}",ft)),new Error('Unknown language: "'+ft+'"');const B1=mr(Ii);let Cd="",Ot=cn||B1;const Pu={},ni=new Mt.__emitter(Mt);L1();let bn="",li=0,sa=0,ml=0,Wa=!1;try{if(Ii.__emitTokens)Ii.__emitTokens(Xt,ni);else{for(Ot.matcher.considerAll();;){ml++,Wa?Wa=!1:Ot.matcher.considerAll(),Ot.matcher.lastIndex=sa;const Nt=Ot.matcher.exec(Xt);if(!Nt)break;const Kt=Xt.substring(sa,Nt.index),Zt=_d(Kt,Nt);sa=Nt.index+Zt}_d(Xt.substring(sa))}return ni.finalize(),Cd=ni.toHTML(),{language:ft,value:Cd,relevance:li,illegal:!1,_emitter:ni,_top:Ot}}catch(Nt){if(Nt.message&&Nt.message.includes("Illegal"))return{language:ft,value:Et(Xt),illegal:!0,relevance:0,_illegalBy:{message:Nt.message,index:sa,context:Xt.slice(sa-100,sa+100),mode:Nt.mode,resultSoFar:Cd},_emitter:ni};if(wr)return{language:ft,value:Et(Xt),illegal:!1,relevance:0,errorRaised:Nt,_emitter:ni,_top:Ot};throw Nt}}function Ps(ft){const Xt={value:Et(ft),illegal:!1,relevance:0,_top:Dt,_emitter:new Mt.__emitter(Mt)};return Xt._emitter.addText(ft),Xt}function Wi(ft,Xt){Xt=Xt||Mt.languages||Object.keys(Be);const qr=Ps(ft),cn=Xt.filter(aa).filter(Ls).map(Ti=>qa(Ti,ft,!1));cn.unshift(qr);const Dn=cn.sort((Ti,Yr)=>{if(Ti.relevance!==Yr.relevance)return Yr.relevance-Ti.relevance;if(Ti.language&&Yr.language){if(aa(Ti.language).supersetOf===Yr.language)return 1;if(aa(Yr.language).supersetOf===Ti.language)return-1}return 0}),[vr,as]=Dn,mc=vr;return mc.secondBest=as,mc}function So(ft,Xt,qr){const cn=Xt&&et[Xt]||qr;ft.classList.add("hljs"),ft.classList.add(`language-${cn}`)}function Ei(ft){let Xt=null;const qr=Cr(ft);if(Tt(qr))return;if(ko("before:highlightElement",{el:ft,language:qr}),ft.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ft);return}if(ft.children.length>0&&(Mt.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ft)),Mt.throwUnescapedHTML))throw new wt("One of your code blocks includes unescaped HTML.",ft.innerHTML);Xt=ft;const cn=Xt.textContent,Dn=qr?Sn(cn,{language:qr,ignoreIllegals:!0}):Wi(cn);ft.innerHTML=Dn.value,ft.dataset.highlighted="yes",So(ft,qr,Dn.language),ft.result={language:Dn.language,re:Dn.relevance,relevance:Dn.relevance},Dn.secondBest&&(ft.secondBest={language:Dn.secondBest.language,relevance:Dn.secondBest.relevance}),ko("after:highlightElement",{el:ft,result:Dn,text:cn})}function Fs(ft){Mt=hr(Mt,ft)}const Ga=()=>{bi(),Se("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Sa(){bi(),Se("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ds=!1;function bi(){function ft(){bi()}if(document.readyState==="loading"){Ds||window.addEventListener("DOMContentLoaded",ft,!1),Ds=!0;return}document.querySelectorAll(Mt.cssSelector).forEach(Ei)}function Nu(ft,Xt){let qr=null;try{qr=Xt(le)}catch(cn){if(ht("Language definition for '{}' could not be registered.".replace("{}",ft)),wr)ht(cn);else throw cn;qr=Dt}qr.name||(qr.name=ft),Be[ft]=qr,qr.rawDefinition=Xt.bind(null,le),qr.aliases&&Tn(qr.aliases,{languageName:ft})}function ka(ft){delete Be[ft];for(const Xt of Object.keys(et))et[Xt]===ft&&delete et[Xt]}function pc(){return Object.keys(Be)}function aa(ft){return ft=(ft||"").toLowerCase(),Be[ft]||Be[et[ft]]}function Tn(ft,{languageName:Xt}){typeof ft=="string"&&(ft=[ft]),ft.forEach(qr=>{et[qr.toLowerCase()]=Xt})}function Ls(ft){const Xt=aa(ft);return Xt&&!Xt.disableAutodetect}function is(ft){ft["before:highlightBlock"]&&!ft["before:highlightElement"]&&(ft["before:highlightElement"]=Xt=>{ft["before:highlightBlock"](Object.assign({block:Xt.el},Xt))}),ft["after:highlightBlock"]&&!ft["after:highlightElement"]&&(ft["after:highlightElement"]=Xt=>{ft["after:highlightBlock"](Object.assign({block:Xt.el},Xt))})}function D1(ft){is(ft),zt.push(ft)}function fl(ft){const Xt=zt.indexOf(ft);Xt!==-1&&zt.splice(Xt,1)}function ko(ft,Xt){const qr=ft;zt.forEach(function(cn){cn[qr]&&cn[qr](Xt)})}function Sd(ft){return Se("10.7.0","highlightBlock will be removed entirely in v12.0"),Se("10.7.0","Please use highlightElement now."),Ei(ft)}Object.assign(le,{highlight:Sn,highlightAuto:Wi,highlightAll:bi,highlightElement:Ei,highlightBlock:Sd,configure:Fs,initHighlighting:Ga,initHighlightingOnLoad:Sa,registerLanguage:Nu,unregisterLanguage:ka,listLanguages:pc,getLanguage:aa,registerAliases:Tn,autoDetection:Ls,inherit:hr,addPlugin:D1,removePlugin:fl}),le.debugMode=function(){wr=!1},le.safeMode=function(){wr=!0},le.versionString=Je,le.regex={concat:m,lookahead:d,either:v,optional:p,anyNumberOfTimes:f};for(const ft in Ve)typeof Ve[ft]=="object"&&r(Ve[ft]);return Object.assign(le,Ve),le},Ur=ur({});return Ur.newInstance=()=>ur({}),Q3=Ur,Ur.HighlightJS=Ur,Ur.default=Ur,Q3}var qZ=HZ();const GZ=x0(qZ),YS={},WZ="hljs-";function VZ(r){const e=GZ.newInstance();return r&&a(r),{highlight:t,highlightAuto:n,listLanguages:i,register:a,registerAlias:s,registered:o};function t(l,c,u){const h=u||YS,d=typeof h.prefix=="string"?h.prefix:WZ;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:XZ,classPrefix:d});const f=e.highlight(c,{ignoreIllegals:!0,language:l});if(f.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:f.errorRaised});const p=f._emitter.root,m=p.data;return m.language=f.language,m.relevance=f.relevance,p}function n(l,c){const h=(c||YS).subset||i();let d=-1,f=0,p;for(;++d<h.length;){const m=h[d];if(!e.getLanguage(m))continue;const y=t(m,l,c);y.data&&y.data.relevance!==void 0&&y.data.relevance>f&&(f=y.data.relevance,p=y)}return p||{type:"root",children:[],data:{language:void 0,relevance:f}}}function i(){return e.listLanguages()}function a(l,c){if(typeof l=="string")e.registerLanguage(l,c);else{let u;for(u in l)Object.hasOwn(l,u)&&e.registerLanguage(u,l[u])}}function s(l,c){if(typeof l=="string")e.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let u;for(u in l)if(Object.hasOwn(l,u)){const h=l[u];e.registerAliases(typeof h=="string"?h:[...h],{languageName:u})}}}function o(l){return!!e.getLanguage(l)}}class XZ{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type==="text"?n.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){const n=this.stack[this.stack.length-1],i=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:i}):n.children.push(...i)}openNode(e){const t=this,n=e.split(".").map(function(s,o){return o?s+"_".repeat(o):t.options.classPrefix+s}),i=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:n},children:[]};i.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const $Z={};function KZ(r){const e=r||$Z,t=e.aliases,n=e.detect||!1,i=e.languages||jZ,a=e.plainText,s=e.prefix,o=e.subset;let l="hljs";const c=VZ(i);if(t&&c.registerAlias(t),s){const u=s.indexOf("-");l=u===-1?s:s.slice(0,u)}return function(u,h){Xf(u,"element",function(d,f,p){if(d.tagName!=="code"||!p||p.type!=="element"||p.tagName!=="pre")return;const m=YZ(d);if(m===!1||!m&&!n||m&&a&&a.includes(m))return;Array.isArray(d.properties.className)||(d.properties.className=[]),d.properties.className.includes(l)||d.properties.className.unshift(l);const y=kS(d,{whitespace:"pre"});let v;try{v=m?c.highlight(m,y,{prefix:s}):c.highlightAuto(y,{prefix:s,subset:o})}catch(x){const S=x;if(m&&/Unknown language/.test(S.message)){h.message("Cannot highlight as `"+m+"`, its not registered",{ancestors:[p,d],cause:S,place:d.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw S}!m&&v.data&&v.data.language&&d.properties.className.push("language-"+v.data.language),v.children.length>0&&(d.children=v.children)})}}function YZ(r){const e=r.properties.className;let t=-1;if(!Array.isArray(e))return;let n;for(;++t<e.length;){const i=String(e[t]);if(i==="no-highlight"||i==="nohighlight")return!1;!n&&i.slice(0,5)==="lang-"&&(n=i.slice(5)),!n&&i.slice(0,9)==="language-"&&(n=i.slice(9))}return n}function JZ(r,e){const t={type:"element",tagName:"blockquote",properties:{},children:r.wrap(r.all(e),!0)};return r.patch(e,t),r.applyData(e,t)}function QZ(r,e){const t={type:"element",tagName:"br",properties:{},children:[]};return r.patch(e,t),[r.applyData(e,t),{type:"text",value:`
`}]}function ZZ(r,e){const t=e.value?e.value+`
`:"",n={};e.lang&&(n.className=["language-"+e.lang]);let i={type:"element",tagName:"code",properties:n,children:[{type:"text",value:t}]};return e.meta&&(i.data={meta:e.meta}),r.patch(e,i),i=r.applyData(e,i),i={type:"element",tagName:"pre",properties:{},children:[i]},r.patch(e,i),i}function eee(r,e){const t={type:"element",tagName:"del",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function tee(r,e){const t={type:"element",tagName:"em",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function ree(r,e){const t=typeof r.options.clobberPrefix=="string"?r.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),i=bu(n.toLowerCase()),a=r.footnoteOrder.indexOf(n);let s,o=r.footnoteCounts.get(n);o===void 0?(o=0,r.footnoteOrder.push(n),s=r.footnoteOrder.length):s=a+1,o+=1,r.footnoteCounts.set(n,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};r.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return r.patch(e,c),r.applyData(e,c)}function nee(r,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function iee(r,e){if(r.options.allowDangerousHtml){const t={type:"raw",value:e.value};return r.patch(e,t),r.applyData(e,t)}}function JS(r,e){const t=e.referenceType;let n="]";if(t==="collapsed"?n+="[]":t==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const i=r.all(e),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=n:i.push({type:"text",value:n}),i}function aee(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return JS(r,e);const i={src:bu(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"img",properties:i,children:[]};return r.patch(e,a),r.applyData(e,a)}function see(r,e){const t={src:bu(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"img",properties:t,children:[]};return r.patch(e,n),r.applyData(e,n)}function oee(r,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};r.patch(e,t);const n={type:"element",tagName:"code",properties:{},children:[t]};return r.patch(e,n),r.applyData(e,n)}function lee(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return JS(r,e);const i={href:bu(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"a",properties:i,children:r.all(e)};return r.patch(e,a),r.applyData(e,a)}function cee(r,e){const t={href:bu(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"a",properties:t,children:r.all(e)};return r.patch(e,n),r.applyData(e,n)}function uee(r,e,t){const n=r.all(e),i=t?hee(t):QS(e),a={},s=[];if(typeof e.checked=="boolean"){const u=n[0];let h;u&&u.type==="element"&&u.tagName==="p"?h=u:(h={type:"element",tagName:"p",properties:{},children:[]},n.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<n.length;){const u=n[o];(i||o!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
`}),u.type==="element"&&u.tagName==="p"&&!i?s.push(...u.children):s.push(u)}const l=n[n.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:a,children:s};return r.patch(e,c),r.applyData(e,c)}function hee(r){let e=!1;if(r.type==="list"){e=r.spread||!1;const t=r.children;let n=-1;for(;!e&&++n<t.length;)e=QS(t[n])}return e}function QS(r){const e=r.spread;return e??r.children.length>1}function dee(r,e){const t={},n=r.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.start);++i<n.length;){const s=n[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const a={type:"element",tagName:e.ordered?"ol":"ul",properties:t,children:r.wrap(n,!0)};return r.patch(e,a),r.applyData(e,a)}function fee(r,e){const t={type:"element",tagName:"p",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function gee(r,e){const t={type:"root",children:r.wrap(r.all(e))};return r.patch(e,t),r.applyData(e,t)}function pee(r,e){const t={type:"element",tagName:"strong",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}const ZS=tk("end"),ek=tk("start");function tk(r){return e;function e(t){const n=t&&t.position&&t.position[r]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function mee(r){const e=ek(r),t=ZS(r);if(e&&t)return{start:e,end:t}}function bee(r,e){const t=r.all(e),n=t.shift(),i=[];if(n){const s={type:"element",tagName:"thead",properties:{},children:r.wrap([n],!0)};r.patch(e.children[0],s),i.push(s)}if(t.length>0){const s={type:"element",tagName:"tbody",properties:{},children:r.wrap(t,!0)},o=ek(e.children[1]),l=ZS(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:r.wrap(i,!0)};return r.patch(e,a),r.applyData(e,a)}function vee(r,e,t){const n=t?t.children:void 0,a=(n?n.indexOf(e):1)===0?"th":"td",s=t&&t.type==="table"?t.align:void 0,o=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<o;){const h=e.children[l],d={},f=s?s[l]:void 0;f&&(d.align=f);let p={type:"element",tagName:a,properties:d,children:[]};h&&(p.children=r.all(h),r.patch(h,p),p=r.applyData(h,p)),c.push(p)}const u={type:"element",tagName:"tr",properties:{},children:r.wrap(c,!0)};return r.patch(e,u),r.applyData(e,u)}function yee(r,e){const t={type:"element",tagName:"td",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}const rk=9,nk=32;function wee(r){const e=String(r),t=/\r?\n|\r/g;let n=t.exec(e),i=0;const a=[];for(;n;)a.push(ik(e.slice(i,n.index),i>0,!0),n[0]),i=n.index+n[0].length,n=t.exec(e);return a.push(ik(e.slice(i),i>0,!1)),a.join("")}function ik(r,e,t){let n=0,i=r.length;if(e){let a=r.codePointAt(n);for(;a===rk||a===nk;)n++,a=r.codePointAt(n)}if(t){let a=r.codePointAt(i-1);for(;a===rk||a===nk;)i--,a=r.codePointAt(i-1)}return i>n?r.slice(n,i):""}function xee(r,e){const t={type:"text",value:wee(String(e.value))};return r.patch(e,t),r.applyData(e,t)}function See(r,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return r.patch(e,t),r.applyData(e,t)}const kee={blockquote:JZ,break:QZ,code:ZZ,delete:eee,emphasis:tee,footnoteReference:ree,heading:nee,html:iee,imageReference:aee,image:see,inlineCode:oee,linkReference:lee,link:cee,listItem:uee,list:dee,paragraph:fee,root:gee,strong:pee,table:bee,tableCell:yee,tableRow:vee,text:xee,thematicBreak:See,toml:E1,yaml:E1,definition:E1,footnoteDefinition:E1};function E1(){}const ak=-1,T1=0,vd=1,I1=2,Z3=3,e5=4,t5=5,r5=6,sk=7,ok=8,lk=typeof self=="object"?self:globalThis,Aee=(r,e)=>{const t=(i,a)=>(r.set(a,i),i),n=i=>{if(r.has(i))return r.get(i);const[a,s]=e[i];switch(a){case T1:case ak:return t(s,i);case vd:{const o=t([],i);for(const l of s)o.push(n(l));return o}case I1:{const o=t({},i);for(const[l,c]of s)o[n(l)]=n(c);return o}case Z3:return t(new Date(s),i);case e5:{const{source:o,flags:l}=s;return t(new RegExp(o,l),i)}case t5:{const o=t(new Map,i);for(const[l,c]of s)o.set(n(l),n(c));return o}case r5:{const o=t(new Set,i);for(const l of s)o.add(n(l));return o}case sk:{const{name:o,message:l}=s;return t(new lk[o](l),i)}case ok:return t(BigInt(s),i);case"BigInt":return t(Object(BigInt(s)),i);case"ArrayBuffer":return t(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return t(new DataView(o),s)}}return t(new lk[a](s),i)};return n},ck=r=>Aee(new Map,r)(0),Eu="",{toString:_ee}={},{keys:Cee}=Object,yd=r=>{const e=typeof r;if(e!=="object"||!r)return[T1,e];const t=_ee.call(r).slice(8,-1);switch(t){case"Array":return[vd,Eu];case"Object":return[I1,Eu];case"Date":return[Z3,Eu];case"RegExp":return[e5,Eu];case"Map":return[t5,Eu];case"Set":return[r5,Eu];case"DataView":return[vd,t]}return t.includes("Array")?[vd,t]:t.includes("Error")?[sk,t]:[I1,t]},M1=([r,e])=>r===T1&&(e==="function"||e==="symbol"),Eee=(r,e,t,n)=>{const i=(s,o)=>{const l=n.push(s)-1;return t.set(o,l),l},a=s=>{if(t.has(s))return t.get(s);let[o,l]=yd(s);switch(o){case T1:{let u=s;switch(l){case"bigint":o=ok,u=s.toString();break;case"function":case"symbol":if(r)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([ak],s)}return i([o,u],s)}case vd:{if(l){let d=s;return l==="DataView"?d=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(d=new Uint8Array(s)),i([l,[...d]],s)}const u=[],h=i([o,u],s);for(const d of s)u.push(a(d));return h}case I1:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(e&&"toJSON"in s)return a(s.toJSON());const u=[],h=i([o,u],s);for(const d of Cee(s))(r||!M1(yd(s[d])))&&u.push([a(d),a(s[d])]);return h}case Z3:return i([o,s.toISOString()],s);case e5:{const{source:u,flags:h}=s;return i([o,{source:u,flags:h}],s)}case t5:{const u=[],h=i([o,u],s);for(const[d,f]of s)(r||!(M1(yd(d))||M1(yd(f))))&&u.push([a(d),a(f)]);return h}case r5:{const u=[],h=i([o,u],s);for(const d of s)(r||!M1(yd(d)))&&u.push(a(d));return h}}const{message:c}=s;return i([o,{name:l,message:c}],s)};return a},uk=(r,{json:e,lossy:t}={})=>{const n=[];return Eee(!(e||t),!!e,new Map,n)(r),n},O1=typeof structuredClone=="function"?(r,e)=>e&&("json"in e||"lossy"in e)?ck(uk(r,e)):structuredClone(r):(r,e)=>ck(uk(r,e));function Tee(r,e){const t=[{type:"text",value:"↩"}];return e>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),t}function Iee(r,e){return"Back to reference "+(r+1)+(e>1?"-"+e:"")}function Mee(r){const e=typeof r.options.clobberPrefix=="string"?r.options.clobberPrefix:"user-content-",t=r.options.footnoteBackContent||Tee,n=r.options.footnoteBackLabel||Iee,i=r.options.footnoteLabel||"Footnotes",a=r.options.footnoteLabelTagName||"h2",s=r.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<r.footnoteOrder.length;){const c=r.footnoteById.get(r.footnoteOrder[l]);if(!c)continue;const u=r.all(c),h=String(c.identifier).toUpperCase(),d=bu(h.toLowerCase());let f=0;const p=[],m=r.footnoteCounts.get(h);for(;m!==void 0&&++f<=m;){p.length>0&&p.push({type:"text",value:" "});let x=typeof t=="string"?t:t(l,f);typeof x=="string"&&(x={type:"text",value:x}),p.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+d+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(l,f),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const x=y.children[y.children.length-1];x&&x.type==="text"?x.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...p)}else u.push(...p);const v={type:"element",tagName:"li",properties:{id:e+"fn-"+d},children:r.wrap(u,!0)};r.patch(c,v),o.push(v)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...O1(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:r.wrap(o,!0)},{type:"text",value:`
`}]}}const n5={}.hasOwnProperty,Oee={};function Nee(r,e){const t=e||Oee,n=new Map,i=new Map,a=new Map,s={...kee,...t.handlers},o={all:c,applyData:Pee,definitionById:n,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:l,options:t,patch:Ree,wrap:Dee};return Xf(r,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const h=u.type==="definition"?n:i,d=String(u.identifier).toUpperCase();h.has(d)||h.set(d,u)}}),o;function l(u,h){const d=u.type,f=o.handlers[d];if(n5.call(o.handlers,d)&&f)return f(o,u,h);if(o.options.passThrough&&o.options.passThrough.includes(d)){if("children"in u){const{children:m,...y}=u,v=O1(y);return v.children=o.all(u),v}return O1(u)}return(o.options.unknownHandler||Fee)(o,u,h)}function c(u){const h=[];if("children"in u){const d=u.children;let f=-1;for(;++f<d.length;){const p=o.one(d[f],u);if(p){if(f&&d[f-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=hk(p.value)),!Array.isArray(p)&&p.type==="element")){const m=p.children[0];m&&m.type==="text"&&(m.value=hk(m.value))}Array.isArray(p)?h.push(...p):h.push(p)}}}return h}}function Ree(r,e){r.position&&(e.position=mee(r))}function Pee(r,e){let t=e;if(r&&r.data){const n=r.data.hName,i=r.data.hChildren,a=r.data.hProperties;if(typeof n=="string")if(t.type==="element")t.tagName=n;else{const s="children"in t?t.children:[t];t={type:"element",tagName:n,properties:{},children:s}}t.type==="element"&&a&&Object.assign(t.properties,O1(a)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function Fee(r,e){const t=e.data||{},n="value"in e&&!(n5.call(t,"hProperties")||n5.call(t,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:r.all(e)};return r.patch(e,n),r.applyData(e,n)}function Dee(r,e){const t=[];let n=-1;for(e&&t.push({type:"text",value:`
`});++n<r.length;)n&&t.push({type:"text",value:`
`}),t.push(r[n]);return e&&r.length>0&&t.push({type:"text",value:`
`}),t}function hk(r){let e=0,t=r.charCodeAt(e);for(;t===9||t===32;)e++,t=r.charCodeAt(e);return r.slice(e)}function dk(r,e){const t=Nee(r,e),n=t.one(r,void 0),i=Mee(t),a=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
`},i),a}function Lee(r,e){return r&&"run"in r?async function(t,n){const i=dk(t,{file:n,...e});await r.run(i,n)}:function(t,n){return dk(t,{file:n,...r||e})}}class wd{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}wd.prototype.normal={},wd.prototype.property={},wd.prototype.space=void 0;function fk(r,e){const t={},n={};for(const i of r)Object.assign(t,i.property),Object.assign(n,i.normal);return new wd(t,n,e)}function xd(r){return r.toLowerCase()}class ia{constructor(e,t){this.attribute=t,this.property=e}}ia.prototype.attribute="",ia.prototype.booleanish=!1,ia.prototype.boolean=!1,ia.prototype.commaOrSpaceSeparated=!1,ia.prototype.commaSeparated=!1,ia.prototype.defined=!1,ia.prototype.mustUseProperty=!1,ia.prototype.number=!1,ia.prototype.overloadedBoolean=!1,ia.prototype.property="",ia.prototype.spaceSeparated=!1,ia.prototype.space=void 0;let Bee=0;const Nr=hc(),Qn=hc(),i5=hc(),dt=hc(),xn=hc(),Tu=hc(),xa=hc();function hc(){return 2**++Bee}const a5=Object.freeze(Object.defineProperty({__proto__:null,boolean:Nr,booleanish:Qn,commaOrSpaceSeparated:xa,commaSeparated:Tu,number:dt,overloadedBoolean:i5,spaceSeparated:xn},Symbol.toStringTag,{value:"Module"})),s5=Object.keys(a5);class o5 extends ia{constructor(e,t,n,i){let a=-1;if(super(e,t),gk(this,"space",i),typeof n=="number")for(;++a<s5.length;){const s=s5[a];gk(this,s5[a],(n&a5[s])===a5[s])}}}o5.prototype.defined=!0;function gk(r,e,t){t&&(r[e]=t)}function Iu(r){const e={},t={};for(const[n,i]of Object.entries(r.properties)){const a=new o5(n,r.transform(r.attributes||{},n),i,r.space);r.mustUseProperty&&r.mustUseProperty.includes(n)&&(a.mustUseProperty=!0),e[n]=a,t[xd(n)]=n,t[xd(a.attribute)]=n}return new wd(e,t,r.space)}const pk=Iu({properties:{ariaActiveDescendant:null,ariaAtomic:Qn,ariaAutoComplete:null,ariaBusy:Qn,ariaChecked:Qn,ariaColCount:dt,ariaColIndex:dt,ariaColSpan:dt,ariaControls:xn,ariaCurrent:null,ariaDescribedBy:xn,ariaDetails:null,ariaDisabled:Qn,ariaDropEffect:xn,ariaErrorMessage:null,ariaExpanded:Qn,ariaFlowTo:xn,ariaGrabbed:Qn,ariaHasPopup:null,ariaHidden:Qn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xn,ariaLevel:dt,ariaLive:null,ariaModal:Qn,ariaMultiLine:Qn,ariaMultiSelectable:Qn,ariaOrientation:null,ariaOwns:xn,ariaPlaceholder:null,ariaPosInSet:dt,ariaPressed:Qn,ariaReadOnly:Qn,ariaRelevant:null,ariaRequired:Qn,ariaRoleDescription:xn,ariaRowCount:dt,ariaRowIndex:dt,ariaRowSpan:dt,ariaSelected:Qn,ariaSetSize:dt,ariaSort:null,ariaValueMax:dt,ariaValueMin:dt,ariaValueNow:dt,ariaValueText:null,role:null},transform(r,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function mk(r,e){return e in r?r[e]:e}function bk(r,e){return mk(r,e.toLowerCase())}const Uee=Iu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Tu,acceptCharset:xn,accessKey:xn,action:null,allow:null,allowFullScreen:Nr,allowPaymentRequest:Nr,allowUserMedia:Nr,alt:null,as:null,async:Nr,autoCapitalize:null,autoComplete:xn,autoFocus:Nr,autoPlay:Nr,blocking:xn,capture:null,charSet:null,checked:Nr,cite:null,className:xn,cols:dt,colSpan:null,content:null,contentEditable:Qn,controls:Nr,controlsList:xn,coords:dt|Tu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Nr,defer:Nr,dir:null,dirName:null,disabled:Nr,download:i5,draggable:Qn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Nr,formTarget:null,headers:xn,height:dt,hidden:i5,high:dt,href:null,hrefLang:null,htmlFor:xn,httpEquiv:xn,id:null,imageSizes:null,imageSrcSet:null,inert:Nr,inputMode:null,integrity:null,is:null,isMap:Nr,itemId:null,itemProp:xn,itemRef:xn,itemScope:Nr,itemType:xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Nr,low:dt,manifest:null,max:null,maxLength:dt,media:null,method:null,min:null,minLength:dt,multiple:Nr,muted:Nr,name:null,nonce:null,noModule:Nr,noValidate:Nr,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Nr,optimum:dt,pattern:null,ping:xn,placeholder:null,playsInline:Nr,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Nr,referrerPolicy:null,rel:xn,required:Nr,reversed:Nr,rows:dt,rowSpan:dt,sandbox:xn,scope:null,scoped:Nr,seamless:Nr,selected:Nr,shadowRootClonable:Nr,shadowRootDelegatesFocus:Nr,shadowRootMode:null,shape:null,size:dt,sizes:null,slot:null,span:dt,spellCheck:Qn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:dt,step:null,style:null,tabIndex:dt,target:null,title:null,translate:null,type:null,typeMustMatch:Nr,useMap:null,value:Qn,width:dt,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xn,axis:null,background:null,bgColor:null,border:dt,borderColor:null,bottomMargin:dt,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Nr,declare:Nr,event:null,face:null,frame:null,frameBorder:null,hSpace:dt,leftMargin:dt,link:null,longDesc:null,lowSrc:null,marginHeight:dt,marginWidth:dt,noResize:Nr,noHref:Nr,noShade:Nr,noWrap:Nr,object:null,profile:null,prompt:null,rev:null,rightMargin:dt,rules:null,scheme:null,scrolling:Qn,standby:null,summary:null,text:null,topMargin:dt,valueType:null,version:null,vAlign:null,vLink:null,vSpace:dt,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Nr,disableRemotePlayback:Nr,prefix:null,property:null,results:dt,security:null,unselectable:null},space:"html",transform:bk}),zee=Iu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:xa,accentHeight:dt,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:dt,amplitude:dt,arabicForm:null,ascent:dt,attributeName:null,attributeType:null,azimuth:dt,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:dt,by:null,calcMode:null,capHeight:dt,className:xn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:dt,diffuseConstant:dt,direction:null,display:null,dur:null,divisor:dt,dominantBaseline:null,download:Nr,dx:null,dy:null,edgeMode:null,editable:null,elevation:dt,enableBackground:null,end:null,event:null,exponent:dt,externalResourcesRequired:null,fill:null,fillOpacity:dt,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Tu,g2:Tu,glyphName:Tu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:dt,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:dt,horizOriginX:dt,horizOriginY:dt,id:null,ideographic:dt,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:dt,k:dt,k1:dt,k2:dt,k3:dt,k4:dt,kernelMatrix:xa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:dt,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:dt,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:dt,overlineThickness:dt,paintOrder:null,panose1:null,path:null,pathLength:dt,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:dt,pointsAtY:dt,pointsAtZ:dt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xa,rev:xa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xa,requiredFeatures:xa,requiredFonts:xa,requiredFormats:xa,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:dt,specularExponent:dt,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:dt,strikethroughThickness:dt,string:null,stroke:null,strokeDashArray:xa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:dt,strokeOpacity:dt,strokeWidth:null,style:null,surfaceScale:dt,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xa,tabIndex:dt,tableValues:null,target:null,targetX:dt,targetY:dt,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:dt,underlineThickness:dt,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:dt,values:null,vAlphabetic:dt,vMathematical:dt,vectorEffect:null,vHanging:dt,vIdeographic:dt,version:null,vertAdvY:dt,vertOriginX:dt,vertOriginY:dt,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:dt,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:mk}),vk=Iu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(r,e){return"xlink:"+e.slice(5).toLowerCase()}}),yk=Iu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:bk}),wk=Iu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(r,e){return"xml:"+e.slice(3).toLowerCase()}}),jee=/[A-Z]/g,xk=/-[a-z]/g,Hee=/^data[-\w.:]+$/i;function Sk(r,e){const t=xd(e);let n=e,i=ia;if(t in r.normal)return r.property[r.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Hee.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(xk,Gee);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!xk.test(a)){let s=a.replace(jee,qee);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=o5}return new i(n,e)}function qee(r){return"-"+r.toLowerCase()}function Gee(r){return r.charAt(1).toUpperCase()}const kk=fk([pk,Uee,vk,yk,wk],"html"),l5=fk([pk,zee,vk,yk,wk],"svg");function Ak(r){const e=[],t=String(r||"");let n=t.indexOf(","),i=0,a=!1;for(;!a;){n===-1&&(n=t.length,a=!0);const s=t.slice(i,n).trim();(s||!a)&&e.push(s),i=n+1,n=t.indexOf(",",i)}return e}function Wee(r,e){const t=e||{};return(r[r.length-1]===""?[...r,""]:r).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const _k=/[#.]/g;function Vee(r,e){const t=r||"",n={};let i=0,a,s;for(;i<t.length;){_k.lastIndex=i;const o=_k.exec(t),l=t.slice(i,o?o.index:t.length);l&&(a?a==="#"?n.id=l:Array.isArray(n.className)?n.className.push(l):n.className=[l]:s=l,i+=l.length),o&&(a=o[0],i++)}return{type:"element",tagName:s||e||"div",properties:n,children:[]}}function Ck(r){const e=String(r||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function Xee(r){return r.join(" ").trim()}function Ek(r,e,t){const n=t?Jee(t):void 0;function i(a,s,...o){let l;if(a==null){l={type:"root",children:[]};const c=s;o.unshift(c)}else{l=Vee(a,e);const c=l.tagName.toLowerCase(),u=n?n.get(c):void 0;if(l.tagName=u||c,$ee(s))o.unshift(s);else for(const[h,d]of Object.entries(s))Kee(r,l.properties,h,d)}for(const c of o)c5(l.children,c);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return i}function $ee(r){if(r===null||typeof r!="object"||Array.isArray(r))return!0;if(typeof r.type!="string")return!1;const e=r,t=Object.keys(r);for(const n of t){const i=e[n];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in r&&Array.isArray(r.children))}function Kee(r,e,t,n){const i=Sk(r,t);let a;if(n!=null){if(typeof n=="number"){if(Number.isNaN(n))return;a=n}else typeof n=="boolean"?a=n:typeof n=="string"?i.spaceSeparated?a=Ck(n):i.commaSeparated?a=Ak(n):i.commaOrSpaceSeparated?a=Ck(Ak(n).join(" ")):a=Tk(i,i.property,n):Array.isArray(n)?a=[...n]:a=i.property==="style"?Yee(n):String(n);if(Array.isArray(a)){const s=[];for(const o of a)s.push(Tk(i,i.property,o));a=s}i.property==="className"&&Array.isArray(e.className)&&(a=e.className.concat(a)),e[i.property]=a}}function c5(r,e){if(e!=null)if(typeof e=="number"||typeof e=="string")r.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const t of e)c5(r,t);else if(typeof e=="object"&&"type"in e)e.type==="root"?c5(r,e.children):r.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function Tk(r,e,t){if(typeof t=="string"){if(r.number&&t&&!Number.isNaN(Number(t)))return Number(t);if((r.boolean||r.overloadedBoolean)&&(t===""||xd(t)===xd(e)))return!0}return t}function Yee(r){const e=[];for(const[t,n]of Object.entries(r))e.push([t,n].join(": "));return e.join("; ")}function Jee(r){const e=new Map;for(const t of r)e.set(t.toLowerCase(),t);return e}const Qee=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Zee=Ek(kk,"div"),ete=Ek(l5,"g",Qee),u5={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function tte(r,e){return Ik(r,{})||{type:"root",children:[]}}function Ik(r,e){const t=rte(r,e);return t&&e.afterTransform&&e.afterTransform(r,t),t}function rte(r,e){switch(r.nodeType){case 1:return ste(r,e);case 3:return ite(r);case 8:return ate(r);case 9:return Mk(r,e);case 10:return nte();case 11:return Mk(r,e);default:return}}function Mk(r,e){return{type:"root",children:Ok(r,e)}}function nte(){return{type:"doctype"}}function ite(r){return{type:"text",value:r.nodeValue||""}}function ate(r){return{type:"comment",value:r.nodeValue||""}}function ste(r,e){const t=r.namespaceURI,n=t===u5.svg?ete:Zee,i=t===u5.html?r.tagName.toLowerCase():r.tagName,a=t===u5.html&&i==="template"?r.content:r,s=r.getAttributeNames(),o={};let l=-1;for(;++l<s.length;)o[s[l]]=r.getAttribute(s[l])||"";return n(i,o,Ok(a,e))}function Ok(r,e){const t=r.childNodes,n=[];let i=-1;for(;++i<t.length;){const a=Ik(t[i],e);a!==void 0&&n.push(a)}return n}new DOMParser;function ote(r,e){const t=lte(r);return tte(t)}function lte(r){const e=document.createElement("template");return e.innerHTML=r,e.content}const cte={},ute=[];function hte(r){const e=r||cte;return function(t,n){Db(t,"element",function(i,a){const s=Array.isArray(i.properties.className)?i.properties.className:ute,o=s.includes("language-math"),l=s.includes("math-display"),c=s.includes("math-inline");let u=l;if(!o&&!l&&!c)return;let h=a[a.length-1],d=i;if(i.tagName==="code"&&o&&h&&h.type==="element"&&h.tagName==="pre"&&(d=h,h=a[a.length-2],u=!0),!h)return;const f=kS(d,{whitespace:"pre"});let p;try{p=mS.renderToString(f,{...e,displayMode:u,throwOnError:!0})}catch(y){const v=y,x=v.name.toLowerCase();n.message("Could not render math with KaTeX",{ancestors:[...a,i],cause:v,place:i.position,ruleId:x,source:"rehype-katex"});try{p=mS.renderToString(f,{...e,displayMode:u,strict:"ignore",throwOnError:!1})}catch{p=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(e.errorColor||"#cc0000"),title:String(y)},children:[{type:"text",value:f}]}]}}typeof p=="string"&&(p=ote(p).children);const m=h.children.indexOf(d);return h.children.splice(m,1,...p),iw})}}const dte=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],fte=/["&'<>`]/g,gte=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,pte=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,mte=/[|\\{}()[\]^$+*?.]/g,Nk=new WeakMap;function bte(r,e){if(r=r.replace(e.subset?vte(e.subset):fte,n),e.subset||e.escapeOnly)return r;return r.replace(gte,t).replace(pte,n);function t(i,a,s){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(a+2),e)}function n(i,a,s){return e.format(i.charCodeAt(0),s.charCodeAt(a+1),e)}}function vte(r){let e=Nk.get(r);return e||(e=yte(r),Nk.set(r,e)),e}function yte(r){const e=[];let t=-1;for(;++t<r.length;)e.push(r[t].replace(mte,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const wte=/[\dA-Fa-f]/;function xte(r,e,t){const n="&#x"+r.toString(16).toUpperCase();return t&&e&&!wte.test(String.fromCharCode(e))?n:n+";"}const Ste=/\d/;function kte(r,e,t){const n="&#"+String(r);return t&&e&&!Ste.test(String.fromCharCode(e))?n:n+";"}const Ate=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],h5={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"",Prime:"″",oline:"‾",frasl:"",weierp:"℘",image:"",real:"",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"",lowast:"",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"",cap:"∩",cup:"",int:"∫",there4:"∴",sim:"",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:"",emsp:"",thinsp:"",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"",mdash:"—",lsquo:"",rsquo:"",sbquo:"",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"",rsaquo:"",euro:"€"},_te=["cent","copy","divide","gt","lt","not","para","times"],Rk={}.hasOwnProperty,d5={};let N1;for(N1 in h5)Rk.call(h5,N1)&&(d5[h5[N1]]=N1);const Cte=/[^\dA-Za-z]/;function Ete(r,e,t,n){const i=String.fromCharCode(r);if(Rk.call(d5,i)){const a=d5[i],s="&"+a;return t&&Ate.includes(a)&&!_te.includes(a)&&(!n||e&&e!==61&&Cte.test(String.fromCharCode(e)))?s:s+";"}return""}function Tte(r,e,t){let n=xte(r,e,t.omitOptionalSemicolons),i;if((t.useNamedReferences||t.useShortestReferences)&&(i=Ete(r,e,t.omitOptionalSemicolons,t.attribute)),(t.useShortestReferences||!i)&&t.useShortestReferences){const a=kte(r,e,t.omitOptionalSemicolons);a.length<n.length&&(n=a)}return i&&(!t.useShortestReferences||i.length<n.length)?i:n}function Mu(r,e){return bte(r,Object.assign({format:Tte},e))}const Ite=/^>|^->|<!--|-->|--!>|<!-$/g,Mte=[">"],Ote=["<",">"];function Nte(r,e,t,n){return n.settings.bogusComments?"<?"+Mu(r.value,Object.assign({},n.settings.characterReferences,{subset:Mte}))+">":"<!--"+r.value.replace(Ite,i)+"-->";function i(a){return Mu(a,Object.assign({},n.settings.characterReferences,{subset:Ote}))}}function Rte(r,e,t,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}const Pte=/[ \t\n\f\r]/g;function f5(r){return typeof r=="object"?r.type==="text"?Pk(r.value):!1:Pk(r)}function Pk(r){return r.replace(Pte,"")===""}const ri=Dk(1),Fk=Dk(-1),Fte=[];function Dk(r){return e;function e(t,n,i){const a=t?t.children:Fte;let s=(n||0)+r,o=a[s];if(!i)for(;o&&f5(o);)s+=r,o=a[s];return o}}const Dte={}.hasOwnProperty;function Lk(r){return e;function e(t,n,i){return Dte.call(r,t.tagName)&&r[t.tagName](t,n,i)}}const g5=Lk({body:Bte,caption:p5,colgroup:p5,dd:Hte,dt:jte,head:p5,html:Lte,li:zte,optgroup:qte,option:Gte,p:Ute,rp:Bk,rt:Bk,tbody:Vte,td:Uk,tfoot:Xte,th:Uk,thead:Wte,tr:$te});function p5(r,e,t){const n=ri(t,e,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&f5(n.value.charAt(0)))}function Lte(r,e,t){const n=ri(t,e);return!n||n.type!=="comment"}function Bte(r,e,t){const n=ri(t,e);return!n||n.type!=="comment"}function Ute(r,e,t){const n=ri(t,e);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!t||!(t.type==="element"&&(t.tagName==="a"||t.tagName==="audio"||t.tagName==="del"||t.tagName==="ins"||t.tagName==="map"||t.tagName==="noscript"||t.tagName==="video"))}function zte(r,e,t){const n=ri(t,e);return!n||n.type==="element"&&n.tagName==="li"}function jte(r,e,t){const n=ri(t,e);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function Hte(r,e,t){const n=ri(t,e);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function Bk(r,e,t){const n=ri(t,e);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function qte(r,e,t){const n=ri(t,e);return!n||n.type==="element"&&n.tagName==="optgroup"}function Gte(r,e,t){const n=ri(t,e);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function Wte(r,e,t){const n=ri(t,e);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function Vte(r,e,t){const n=ri(t,e);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function Xte(r,e,t){return!ri(t,e)}function $te(r,e,t){const n=ri(t,e);return!n||n.type==="element"&&n.tagName==="tr"}function Uk(r,e,t){const n=ri(t,e);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const Kte=Lk({body:Qte,colgroup:Zte,head:Jte,html:Yte,tbody:ere});function Yte(r){const e=ri(r,-1);return!e||e.type!=="comment"}function Jte(r){const e=new Set;for(const n of r.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(e.has(n.tagName))return!1;e.add(n.tagName)}const t=r.children[0];return!t||t.type==="element"}function Qte(r){const e=ri(r,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&f5(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Zte(r,e,t){const n=Fk(t,e),i=ri(r,-1,!0);return t&&n&&n.type==="element"&&n.tagName==="colgroup"&&g5(n,t.children.indexOf(n),t)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function ere(r,e,t){const n=Fk(t,e),i=ri(r,-1);return t&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&g5(n,t.children.indexOf(n),t)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const R1={name:[[`
\f\r &/=>`.split(""),`
\f\r "&'/=>\``.split("")],[`\0
\f\r "&'/<=>`.split(""),`\0
\f\r "&'/<=>\``.split("")]],unquoted:[[`
\f\r &>`.split(""),`\0
\f\r "&'<=>\``.split("")],[`\0
\f\r "&'<=>\``.split(""),`\0
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function tre(r,e,t,n){const i=n.schema,a=i.space==="svg"?!1:n.settings.omitOptionalTags;let s=i.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(r.tagName.toLowerCase());const o=[];let l;i.space==="html"&&r.tagName==="svg"&&(n.schema=l5);const c=rre(n,r.properties),u=n.all(i.space==="html"&&r.tagName==="template"?r.content:r);return n.schema=i,u&&(s=!1),(c||!a||!Kte(r,e,t))&&(o.push("<",r.tagName,c?" "+c:""),s&&(i.space==="svg"||n.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(u),!s&&(!a||!g5(r,e,t))&&o.push("</"+r.tagName+">"),o.join("")}function rre(r,e){const t=[];let n=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const a=nre(r,i,e[i]);a&&t.push(a)}}for(;++n<t.length;){const a=r.settings.tightAttributes?t[n].charAt(t[n].length-1):void 0;n!==t.length-1&&a!=='"'&&a!=="'"&&(t[n]+=" ")}return t.join("")}function nre(r,e,t){const n=Sk(r.schema,e),i=r.settings.allowParseErrors&&r.schema.space==="html"?0:1,a=r.settings.allowDangerousCharacters?0:1;let s=r.quote,o;if(n.overloadedBoolean&&(t===n.attribute||t==="")?t=!0:(n.boolean||n.overloadedBoolean)&&(typeof t!="string"||t===n.attribute||t==="")&&(t=!!t),t==null||t===!1||typeof t=="number"&&Number.isNaN(t))return"";const l=Mu(n.attribute,Object.assign({},r.settings.characterReferences,{subset:R1.name[i][a]}));return t===!0||(t=Array.isArray(t)?(n.commaSeparated?Wee:Xee)(t,{padLeft:!r.settings.tightCommaSeparatedLists}):String(t),r.settings.collapseEmptyAttributes&&!t)?l:(r.settings.preferUnquoted&&(o=Mu(t,Object.assign({},r.settings.characterReferences,{attribute:!0,subset:R1.unquoted[i][a]}))),o!==t&&(r.settings.quoteSmart&&Kf(t,s)>Kf(t,r.alternative)&&(s=r.alternative),o=s+Mu(t,Object.assign({},r.settings.characterReferences,{subset:(s==="'"?R1.single:R1.double)[i][a],attribute:!0}))+s),l+(o&&"="+o))}const ire=["<","&"];function zk(r,e,t,n){return t&&t.type==="element"&&(t.tagName==="script"||t.tagName==="style")?r.value:Mu(r.value,Object.assign({},n.settings.characterReferences,{subset:ire}))}function are(r,e,t,n){return n.settings.allowDangerousHtml?r.value:zk(r,e,t,n)}function sre(r,e,t,n){return n.all(r)}const ore=K8("type",{invalid:lre,unknown:cre,handlers:{comment:Nte,doctype:Rte,element:tre,raw:are,root:sre,text:zk}});function lre(r){throw new Error("Expected node, not `"+r+"`")}function cre(r){const e=r;throw new Error("Cannot compile unknown node `"+e.type+"`")}const ure={},hre={},dre=[];function fre(r,e){const t=e||ure,n=t.quote||'"',i=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:gre,all:pre,settings:{omitOptionalTags:t.omitOptionalTags||!1,allowParseErrors:t.allowParseErrors||!1,allowDangerousCharacters:t.allowDangerousCharacters||!1,quoteSmart:t.quoteSmart||!1,preferUnquoted:t.preferUnquoted||!1,tightAttributes:t.tightAttributes||!1,upperDoctype:t.upperDoctype||!1,tightDoctype:t.tightDoctype||!1,bogusComments:t.bogusComments||!1,tightCommaSeparatedLists:t.tightCommaSeparatedLists||!1,tightSelfClosing:t.tightSelfClosing||!1,collapseEmptyAttributes:t.collapseEmptyAttributes||!1,allowDangerousHtml:t.allowDangerousHtml||!1,voids:t.voids||dte,characterReferences:t.characterReferences||hre,closeSelfClosing:t.closeSelfClosing||!1,closeEmptyElements:t.closeEmptyElements||!1},schema:t.space==="svg"?l5:kk,quote:n,alternative:i}.one(Array.isArray(r)?{type:"root",children:r}:r,void 0,void 0)}function gre(r,e,t){return ore(r,e,t,this)}function pre(r){const e=[],t=r&&r.children||dre;let n=-1;for(;++n<t.length;)e[n]=this.one(t[n],n,r);return e.join("")}function mre(r){const e=this,t={...e.data("settings"),...r};e.compiler=n;function n(i){return fre(i,t)}}const bre=`pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
Theme: GitHub Dark
Description: Dark theme as seen on github.com
Author: github.com
Maintainer: @Hirse
Updated: 2021-05-15
Outdated base version: https://github.com/primer/github-syntax-dark
Current colors taken from GitHub's CSS
*/.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}`,vre=`pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
Theme: GitHub
Description: Light theme as seen on github.com
Author: github.com
Maintainer: @Hirse
Updated: 2021-05-15
Outdated base version: https://github.com/primer/github-syntax-light
Current colors taken from GitHub's CSS
*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}`,yre=/\r?\n/,wre=new Set(["paragraph","heading","emphasis","strong","delete","link","linkReference","tableCell"]),jk=" ",xre=jk.repeat(4);function Sre(r){let e=0,t="";for(;e<r.length;){const n=r[e];if(n===" "){t+=jk,e+=1;continue}if(n===" "){t+=xre,e+=1;continue}break}return t+r.slice(e)}function kre(r){const e=r.split(yre),t=[];for(const[n,i]of e.entries())n>0&&t.push({type:"break"}),t.push({type:"text",value:Sre(i)});return t.length||t.push({type:"text",value:""}),t}const Are=()=>r=>{Xf(r,"html",(e,t,n)=>{if(!n||typeof t!="number")return;const i=kre(e.value);if(!wre.has(n.type)){const a={type:"paragraph",children:i,data:{literalHtml:!0}},s=n.children;if(s.splice(t,1,a),t>0){const o=s[t-1];if(o?.type==="paragraph"&&o.data?.literalHtml){const l=o.children;return l.length&&l[l.length-1].type!=="break"&&l.push({type:"break"}),l.push(...a.children),s.splice(t,1),t}}return t+1}return n.children.splice(t,1,...i),t+i.length})};var _re=ee("<div><!></div>");function Hk(r,e){ge(e,!0);let t=L(e,"class",3,""),n=oe(void 0),i=oe("");function a(p){document.querySelectorAll("style[data-highlight-theme]").forEach(v=>v.remove());const y=document.createElement("style");y.setAttribute("data-highlight-theme","true"),y.textContent=p?bre:vre,document.head.appendChild(y)}Ft(()=>{const m=b8.current==="dark";a(m)});let s=j(()=>()=>v$().use(JK).use(lQ).use(_$).use(Are).use(Lee).use(hte).use(KZ).use(mre));function o(p){if(!p.includes("<a"))return p;const m=document.createElement("div");m.innerHTML=p;const y=m.querySelectorAll("a[href]");let v=!1;for(const x of y){const S=x.getAttribute("target"),A=x.getAttribute("rel");(S!=="_blank"||A!=="noopener noreferrer")&&(v=!0),x.setAttribute("target","_blank"),x.setAttribute("rel","noopener noreferrer")}return v?m.innerHTML:p}function l(p){if(!p.includes("<pre"))return p;const m=document.createElement("div");m.innerHTML=p;const y=m.querySelectorAll("pre");let v=!1;for(const[x,S]of Array.from(y).entries()){const A=S.querySelector("code");if(!A)continue;v=!0;let C="text";const k=Array.from(A.classList);for(const z of k)if(z.startsWith("language-")){C=z.replace("language-","");break}const I=A.textContent||"",R=`code-${Date.now()}-${x}`;A.setAttribute("data-code-id",R),A.setAttribute("data-raw-code",I);const U=document.createElement("div");U.className="code-block-wrapper";const D=document.createElement("div");D.className="code-block-header";const $=document.createElement("span");$.className="code-language",$.textContent=C;const H=document.createElement("button");H.className="copy-code-btn",H.setAttribute("data-code-id",R),H.setAttribute("title","Copy code"),H.setAttribute("type","button"),H.innerHTML=`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy-icon lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>
`,D.appendChild($),D.appendChild(H),U.appendChild(D);const V=S.cloneNode(!0);U.appendChild(V),S.parentNode?.replaceChild(U,S)}return v?m.innerHTML:p}function c(p){return p.replace(/(^|[^\\])\\\[((?:\\.|[\s\S])*?)\\\]/g,(m,y,v)=>`${y}$$${v}$$`).replace(/(^|[^\\])\\\(((?:\\.|[\s\S])*?)\\\)/g,(m,y,v)=>`${y}$${v}$`)}async function u(p){try{const m=c(p),y=await g(s)().process(m),v=String(y),x=o(v);return l(x)}catch(m){return console.error("Markdown processing error:",m),p.replace(/\n/g,"<br>")}}function h(){if(!g(n))return;const p=g(n).querySelectorAll(".copy-code-btn");for(const m of p)m.addEventListener("click",async y=>{y.preventDefault(),y.stopPropagation();const v=y.currentTarget;if(!v.getAttribute("data-code-id")){console.error("No code ID found on button");return}const S=v.closest(".code-block-wrapper");if(!S){console.error("No wrapper found");return}const A=S.querySelector("code[data-code-id]");if(!A){console.error("No code element found in wrapper");return}const C=A.getAttribute("data-raw-code");if(!C){console.error("No raw code found");return}try{await iz(C)}catch(k){console.error("Failed to copy code:",k)}})}Ft(()=>{e.content?u(e.content).then(p=>{O(i,p,!0)}).catch(p=>{console.error("Failed to process markdown:",p),O(i,e.content.replace(/\n/g,"<br>"),!0)}):O(i,"")}),Ft(()=>{g(n)&&g(i)&&h()});var d=_re(),f=te(d);z9(f,()=>g(i)),Q(d),Tr(d,p=>O(n,p),()=>g(n)),qe(()=>tr(d,1,ai(t()),"svelte-1dx4x3o")),_(r,d),pe()}var Cre=ee("<!> ",1),Ere=ee("<!> <!>",1),Tre=ee("<!> ",1),Ire=ee('<div><div class="flex items-center space-x-2"><div></div> <span class="text-sm text-muted-foreground"> </span></div> <!> <!></div>');function Mre(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"showActions",3,!1),i=j(DL),a=j(du),s=j(f7),o=j(FL);function l(){return g(a)?"bg-yellow-500":g(i)?"bg-red-500":g(o)?"bg-green-500":"bg-gray-500"}function c(){return g(a)?"Connecting...":g(i)?"Connection Error":g(o)?"Connected":"Unknown"}var u=Ire(),h=te(u),d=te(h),f=ae(d,2),p=te(f,!0);Q(f),Q(h);var m=ae(h,2);{var y=S=>{var A=Ere(),C=F(A);mu(C,{variant:"outline",class:"text-xs",children:(R,U)=>{var D=Cre(),$=F(D);h2($,{class:"mr-1 h-3 w-3"});var H=ae($);qe(()=>at(H,` ${g(s)||"Unknown Model"}`)),_(R,D)},$$slots:{default:!0}});var k=ae(C,2);{var I=R=>{mu(R,{variant:"secondary",class:"text-xs",children:(U,D)=>{Rt();var $=sr();qe(H=>at($,`ctx: ${H??""}`),[()=>g(o).default_generation_settings.n_ctx.toLocaleString()]),_(U,$)},$$slots:{default:!0}})};ce(k,R=>{g(o).default_generation_settings.n_ctx&&R(I)})}_(S,A)};ce(m,S=>{g(o)&&!g(i)&&S(y)})}var v=ae(m,2);{var x=S=>{Qr(S,{variant:"outline",size:"sm",class:"text-destructive",children:(A,C)=>{var k=Tre(),I=F(k);Th(I,{class:"h-4 w-4"});var R=ae(I);qe(()=>at(R,` ${g(i)??""}`)),_(A,k)},$$slots:{default:!0}})};ce(v,S=>{n()&&g(i)&&S(x)})}Q(u),qe((S,A)=>{tr(u,1,`flex items-center space-x-3 ${t()??""}`),tr(d,1,`h-2 w-2 rounded-full ${S??""}`),at(p,A)},[l,c]),_(r,u),pe()}var Ore=ee("<!> Enter API Key",1),Nre=ee('<div class="mb-4"><!></div>'),Rre=ee('<div class="absolute top-1/2 right-3 -translate-y-1/2"><!></div>'),Pre=ee('<div class="absolute top-1/2 right-3 -translate-y-1/2"><!></div>'),Fre=ee('<div class="absolute top-1/2 right-3 -translate-y-1/2"><!></div>'),Dre=ee('<p class="text-sm text-destructive"> </p>'),Lre=ee('<p class="text-sm text-green-600">✓ API key validated successfully! Connecting...</p>'),Bre=ee("<!> Validating...",1),Ure=ee('<div class="mb-4 space-y-3 text-left"><div class="space-y-2"><!> <div class="relative"><!> <!></div> <!> <!></div> <div class="flex gap-2"><!> <!></div></div>'),zre=ee("<!> Connecting...",1),jre=ee("<!> Retry Connection",1),Hre=ee("<div><!></div>"),qre=ee('<div class="mt-4 text-left"><details class="text-sm"><summary class="cursor-pointer text-muted-foreground hover:text-foreground">Troubleshooting</summary> <div class="mt-2 space-y-3 text-xs text-muted-foreground"><div class="space-y-2"><p class="mb-4 font-medium">Start the llama-server:</p> <div class="rounded bg-muted/50 px-2 py-1 font-mono text-xs"><p>llama-server -hf ggml-org/gemma-3-4b-it-GGUF</p></div> <p>or</p> <div class="rounded bg-muted/50 px-2 py-1 font-mono text-xs"><p class="mt-1">llama-server -m locally-stored-model.gguf</p></div></div> <ul class="list-disc space-y-1 pl-4"><li>Check that the server is accessible at the correct URL</li> <li>Verify your network connection</li> <li>Check server logs for any error messages</li></ul></div></details></div>'),Gre=ee('<div><div class="w-full max-w-md px-4 text-center"><div class="mb-6"><div class="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10"><!></div> <h2 class="mb-2 text-xl font-semibold">Server Connection Error</h2> <p class="mb-4 text-sm text-muted-foreground"> </p></div> <!> <!> <!> <!></div></div>');function qk(r,e){ge(e,!0);let t=L(e,"class",3,""),n=L(e,"showRetry",3,!0),i=L(e,"showTroubleshooting",3,!1),a=j(du),s=j(()=>e.error.toLowerCase().includes("access denied")||e.error.toLowerCase().includes("invalid api key")||e.error.toLowerCase().includes("unauthorized")||e.error.toLowerCase().includes("401")||e.error.toLowerCase().includes("403")),o=oe(""),l=oe(!1),c=oe("idle"),u=oe("");function h(){e.onRetry?e.onRetry():Kn.fetchServerProps()}function d(){O(l,!0);const z=fn();O(o,z.apiKey?.toString()||"",!0)}async function f(){if(g(o).trim()){O(c,"validating"),O(u,"");try{UL("apiKey",g(o).trim());const z=await fetch("./props",{headers:{"Content-Type":"application/json",Authorization:`Bearer ${g(o).trim()}`}});z.ok?(O(c,"success"),setTimeout(()=>{Do("#/")},1e3)):(O(c,"error"),z.status===401||z.status===403?O(u,"Invalid API key - please check and try again"):O(u,`Authentication failed (${z.status})`),setTimeout(()=>{O(c,"idle")},3e3))}catch(z){O(c,"error"),z instanceof Error?z.message.includes("fetch")?O(u,"Cannot connect to server - check if server is running"):O(u,z.message,!0):O(u,"Connection error - please try again"),setTimeout(()=>{O(c,"idle")},3e3)}}}function p(z){z.key==="Enter"&&f()}var m=Gre(),y=te(m),v=te(y),x=te(v),S=te(x);Th(S,{class:"h-8 w-8 text-destructive"}),Q(x);var A=ae(x,4),C=te(A,!0);Q(A),Q(v);var k=ae(v,2);{var I=z=>{var Z=Nre(),q=te(Z);Qr(q,{onclick:d,variant:"outline",class:"w-full",children:(re,X)=>{var ie=Ore(),P=F(ie);HR(P,{class:"h-4 w-4"}),Rt(),_(re,ie)},$$slots:{default:!0}}),Q(Z),xi(1,Z,()=>uo,()=>({y:10,duration:300,delay:200})),_(z,Z)};ce(k,z=>{g(s)&&!g(l)&&z(I)})}var R=ae(k,2);{var U=z=>{var Z=Ure(),q=te(Z),re=te(q);ed(re,{for:"api-key-input",class:"text-sm font-medium",children:(Ve,We)=>{Rt();var Qe=sr("API Key");_(Ve,Qe)},$$slots:{default:!0}});var X=ae(re,2),ie=te(X);{let Ve=j(()=>g(c)==="error"?"border-destructive":g(c)==="success"?"border-green-500":""),We=j(()=>g(c)==="validating");td(ie,{id:"api-key-input",placeholder:"Enter your API key...",onkeydown:p,get class(){return`w-full pr-10 ${g(Ve)??""}`},get disabled(){return g(We)},get value(){return g(o)},set value(Qe){O(o,Qe,!0)}})}var P=ae(ie,2);{var be=Ve=>{var We=Rre(),Qe=te(We);eu(Qe,{class:"h-4 w-4 animate-spin text-muted-foreground"}),Q(We),_(Ve,We)},_e=Ve=>{var We=J(),Qe=F(We);{var mt=ze=>{var Ge=Pre(),ot=te(Ge);FR(ot,{class:"h-4 w-4 text-green-500"}),Q(Ge),xi(1,Ge,()=>W7,()=>({duration:200,start:.8})),_(ze,Ge)},Ke=ze=>{var Ge=J(),ot=F(Ge);{var lt=ct=>{var Ct=Fre(),St=te(Ct);DR(St,{class:"h-4 w-4 text-destructive"}),Q(Ct),xi(1,Ct,()=>W7,()=>({duration:200,start:.8})),_(ct,Ct)};ce(ot,ct=>{g(c)==="error"&&ct(lt)},!0)}_(ze,Ge)};ce(Qe,ze=>{g(c)==="success"?ze(mt):ze(Ke,!1)},!0)}_(Ve,We)};ce(P,Ve=>{g(c)==="validating"?Ve(be):Ve(_e,!1)})}Q(X);var W=ae(X,2);{var me=Ve=>{var We=Dre(),Qe=te(We,!0);Q(We),qe(()=>at(Qe,g(u))),xi(1,We,()=>uo,()=>({y:-10,duration:200})),_(Ve,We)};ce(W,Ve=>{g(u)&&Ve(me)})}var He=ae(W,2);{var Xe=Ve=>{var We=Lre();xi(1,We,()=>uo,()=>({y:-10,duration:200})),_(Ve,We)};ce(He,Ve=>{g(c)==="success"&&Ve(Xe)})}Q(q);var Le=ae(q,2),bt=te(Le);{let Ve=j(()=>!g(o).trim()||g(c)==="validating"||g(c)==="success");Qr(bt,{onclick:f,get disabled(){return g(Ve)},class:"flex-1",children:(We,Qe)=>{var mt=J(),Ke=F(mt);{var ze=ot=>{var lt=Bre(),ct=F(lt);eu(ct,{class:"h-4 w-4 animate-spin"}),Rt(),_(ot,lt)},Ge=ot=>{var lt=J(),ct=F(lt);{var Ct=Ze=>{var nt=sr("Success!");_(Ze,nt)},St=Ze=>{var nt=sr("Save & Retry");_(Ze,nt)};ce(ct,Ze=>{g(c)==="success"?Ze(Ct):Ze(St,!1)},!0)}_(ot,lt)};ce(Ke,ot=>{g(c)==="validating"?ot(ze):ot(Ge,!1)})}_(We,mt)},$$slots:{default:!0}})}var Ie=ae(bt,2);{let Ve=j(()=>g(c)==="validating");Qr(Ie,{onclick:()=>{O(l,!1),O(c,"idle"),O(u,"")},variant:"outline",class:"flex-1",get disabled(){return g(Ve)},children:(We,Qe)=>{Rt();var mt=sr("Cancel");_(We,mt)},$$slots:{default:!0}})}Q(Le),Q(Z),xi(1,Z,()=>uo,()=>({y:10,duration:300,delay:200})),_(z,Z)};ce(R,z=>{g(l)&&z(U)})}var D=ae(R,2);{var $=z=>{var Z=Hre(),q=te(Z);Qr(q,{onclick:h,get disabled(){return g(a)},class:"w-full",children:(re,X)=>{var ie=J(),P=F(ie);{var be=W=>{var me=zre(),He=F(me);eu(He,{class:"h-4 w-4 animate-spin"}),Rt(),_(W,me)},_e=W=>{var me=jre(),He=F(me);eu(He,{class:"h-4 w-4"}),Rt(),_(W,me)};ce(P,W=>{g(a)?W(be):W(_e,!1)})}_(re,ie)},$$slots:{default:!0}}),Q(Z),xi(1,Z,()=>uo,()=>({y:10,duration:300,delay:200})),_(z,Z)};ce(D,z=>{n()&&z($)})}var H=ae(D,2);{var V=z=>{var Z=qre();xi(1,Z,()=>uo,()=>({y:10,duration:300,delay:400})),_(z,Z)};ce(H,z=>{i()&&z(V)})}Q(y),Q(m),qe(()=>{tr(m,1,`flex h-full items-center justify-center ${t()??""}`),at(C,e.error)}),xi(1,v,()=>Pf,()=>({duration:300})),_(r,m),pe()}var Wre=ee('<div><div class="text-center"><div class="mb-4"><div class="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-muted"><!></div> <h2 class="mb-2 text-xl font-semibold">Connecting to Server</h2> <p class="text-sm text-muted-foreground"> </p></div> <div class="mt-4"><!></div></div></div>');function Vre(r,e){let t=L(e,"class",3,""),n=L(e,"message",3,"Initializing connection to llama.cpp server...");var i=Wre(),a=te(i),s=te(a),o=te(s),l=te(o);h2(l,{class:"h-8 w-8 animate-pulse text-muted-foreground"}),Q(o);var c=ae(o,4),u=te(c,!0);Q(c),Q(s);var h=ae(s,2),d=te(h);Mre(d,{class:"justify-center"}),Q(h),Q(a),Q(i),qe(()=>{tr(i,1,`flex h-full items-center justify-center ${t()??""}`),at(u,n())}),xi(1,s,()=>Pf,()=>({duration:300})),_(r,i)}var Xre=ee('<!> <span class="block max-w-[50vw] truncate"> </span>',1),$re=ee("<!> ",1),Kre=ee('<div class="flex flex-wrap items-center justify-center gap-4 text-sm text-muted-foreground"><!> <div class="flex gap-4"><!> <!></div></div>');function Yre(r,e){ge(e,!0);let t=j(()=>Kn.supportedModalities),n=j(()=>Kn.modelName),i=j(()=>Kn.serverProps);var a=J(),s=F(a);{var o=l=>{var c=Kre(),u=te(c);{var h=v=>{mu(v,{variant:"outline",class:"text-xs",children:(x,S)=>{var A=Xre(),C=F(A);h2(C,{class:"mr-1 h-3 w-3"});var k=ae(C,2),I=te(k,!0);Q(k),qe(()=>at(I,g(n))),_(x,A)},$$slots:{default:!0}})};ce(u,v=>{g(n)&&v(h)})}var d=ae(u,2),f=te(d);{var p=v=>{mu(v,{variant:"secondary",class:"text-xs",children:(x,S)=>{Rt();var A=sr();qe(C=>at(A,`ctx: ${C??""}`),[()=>g(i).default_generation_settings.n_ctx.toLocaleString()]),_(x,A)},$$slots:{default:!0}})};ce(f,v=>{g(i).default_generation_settings.n_ctx&&v(p)})}var m=ae(f,2);{var y=v=>{var x=J(),S=F(x);_n(S,16,()=>g(t),A=>A,(A,C)=>{mu(A,{variant:"secondary",class:"text-xs",children:(k,I)=>{var R=$re(),U=F(R);{var D=V=>{F6(V,{class:"mr-1 h-3 w-3"})},$=V=>{var z=J(),Z=F(z);{var q=re=>{B6(re,{class:"mr-1 h-3 w-3"})};ce(Z,re=>{C==="audio"&&re(q)},!0)}_(V,z)};ce(U,V=>{C==="vision"?V(D):V($,!1)})}var H=ae(U);qe(()=>at(H,` ${C??""}`)),_(k,R)},$$slots:{default:!0}})}),_(v,x)};ce(m,v=>{g(t).length>0&&v(y)})}Q(d),Q(c),_(l,c)};ce(s,l=>{g(i)&&l(o)})}_(r,a),pe()}var Jre=ee("<p> </p>"),Qre=ee("<!> <!>",1);function P1(r,e){let t=L(e,"variant",3,"ghost"),n=L(e,"size",3,"sm"),i=L(e,"class",3,""),a=L(e,"disabled",3,!1);var s=J(),o=F(s);ve(o,()=>oo,(l,c)=>{c(l,{get delayDuration(){return fu},children:(u,h)=>{var d=Qre(),f=F(d);ve(f,()=>ao,(m,y)=>{y(m,{children:(v,x)=>{{let S=j(()=>e["aria-label"]||e.tooltip);Qr(v,{get variant(){return t()},get size(){return n()},get disabled(){return a()},get onclick(){return e.onclick},get class(){return`h-6 w-6 p-0 ${i()??""} flex`},get"aria-label"(){return g(S)},children:(A,C)=>{var k=J();const I=j(()=>e.icon);var R=F(k);ve(R,()=>g(I),(U,D)=>{D(U,{class:"h-3 w-3"})}),_(A,k)},$$slots:{default:!0}})}},$$slots:{default:!0}})});var p=ae(f,2);ve(p,()=>so,(m,y)=>{y(m,{children:(v,x)=>{var S=Jre(),A=te(S,!0);Q(S),qe(()=>at(A,e.tooltip)),_(v,S)},$$slots:{default:!0}})}),_(u,d)},$$slots:{default:!0}})}),_(r,s)}const m5=(r,e=Re,t=Re)=>{var n=J(),i=F(n);ve(i,e,(a,s)=>{s(a,{get class(){return t()}})}),_(r,n)};var Zre=ee('<!> <span class="sr-only"> </span>',1),ene=ee("<p> </p>"),tne=ee("<!> <!>",1),rne=ee('<div class="flex items-center gap-2"><!> </div> <!>',1),nne=ee("<!> <!>",1),ine=ee("<!> <!>",1);function ane(r,e){ge(e,!0);let t=L(e,"triggerClass",3,""),n=L(e,"align",3,"end"),i=L(e,"open",15,!1);var a=J(),s=F(a);ve(s,()=>y7,(o,l)=>{l(o,{get open(){return i()},set open(c){i(c)},children:(c,u)=>{var h=ine(),d=F(h);ve(d,()=>v7,(p,m)=>{m(p,{get class(){return`flex h-6 w-6 cursor-pointer items-center justify-center rounded-md p-0 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground ${t()??""}`},onclick:y=>y.stopPropagation(),children:(y,v)=>{var x=J(),S=F(x);{var A=k=>{var I=J(),R=F(I);ve(R,()=>oo,(U,D)=>{D(U,{get delayDuration(){return fu},children:($,H)=>{var V=tne(),z=F(V);ve(z,()=>ao,(q,re)=>{re(q,{children:(X,ie)=>{var P=Zre(),be=F(P);m5(be,()=>e.triggerIcon,()=>"h-3 w-3");var _e=ae(be,2),W=te(_e,!0);Q(_e),qe(()=>at(W,e.triggerTooltip)),_(X,P)},$$slots:{default:!0}})});var Z=ae(z,2);ve(Z,()=>so,(q,re)=>{re(q,{children:(X,ie)=>{var P=ene(),be=te(P,!0);Q(P),qe(()=>at(be,e.triggerTooltip)),_(X,P)},$$slots:{default:!0}})}),_($,V)},$$slots:{default:!0}})}),_(k,I)},C=k=>{m5(k,()=>e.triggerIcon,()=>"h-3 w-3")};ce(S,k=>{e.triggerTooltip?k(A):k(C,!1)})}_(y,x)},$$slots:{default:!0}})});var f=ae(d,2);ve(f,()=>b7,(p,m)=>{m(p,{get align(){return n()},class:"z-[999999] w-48",children:(y,v)=>{var x=J(),S=F(x);_n(S,19,()=>e.actions,A=>A.label,(A,C,k)=>{var I=nne(),R=F(I);{var U=$=>{var H=J(),V=F(H);ve(V,()=>ZL,(z,Z)=>{Z(z,{})}),_($,H)};ce(R,$=>{g(C).separator&&g(k)>0&&$(U)})}var D=ae(R,2);ve(D,()=>Jh,($,H)=>{H($,{get onclick(){return g(C).onclick},get variant(){return g(C).variant},get disabled(){return g(C).disabled},class:"flex items-center justify-between hover:[&>kbd]:opacity-100",children:(V,z)=>{var Z=rne(),q=F(Z),re=te(q);m5(re,()=>g(C).icon,()=>`h-4 w-4 ${g(C).variant==="destructive"?"text-destructive":""}`);var X=ae(re);Q(q);var ie=ae(q,2);{var P=be=>{Ab(be,{get keys(){return g(C).shortcut},get variant(){return g(C).variant}})};ce(ie,be=>{g(C).shortcut&&be(P)})}qe(()=>at(X,` ${g(C).label??""}`)),_(V,Z)},$$slots:{default:!0}})}),_(A,I)}),_(y,x)},$$slots:{default:!0}})}),_(c,h)},$$slots:{default:!0}})}),_(r,a),pe()}var sne=ee("<!> ",1),one=ee("<!> <!>",1),lne=ee("<!> <!>",1),cne=ee("<!> <!>",1);function b5(r,e){ge(e,!0);let t=L(e,"confirmText",3,"Confirm"),n=L(e,"cancelText",3,"Cancel"),i=L(e,"variant",3,"default");function a(c){c.key==="Enter"&&(c.preventDefault(),e.onConfirm()),e.onKeydown?.(c)}function s(c){c||e.onCancel()}var o=J(),l=F(o);ve(l,()=>tc,(c,u)=>{u(c,{get open(){return e.open},onOpenChange:s,children:(h,d)=>{var f=J(),p=F(f);ve(p,()=>Zl,(m,y)=>{y(m,{onkeydown:a,children:(v,x)=>{var S=cne(),A=F(S);ve(A,()=>Ql,(k,I)=>{I(k,{children:(R,U)=>{var D=one(),$=F(D);ve($,()=>Yl,(V,z)=>{z(V,{class:"flex items-center gap-2",children:(Z,q)=>{var re=sne(),X=F(re);{var ie=be=>{var _e=J();const W=j(()=>e.icon);var me=F(_e);{let He=j(()=>i()==="destructive"?"text-destructive":"");ve(me,()=>g(W),(Xe,Le)=>{Le(Xe,{get class(){return`h-5 w-5 ${g(He)??""}`}})})}_(be,_e)};ce(X,be=>{e.icon&&be(ie)})}var P=ae(X);qe(()=>at(P,` ${e.title??""}`)),_(Z,re)},$$slots:{default:!0}})});var H=ae($,2);ve(H,()=>ec,(V,z)=>{z(V,{children:(Z,q)=>{Rt();var re=sr();qe(()=>at(re,e.description)),_(Z,re)},$$slots:{default:!0}})}),_(R,D)},$$slots:{default:!0}})});var C=ae(A,2);ve(C,()=>Jl,(k,I)=>{I(k,{children:(R,U)=>{var D=lne(),$=F(D);ve($,()=>gb,(V,z)=>{z(V,{get onclick(){return e.onCancel},children:(Z,q)=>{Rt();var re=sr();qe(()=>at(re,n())),_(Z,re)},$$slots:{default:!0}})});var H=ae($,2);{let V=j(()=>i()==="destructive"?"bg-destructive text-white hover:bg-destructive/80":"");ve(H,()=>pu,(z,Z)=>{Z(z,{get onclick(){return e.onConfirm},get class(){return g(V)},children:(q,re)=>{Rt();var X=sr();qe(()=>at(X,t())),_(q,X)},$$slots:{default:!0}})})}_(R,D)},$$slots:{default:!0}})}),_(v,S)},$$slots:{default:!0}})}),_(h,f)},$$slots:{default:!0}})}),_(r,o),pe()}var une=ee('<div class="flex h-screen w-full"><!> <!> <!></div>'),hne=ee("<!> <!> <!> <!>",1);function dne(r,e){ge(e,!0);let t=j(()=>us.route.id==="/chat/[id]"),n=j(()=>us.route.id==="/"),i=j(()=>us.url.searchParams.get("new_chat")==="true"),a=j(()=>Zh().length>0||Kl()),s=oe(!1),o=oe(void 0),l=oe(void 0),c=oe(!1),u=oe(""),h=oe(""),d=null;function f(C){const k=C.ctrlKey||C.metaKey;k&&C.key==="k"&&(C.preventDefault(),g(l)?.activateSearchMode&&(g(l).activateSearchMode(),O(s,!0))),k&&C.shiftKey&&C.key==="o"&&(C.preventDefault(),Do("?new_chat=true#/")),C.shiftKey&&k&&C.key==="e"&&(C.preventDefault(),g(l)?.editActiveConversation&&g(l).editActiveConversation())}function p(){O(c,!1),d&&(d(!1),d=null)}function m(){O(c,!1),d&&(d(!0),d=null)}Ft(()=>{g(n)&&!g(i)?O(s,!1):g(n)&&g(i)||g(t)?O(s,!0):O(s,g(a),!0)}),Ft(()=>{Kn.fetchServerProps()}),Ft(()=>{Kn.serverProps?.default_generation_settings?.params&&nn.syncWithServerDefaults()}),Ft(()=>{const C=fn().apiKey;if((us.route.id==="/"||us.route.id==="/chat/[id]")&&us.status!==401&&us.status!==403){const k={"Content-Type":"application/json"};C&&C.trim()!==""&&(k.Authorization=`Bearer ${C.trim()}`),fetch("./props",{headers:k}).then(I=>{(I.status===401||I.status===403)&&window.location.reload()}).catch(I=>{console.error("Error checking API key:",I)})}}),Ft(()=>{j7(async(C,k)=>new Promise(I=>{O(u,C,!0),O(h,k,!0),d=I,O(c,!0)}))});var y=hne();Rn("keydown",Tl,f);var v=F(y);OH(v,{});var x=ae(v,2);tz(x,{richColors:!0});var S=ae(x,2);$G(S,{get currentTitle(){return g(u)},get newTitle(){return g(h)},onConfirm:m,onCancel:p,get open(){return g(c)},set open(C){O(c,C,!0)}});var A=ae(S,2);ve(A,()=>Yq,(C,k)=>{k(C,{get open(){return g(s)},set open(I){O(s,I,!0)},children:(I,R)=>{var U=une();let D;var $=te(U);ve($,()=>gG,(z,Z)=>{Z(z,{class:"h-full",children:(q,re)=>{Tr(MG(q,{}),X=>O(l,X,!0),()=>g(l))},$$slots:{default:!0}})});var H=ae($,2);{let z=j(()=>g(s)?"md:left-[var(--sidebar-width)]":"");ve(H,()=>Qq,(Z,q)=>{q(Z,{get class(){return`transition-left absolute left-0 z-[900] h-8 w-8 duration-200 ease-linear ${g(z)??""}`},style:"translate: 1rem 1rem;"})})}var V=ae(H,2);ve(V,()=>Gq,(z,Z)=>{Z(z,{class:"flex flex-1 flex-col overflow-hidden",children:(q,re)=>{var X=J(),ie=F(X);Te(ie,()=>e.children??Re),_(q,X)},$$slots:{default:!0}})}),Q(U),qe(z=>D=Ol(U,"",D,z),[()=>({height:`${g(o)??""}px`})]),_(I,U)},$$slots:{default:!0}})}),W_("innerHeight",C=>O(o,C,!0)),_(r,y),pe()}const fne=Object.freeze(Object.defineProperty({__proto__:null,component:dne},Symbol.toStringTag,{value:"Module"})),gne=()=>{const r=cs;return{page:{subscribe:r.page.subscribe},navigating:{subscribe:r.navigating.subscribe},updated:r.updated}},pne={subscribe(r){return gne().page.subscribe(r)}};var mne=()=>Do("#/"),bne=ee('<div class="flex h-full items-center justify-center"><div class="w-full max-w-md px-4 text-center"><div class="mb-6"><div class="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10"><svg class="h-8 w-8 text-destructive" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"></path></svg></div> <h1 class="mb-2 text-2xl font-bold"> </h1> <p class="text-muted-foreground"> </p></div> <button class="rounded-md bg-primary px-4 py-2 text-primary-foreground hover:bg-primary/90">Go Home</button></div></div>');function vne(r,e){ge(e,!0);const[t,n]=K_(),i=()=>$_(pne,"$page",t);let a=j(()=>i().error),s=j(()=>i().status),o=j(()=>g(s)===401||g(s)===403||g(a)?.message?.toLowerCase().includes("access denied")||g(a)?.message?.toLowerCase().includes("unauthorized")||g(a)?.message?.toLowerCase().includes("invalid api key"));function l(){Do("#/")}var c=J();t0(f=>{qe(()=>Tc.title=`Error ${g(s)??""} - WebUI`)});var u=F(c);{var h=f=>{{let p=j(()=>g(a)?.message||"Access denied - check server permissions");qk(f,{get error(){return g(p)},onRetry:l,showRetry:!1,showTroubleshooting:!1})}},d=f=>{var p=bne(),m=te(p),y=te(m),v=ae(te(y),2),x=te(v);Q(v);var S=ae(v,2),A=te(S,!0);Q(S),Q(y);var C=ae(y,2);C.__click=[mne],Q(m),Q(p),qe(()=>{at(x,`Error ${g(s)??""}`),at(A,g(a)?.message||"Something went wrong")}),_(f,p)};ce(u,f=>{g(o)?f(h):f(d,!1)})}_(r,c),pe(),n()}wi(["click"]);const yne=Object.freeze(Object.defineProperty({__proto__:null,component:vne},Symbol.toStringTag,{value:"Module"}));function wne(r,e){throw new Ju(r,e)}async function Gk(r){try{const e=fn().apiKey,t={"Content-Type":"application/json"};e&&(t.Authorization=`Bearer ${e}`);const n=await r("./props",{headers:t});if(!n.ok){if(n.status===401||n.status===403)throw wne(401,"Access denied");console.warn(`Server responded with status ${n.status} during API key validation`);return}}catch(e){if(e&&typeof e=="object"&&"status"in e)throw e;console.warn("Cannot connect to server for API key validation:",e)}}const xne=Object.freeze(Object.defineProperty({__proto__:null,load:async({fetch:r})=>{await Gk(r)}},Symbol.toStringTag,{value:"Module"}));function Sne(r,e){ge(e,!0);let t=j(()=>us.url.searchParams.get("q"));Si(async()=>{I7||await fr.initialize(),fr.clearActiveConversation(),g(t)!==null&&(await fr.createConversation(),await fr.sendMessage(g(t)))}),t0(n=>{Tc.title="llama.cpp - AI Chat Interface"}),i8(r,{showCenteredEmpty:!0}),pe()}const kne=Object.freeze(Object.defineProperty({__proto__:null,component:Sne,universal:xne},Symbol.toStringTag,{value:"Module"})),Ane=Object.freeze(Object.defineProperty({__proto__:null,load:async({fetch:r})=>{await Gk(r)}},Symbol.toStringTag,{value:"Module"}));function _ne(r,e){ge(e,!0);let t=j(()=>us.params.id),n;Ft(()=>{if(g(t)&&g(t)!==n){if(n=g(t),co()?.id===g(t))return;(async()=>await fr.loadConversation(g(t))||await Do("#/"))()}}),Ft(()=>{if(typeof window<"u"){const i=()=>{Kl()&&(console.log("Page unload detected while streaming - aborting stream"),Rf())};return window.addEventListener("beforeunload",i),()=>{window.removeEventListener("beforeunload",i)}}}),t0(i=>{qe(a=>Tc.title=`${a??""} - llama.cpp`,[()=>co()?.name||"Chat"])}),i8(r,{}),pe()}const Cne=Object.freeze(Object.defineProperty({__proto__:null,component:_ne,universal:Ane},Symbol.toStringTag,{value:"Module"})),Ene=Object.freeze(Object.defineProperty({__proto__:null,default:'/**\n * @licstart The following is the entire license notice for the\n * JavaScript code in this page\n *\n * Copyright 2024 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @licend The above is the entire license notice for the\n * JavaScript code in this page\n */\n/**\n * pdfjsVersion = 5.4.54\n * pdfjsBuild = 295fb3ec4\n */\nconst e=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),t=[.001,0,0,.001,0,0],a=1.35,r=.35,i=.25925925925925924,n=1,s=2,o=4,c=8,l=16,h=64,u=128,d=256,f="pdfjs_internal_editor_",g=3,p=9,m=13,b=15,y=101,w={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},x=0,S=4,k=1,C=2,v=3,F=1,T=2,O=3,M=4,D=5,R=6,N=7,E=8,L=9,j=10,_=11,U=12,X=13,q=14,H=15,W=16,z=17,$=20,G="Group",V="R",K=1,J=2,Y=4,Z=16,Q=32,ee=128,te=512,ae=1,re=2,ie=4096,ne=8192,se=32768,oe=65536,ce=131072,le=1048576,he=2097152,ue=8388608,de=16777216,fe=1,ge=2,pe=3,me=4,be=5,ye={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},we={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},xe={O:"PageOpen",C:"PageClose"},Se=1,Ae=5,ke=1,Ce=2,ve=3,Fe=4,Ie=5,Te=6,Oe=7,Me=8,De=9,Be=10,Re=11,Ne=12,Ee=13,Pe=14,Le=15,je=16,_e=17,Ue=18,Xe=19,qe=20,He=21,We=22,ze=23,$e=24,Ge=25,Ve=26,Ke=27,Je=28,Ye=29,Ze=30,Qe=31,et=32,tt=33,at=34,rt=35,it=36,nt=37,st=38,ot=39,ct=40,lt=41,ht=42,ut=43,dt=44,ft=45,gt=46,pt=47,mt=48,bt=49,yt=50,wt=51,xt=52,St=53,At=54,kt=55,Ct=56,vt=57,Ft=58,It=59,Tt=60,Ot=61,Mt=62,Dt=63,Bt=64,Rt=65,Nt=66,Et=67,Pt=68,Lt=69,jt=70,_t=71,Ut=72,Xt=73,qt=74,Ht=75,Wt=76,zt=77,$t=80,Gt=81,Vt=83,Kt=84,Jt=85,Yt=86,Zt=87,Qt=88,ea=89,ta=90,aa=91,ra=92,ia=93,na=94,sa=0,oa=1,ca=2,la=3,ha=1,ua=2;let da=Se;function getVerbosityLevel(){return da}function info(e){da>=Ae&&console.log(`Info: ${e}`)}function warn(e){da>=Se&&console.log(`Warning: ${e}`)}function unreachable(e){throw new Error(e)}function assert(e,t){e||unreachable(t)}function createValidAbsoluteUrl(e,t=null,a=null){if(!e)return null;if(a&&"string"==typeof e){if(a.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\\./g);t?.length>=2&&(e=`http://${e}`)}if(a.tryConvertEncoding)try{e=stringToUTF8String(e)}catch{}}const r=t?URL.parse(e,t):URL.parse(e);return function _isValidProtocol(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r)?r:null}function shadow(e,t,a,r=!1){Object.defineProperty(e,t,{value:a,enumerable:!r,configurable:!0,writable:!1});return a}const fa=function BaseExceptionClosure(){function BaseException(e,t){this.message=e;this.name=t}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();class PasswordException extends fa{constructor(e,t){super(e,"PasswordException");this.code=t}}class UnknownErrorException extends fa{constructor(e,t){super(e,"UnknownErrorException");this.details=t}}class InvalidPDFException extends fa{constructor(e){super(e,"InvalidPDFException")}}class ResponseException extends fa{constructor(e,t,a){super(e,"ResponseException");this.status=t;this.missing=a}}class FormatError extends fa{constructor(e){super(e,"FormatError")}}class AbortException extends fa{constructor(e){super(e,"AbortException")}}function bytesToString(e){"object"==typeof e&&void 0!==e?.length||unreachable("Invalid argument for bytesToString");const t=e.length,a=8192;if(t<a)return String.fromCharCode.apply(null,e);const r=[];for(let i=0;i<t;i+=a){const n=Math.min(i+a,t),s=e.subarray(i,n);r.push(String.fromCharCode.apply(null,s))}return r.join("")}function stringToBytes(e){"string"!=typeof e&&unreachable("Invalid argument for stringToBytes");const t=e.length,a=new Uint8Array(t);for(let r=0;r<t;++r)a[r]=255&e.charCodeAt(r);return a}function string32(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function objectSize(e){return Object.keys(e).length}class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function isLittleEndian(){const e=new Uint8Array(4);e[0]=1;return 1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return shadow(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){const{platform:e,userAgent:t}=navigator;return shadow(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){return shadow(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const ga=Array.from(Array(256).keys(),(e=>e.toString(16).padStart(2,"0")));class Util{static makeHexColor(e,t,a){return`#${ga[e]}${ga[t]}${ga[a]}`}static scaleMinMax(e,t){let a;if(e[0]){if(e[0]<0){a=t[0];t[0]=t[2];t[2]=a}t[0]*=e[0];t[2]*=e[0];if(e[3]<0){a=t[1];t[1]=t[3];t[3]=a}t[1]*=e[3];t[3]*=e[3]}else{a=t[0];t[0]=t[1];t[1]=a;a=t[2];t[2]=t[3];t[3]=a;if(e[1]<0){a=t[1];t[1]=t[3];t[3]=a}t[1]*=e[1];t[3]*=e[1];if(e[2]<0){a=t[0];t[0]=t[2];t[2]=a}t[0]*=e[2];t[2]*=e[2]}t[0]+=e[4];t[1]+=e[5];t[2]+=e[4];t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t,a=0){const r=e[a],i=e[a+1];e[a]=r*t[0]+i*t[2]+t[4];e[a+1]=r*t[1]+i*t[3]+t[5]}static applyTransformToBezier(e,t,a=0){const r=t[0],i=t[1],n=t[2],s=t[3],o=t[4],c=t[5];for(let t=0;t<6;t+=2){const l=e[a+t],h=e[a+t+1];e[a+t]=l*r+h*n+o;e[a+t+1]=l*i+h*s+c}}static applyInverseTransform(e,t){const a=e[0],r=e[1],i=t[0]*t[3]-t[1]*t[2];e[0]=(a*t[3]-r*t[2]+t[2]*t[5]-t[4]*t[3])/i;e[1]=(-a*t[1]+r*t[0]+t[4]*t[1]-t[5]*t[0])/i}static axialAlignedBoundingBox(e,t,a){const r=t[0],i=t[1],n=t[2],s=t[3],o=t[4],c=t[5],l=e[0],h=e[1],u=e[2],d=e[3];let f=r*l+o,g=f,p=r*u+o,m=p,b=s*h+c,y=b,w=s*d+c,x=w;if(0!==i||0!==n){const e=i*l,t=i*u,a=n*h,r=n*d;f+=a;m+=a;p+=r;g+=r;b+=e;x+=e;w+=t;y+=t}a[0]=Math.min(a[0],f,p,g,m);a[1]=Math.min(a[1],b,w,y,x);a[2]=Math.max(a[2],f,p,g,m);a[3]=Math.max(a[3],b,w,y,x)}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){const a=e[0],r=e[1],i=e[2],n=e[3],s=a**2+r**2,o=a*i+r*n,c=i**2+n**2,l=(s+c)/2,h=Math.sqrt(l**2-(s*c-o**2));t[0]=Math.sqrt(l+h||1);t[1]=Math.sqrt(l-h||1)}static normalizeRect(e){const t=e.slice(0);if(e[0]>e[2]){t[0]=e[2];t[2]=e[0]}if(e[1]>e[3]){t[1]=e[3];t[3]=e[1]}return t}static intersect(e,t){const a=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(a>r)return null;const i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),n=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>n?null:[a,i,r,n]}static pointBoundingBox(e,t,a){a[0]=Math.min(a[0],e);a[1]=Math.min(a[1],t);a[2]=Math.max(a[2],e);a[3]=Math.max(a[3],t)}static rectBoundingBox(e,t,a,r,i){i[0]=Math.min(i[0],e,a);i[1]=Math.min(i[1],t,r);i[2]=Math.max(i[2],e,a);i[3]=Math.max(i[3],t,r)}static#e(e,t,a,r,i,n,s,o,c,l){if(c<=0||c>=1)return;const h=1-c,u=c*c,d=u*c,f=h*(h*(h*e+3*c*t)+3*u*a)+d*r,g=h*(h*(h*i+3*c*n)+3*u*s)+d*o;l[0]=Math.min(l[0],f);l[1]=Math.min(l[1],g);l[2]=Math.max(l[2],f);l[3]=Math.max(l[3],g)}static#t(e,t,a,r,i,n,s,o,c,l,h,u){if(Math.abs(c)<1e-12){Math.abs(l)>=1e-12&&this.#e(e,t,a,r,i,n,s,o,-h/l,u);return}const d=l**2-4*h*c;if(d<0)return;const f=Math.sqrt(d),g=2*c;this.#e(e,t,a,r,i,n,s,o,(-l+f)/g,u);this.#e(e,t,a,r,i,n,s,o,(-l-f)/g,u)}static bezierBoundingBox(e,t,a,r,i,n,s,o,c){c[0]=Math.min(c[0],e,s);c[1]=Math.min(c[1],t,o);c[2]=Math.max(c[2],e,s);c[3]=Math.max(c[3],t,o);this.#t(e,a,i,s,t,r,n,o,3*(3*(a-i)-e+s),6*(e-2*a+i),3*(a-e),c);this.#t(e,a,i,s,t,r,n,o,3*(3*(r-n)-t+o),6*(t-2*r+n),3*(r-t),c)}}const pa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToPDFString(e,t=!1){if(e[0]>="ï"){let a;if("þ"===e[0]&&"ÿ"===e[1]){a="utf-16be";e.length%2==1&&(e=e.slice(0,-1))}else if("ÿ"===e[0]&&"þ"===e[1]){a="utf-16le";e.length%2==1&&(e=e.slice(0,-1))}else"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(a="utf-8");if(a)try{const r=new TextDecoder(a,{fatal:!0}),i=stringToBytes(e),n=r.decode(i);return t||!n.includes("\x1B")?n:n.replaceAll(/\\x1b[^\\x1b]*(?:\\x1b|$)/g,"")}catch(e){warn(`stringToPDFString: "${e}".`)}}const a=[];for(let r=0,i=e.length;r<i;r++){const n=e.charCodeAt(r);if(!t&&27===n){for(;++r<i&&27!==e.charCodeAt(r););continue}const s=pa[n];a.push(s?String.fromCharCode(s):e.charAt(r))}return a.join("")}function stringToUTF8String(e){return decodeURIComponent(escape(e))}function utf8StringToString(e){return unescape(encodeURIComponent(e))}function isArrayEqual(e,t){if(e.length!==t.length)return!1;for(let a=0,r=e.length;a<r;a++)if(e[a]!==t[a])return!1;return!0}function getModificationDate(e=new Date){e instanceof Date||(e=new Date(e));return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")}let ma=null,ba=null;function MathClamp(e,t,a){return Math.min(Math.max(e,t),a)}function toHexUtil(e){return Uint8Array.prototype.toHex?e.toHex():Array.from(e,(e=>ga[e])).join("")}"function"!=typeof Promise.try&&(Promise.try=function(e,...t){return new Promise((a=>{a(e(...t))}))});"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(e){return e.reduce(((e,t)=>e+t),0)});const ya=Symbol("CIRCULAR_REF"),wa=Symbol("EOF");let xa=Object.create(null),Sa=Object.create(null),Aa=Object.create(null);class Name{constructor(e){this.name=e}static get(e){return Sa[e]||=new Name(e)}}class Cmd{constructor(e){this.cmd=e}static get(e){return xa[e]||=new Cmd(e)}}const ka=function nonSerializableClosure(){return ka};class Dict{constructor(e=null){this._map=new Map;this.xref=e;this.objId=null;this.suppressEncryption=!1;this.__nonSerializable__=ka}assignXref(e){this.xref=e}get size(){return this._map.size}get(e,t,a){let r=this._map.get(e);if(void 0===r&&void 0!==t){r=this._map.get(t);void 0===r&&void 0!==a&&(r=this._map.get(a))}return r instanceof Ref&&this.xref?this.xref.fetch(r,this.suppressEncryption):r}async getAsync(e,t,a){let r=this._map.get(e);if(void 0===r&&void 0!==t){r=this._map.get(t);void 0===r&&void 0!==a&&(r=this._map.get(a))}return r instanceof Ref&&this.xref?this.xref.fetchAsync(r,this.suppressEncryption):r}getArray(e,t,a){let r=this._map.get(e);if(void 0===r&&void 0!==t){r=this._map.get(t);void 0===r&&void 0!==a&&(r=this._map.get(a))}r instanceof Ref&&this.xref&&(r=this.xref.fetch(r,this.suppressEncryption));if(Array.isArray(r)){r=r.slice();for(let e=0,t=r.length;e<t;e++)r[e]instanceof Ref&&this.xref&&(r[e]=this.xref.fetch(r[e],this.suppressEncryption))}return r}getRaw(e){return this._map.get(e)}getKeys(){return[...this._map.keys()]}getRawValues(){return[...this._map.values()]}set(e,t){this._map.set(e,t)}setIfNotExists(e,t){this.has(e)||this.set(e,t)}setIfNumber(e,t){"number"==typeof t&&this.set(e,t)}setIfArray(e,t){(Array.isArray(t)||ArrayBuffer.isView(t))&&this.set(e,t)}setIfDefined(e,t){null!=t&&this.set(e,t)}setIfName(e,t){"string"==typeof t?this.set(e,Name.get(t)):t instanceof Name&&this.set(e,t)}has(e){return this._map.has(e)}*[Symbol.iterator](){for(const[e,t]of this._map)yield[e,t instanceof Ref&&this.xref?this.xref.fetch(t,this.suppressEncryption):t]}static get empty(){const e=new Dict(null);e.set=(e,t)=>{unreachable("Should not call `set` on the empty dictionary.")};return shadow(this,"empty",e)}static merge({xref:e,dictArray:t,mergeSubDicts:a=!1}){const r=new Dict(e),i=new Map;for(const e of t)if(e instanceof Dict)for(const[t,r]of e._map){let e=i.get(t);if(void 0===e){e=[];i.set(t,e)}else if(!(a&&r instanceof Dict))continue;e.push(r)}for(const[t,a]of i){if(1===a.length||!(a[0]instanceof Dict)){r._map.set(t,a[0]);continue}const i=new Dict(e);for(const e of a)for(const[t,a]of e._map)i._map.has(t)||i._map.set(t,a);i.size>0&&r._map.set(t,i)}i.clear();return r.size>0?r:Dict.empty}clone(){const e=new Dict(this.xref);for(const t of this.getKeys())e.set(t,this.getRaw(t));return e}delete(e){delete this._map[e]}}class Ref{constructor(e,t){this.num=e;this.gen=t}toString(){return 0===this.gen?`${this.num}R`:`${this.num}R${this.gen}`}static fromString(e){const t=Aa[e];if(t)return t;const a=/^(\\d+)R(\\d*)$/.exec(e);return a&&"0"!==a[1]?Aa[e]=new Ref(parseInt(a[1]),a[2]?parseInt(a[2]):0):null}static get(e,t){const a=0===t?`${e}R`:`${e}R${t}`;return Aa[a]||=new Ref(e,t)}}class RefSet{constructor(e=null){this._set=new Set(e?._set)}has(e){return this._set.has(e.toString())}put(e){this._set.add(e.toString())}remove(e){this._set.delete(e.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}class RefSetCache{constructor(){this._map=new Map}get size(){return this._map.size}get(e){return this._map.get(e.toString())}has(e){return this._map.has(e.toString())}put(e,t){this._map.set(e.toString(),t)}putAlias(e,t){this._map.set(e.toString(),this.get(t))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}*values(){yield*this._map.values()}*items(){for(const[e,t]of this._map)yield[Ref.fromString(e),t]}}function isName(e,t){return e instanceof Name&&(void 0===t||e.name===t)}function isCmd(e,t){return e instanceof Cmd&&(void 0===t||e.cmd===t)}function isDict(e,t){return e instanceof Dict&&(void 0===t||isName(e.get("Type"),t))}function isRefsEqual(e,t){return e.num===t.num&&e.gen===t.gen}class BaseStream{get length(){unreachable("Abstract getter `length` accessed")}get isEmpty(){unreachable("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return shadow(this,"isDataLoaded",!0)}getByte(){unreachable("Abstract method `getByte` called")}getBytes(e){unreachable("Abstract method `getBytes` called")}async getImageData(e,t){return this.getBytes(e,t)}async asyncGetBytes(){unreachable("Abstract method `asyncGetBytes` called")}get isAsync(){return!1}get isAsyncDecoder(){return!1}get canAsyncDecodeImageFromBuffer(){return!1}async getTransferableImage(){return null}peekByte(){const e=this.getByte();-1!==e&&this.pos--;return e}peekBytes(e){const t=this.getBytes(e);this.pos-=t.length;return t}getUint16(){const e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getByteRange(e,t){unreachable("Abstract method `getByteRange` called")}getString(e){return bytesToString(this.getBytes(e))}skip(e){this.pos+=e||1}reset(){unreachable("Abstract method `reset` called")}moveStart(){unreachable("Abstract method `moveStart` called")}makeSubStream(e,t,a=null){unreachable("Abstract method `makeSubStream` called")}getBaseStreams(){return null}}const Ca=/^[1-9]\\.\\d$/,va=2**31-1,Fa=[1,0,0,1,0,0],Ia=["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"],Ta=["ExtGState","Font","Properties","XObject"];function getLookupTableFactory(e){let t;return function(){if(e){t=Object.create(null);e(t);e=null}return t}}class MissingDataException extends fa{constructor(e,t){super(`Missing data [${e}, ${t})`,"MissingDataException");this.begin=e;this.end=t}}class ParserEOFException extends fa{constructor(e){super(e,"ParserEOFException")}}class XRefEntryException extends fa{constructor(e){super(e,"XRefEntryException")}}class XRefParseException extends fa{constructor(e){super(e,"XRefParseException")}}function arrayBuffersToBytes(e){const t=e.length;if(0===t)return new Uint8Array(0);if(1===t)return new Uint8Array(e[0]);let a=0;for(let r=0;r<t;r++)a+=e[r].byteLength;const r=new Uint8Array(a);let i=0;for(let a=0;a<t;a++){const t=new Uint8Array(e[a]);r.set(t,i);i+=t.byteLength}return r}async function fetchBinaryData(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch file "${e}" with "${t.statusText}".`);return new Uint8Array(await t.arrayBuffer())}function getInheritableProperty({dict:e,key:t,getArray:a=!1,stopWhenFound:r=!0}){let i;const n=new RefSet;for(;e instanceof Dict&&(!e.objId||!n.has(e.objId));){e.objId&&n.put(e.objId);const s=a?e.getArray(t):e.get(t);if(void 0!==s){if(r)return s;(i||=[]).push(s)}e=e.get("Parent")}return i}const Oa=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function toRomanNumerals(e,t=!1){assert(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const a="M".repeat(e/1e3|0)+Oa[e%1e3/100|0]+Oa[10+(e%100/10|0)]+Oa[20+e%10];return t?a.toLowerCase():a}function log2(e){return e>0?Math.ceil(Math.log2(e)):0}function readInt8(e,t){return e[t]<<24>>24}function readInt16(e,t){return(e[t]<<24|e[t+1]<<16)>>16}function readUint16(e,t){return e[t]<<8|e[t+1]}function readUint32(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function isWhiteSpace(e){return 32===e||9===e||13===e||10===e}function isNumberArray(e,t){return Array.isArray(e)?(null===t||e.length===t)&&e.every((e=>"number"==typeof e)):ArrayBuffer.isView(e)&&!(e instanceof BigInt64Array||e instanceof BigUint64Array)&&(null===t||e.length===t)}function lookupMatrix(e,t){return isNumberArray(e,6)?e:t}function lookupRect(e,t){return isNumberArray(e,4)?e:t}function lookupNormalRect(e,t){return isNumberArray(e,4)?Util.normalizeRect(e):t}function parseXFAPath(e){const t=/(.+)\\[(\\d+)\\]$/;return e.split(".").map((e=>{const a=e.match(t);return a?{name:a[1],pos:parseInt(a[2],10)}:{name:e,pos:0}}))}function escapePDFName(e){const t=[];let a=0;for(let r=0,i=e.length;r<i;r++){const i=e.charCodeAt(r);if(i<33||i>126||35===i||40===i||41===i||60===i||62===i||91===i||93===i||123===i||125===i||47===i||37===i){a<r&&t.push(e.substring(a,r));t.push(`#${i.toString(16)}`);a=r+1}}if(0===t.length)return e;a<e.length&&t.push(e.substring(a,e.length));return t.join("")}function escapeString(e){return e.replaceAll(/([()\\\\\\n\\r])/g,(e=>"\\n"===e?"\\\\n":"\\r"===e?"\\\\r":`\\\\${e}`))}function _collectJS(e,t,a,r){if(!e)return;let i=null;if(e instanceof Ref){if(r.has(e))return;i=e;r.put(i);e=t.fetch(e)}if(Array.isArray(e))for(const i of e)_collectJS(i,t,a,r);else if(e instanceof Dict){if(isName(e.get("S"),"JavaScript")){const t=e.get("JS");let r;t instanceof BaseStream?r=t.getString():"string"==typeof t&&(r=t);r&&=stringToPDFString(r,!0).replaceAll("\\0","");r&&a.push(r.trim())}_collectJS(e.getRaw("Next"),t,a,r)}i&&r.remove(i)}function collectActions(e,t,a){const r=Object.create(null),i=getInheritableProperty({dict:t,key:"AA",stopWhenFound:!1});if(i)for(let t=i.length-1;t>=0;t--){const n=i[t];if(n instanceof Dict)for(const t of n.getKeys()){const i=a[t];if(!i)continue;const s=[];_collectJS(n.getRaw(t),e,s,new RefSet);s.length>0&&(r[i]=s)}}if(t.has("A")){const a=[];_collectJS(t.get("A"),e,a,new RefSet);a.length>0&&(r.Action=a)}return objectSize(r)>0?r:null}const Ma={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"};function*codePointIter(e){for(let t=0,a=e.length;t<a;t++){const a=e.codePointAt(t);a>55295&&(a<57344||a>65533)&&t++;yield a}}function encodeToXmlString(e){const t=[];let a=0;for(let r=0,i=e.length;r<i;r++){const i=e.codePointAt(r);if(32<=i&&i<=126){const n=Ma[i];if(n){a<r&&t.push(e.substring(a,r));t.push(n);a=r+1}}else{a<r&&t.push(e.substring(a,r));t.push(`&#x${i.toString(16).toUpperCase()};`);i>55295&&(i<57344||i>65533)&&r++;a=r+1}}if(0===t.length)return e;a<e.length&&t.push(e.substring(a,e.length));return t.join("")}function validateFontName(e,t=!1){const a=/^("|\').*("|\')$/.exec(e);if(a&&a[1]===a[2]){if(new RegExp(`[^\\\\\\\\]${a[1]}`).test(e.slice(1,-1))){t&&warn(`FontFamily contains unescaped ${a[1]}: ${e}.`);return!1}}else for(const a of e.split(/[ \\t]+/))if(/^(\\d|(-(\\d|-)))/.test(a)||!/^[\\w-\\\\]+$/.test(a)){t&&warn(`FontFamily contains invalid <custom-ident>: ${e}.`);return!1}return!0}function validateCSSFont(e){const t=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:a,fontWeight:r,italicAngle:i}=e;if(!validateFontName(a,!0))return!1;const n=r?r.toString():"";e.fontWeight=t.has(n)?n:"400";const s=parseFloat(i);e.italicAngle=isNaN(s)||s<-90||s>90?"14":i.toString();return!0}function recoverJsURL(e){const t=new RegExp("^\\\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").replaceAll(".","\\\\.")+")\\\\((?:\'|\\")([^\'\\"]*)(?:\'|\\")(?:,\\\\s*(\\\\w+)\\\\)|\\\\))","i").exec(e);return t?.[2]?{url:t[2],newWindow:"app.launchURL"===t[1]&&"true"===t[3]}:null}function numberToString(e){if(Number.isInteger(e))return e.toString();const t=Math.round(100*e);return t%100==0?(t/100).toString():t%10==0?e.toFixed(1):e.toFixed(2)}function getNewAnnotationsMap(e){if(!e)return null;const t=new Map;for(const[a,r]of e){if(!a.startsWith(f))continue;let e=t.get(r.pageIndex);if(!e){e=[];t.set(r.pageIndex,e)}e.push(r)}return t.size>0?t:null}function stringToAsciiOrUTF16BE(e){return null==e||function isAscii(e){if("string"!=typeof e)return!1;return!e||/^[\\x00-\\x7F]*$/.test(e)}(e)?e:stringToUTF16String(e,!0)}function stringToUTF16HexString(e){const t=[];for(let a=0,r=e.length;a<r;a++){const r=e.charCodeAt(a);t.push(ga[r>>8&255],ga[255&r])}return t.join("")}function stringToUTF16String(e,t=!1){const a=[];t&&a.push("þÿ");for(let t=0,r=e.length;t<r;t++){const r=e.charCodeAt(t);a.push(String.fromCharCode(r>>8&255),String.fromCharCode(255&r))}return a.join("")}function getRotationMatrix(e,t,a){switch(e){case 90:return[0,1,-1,0,t,0];case 180:return[-1,0,0,-1,t,a];case 270:return[0,-1,1,0,0,a];default:throw new Error("Invalid rotation")}}function getSizeInBytes(e){return Math.ceil(Math.ceil(Math.log2(1+e))/8)}class QCMS{static#a=null;static _memory=null;static _mustAddAlpha=!1;static _destBuffer=null;static _destOffset=0;static _destLength=0;static _cssColor="";static _makeHexColor=null;static get _memoryArray(){const e=this.#a;return e?.byteLength?e:this.#a=new Uint8Array(this._memory.buffer)}}let Da;const Ba="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&Ba.decode();let Ra=null;function getUint8ArrayMemory0(){null!==Ra&&0!==Ra.byteLength||(Ra=new Uint8Array(Da.memory.buffer));return Ra}let Na=0;function passArray8ToWasm0(e,t){const a=t(1*e.length,1)>>>0;getUint8ArrayMemory0().set(e,a/1);Na=e.length;return a}const Ea=Object.freeze({RGB8:0,0:"RGB8",RGBA8:1,1:"RGBA8",BGRA8:2,2:"BGRA8",Gray8:3,3:"Gray8",GrayA8:4,4:"GrayA8",CMYK:5,5:"CMYK"}),Pa=Object.freeze({Perceptual:0,0:"Perceptual",RelativeColorimetric:1,1:"RelativeColorimetric",Saturation:2,2:"Saturation",AbsoluteColorimetric:3,3:"AbsoluteColorimetric"});function __wbg_get_imports(){const e={wbg:{}};e.wbg.__wbg_copyresult_b08ee7d273f295dd=function(e,t){!function copy_result(e,t){const{_mustAddAlpha:a,_destBuffer:r,_destOffset:i,_destLength:n,_memoryArray:s}=QCMS;if(t!==n)if(a)for(let a=e,n=e+t,o=i;a<n;a+=3,o+=4){r[o]=s[a];r[o+1]=s[a+1];r[o+2]=s[a+2];r[o+3]=255}else for(let a=e,n=e+t,o=i;a<n;a+=3,o+=4){r[o]=s[a];r[o+1]=s[a+1];r[o+2]=s[a+2]}else r.set(s.subarray(e,e+t),i)}(e>>>0,t>>>0)};e.wbg.__wbg_copyrgb_d60ce17bb05d9b67=function(e){!function copy_rgb(e){const{_destBuffer:t,_destOffset:a,_memoryArray:r}=QCMS;t[a]=r[e];t[a+1]=r[e+1];t[a+2]=r[e+2]}(e>>>0)};e.wbg.__wbg_makecssRGB_893bf0cd9fdb302d=function(e){!function make_cssRGB(e){const{_memoryArray:t}=QCMS;QCMS._cssColor=QCMS._makeHexColor(t[e],t[e+1],t[e+2])}(e>>>0)};e.wbg.__wbindgen_init_externref_table=function(){const e=Da.__wbindgen_export_0,t=e.grow(4);e.set(0,void 0);e.set(t+0,void 0);e.set(t+1,null);e.set(t+2,!0);e.set(t+3,!1)};e.wbg.__wbindgen_throw=function(e,t){throw new Error(function getStringFromWasm0(e,t){e>>>=0;return Ba.decode(getUint8ArrayMemory0().subarray(e,e+t))}(e,t))};return e}function __wbg_finalize_init(e,t){Da=e.exports;__wbg_init.__wbindgen_wasm_module=t;Ra=null;Da.__wbindgen_start();return Da}async function __wbg_init(e){if(void 0!==Da)return Da;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module_or_path:e}=e):console.warn("using deprecated parameters for the initialization function; pass a single object instead"));const t=__wbg_get_imports();("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));const{instance:a,module:r}=await async function __wbg_load(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n",t)}const a=await e.arrayBuffer();return await WebAssembly.instantiate(a,t)}{const a=await WebAssembly.instantiate(e,t);return a instanceof WebAssembly.Instance?{instance:a,module:e}:a}}(await e,t);return __wbg_finalize_init(a,r)}class ColorSpace{static#r=new Uint8ClampedArray(3);constructor(e,t){this.name=e;this.numComps=t}getRgb(e,t,a=new Uint8ClampedArray(3)){this.getRgbItem(e,t,a,0);return a}getRgbHex(e,t){const a=this.getRgb(e,t,ColorSpace.#r);return Util.makeHexColor(a[0],a[1],a[2])}getRgbItem(e,t,a,r){unreachable("Should not call ColorSpace.getRgbItem")}getRgbBuffer(e,t,a,r,i,n,s){unreachable("Should not call ColorSpace.getRgbBuffer")}getOutputLength(e,t){unreachable("Should not call ColorSpace.getOutputLength")}isPassthrough(e){return!1}isDefaultDecode(e,t){return ColorSpace.isDefaultDecode(e,this.numComps)}fillRgb(e,t,a,r,i,n,s,o,c){const l=t*a;let h=null;const u=1<<s,d=a!==i||t!==r;if(this.isPassthrough(s))h=o;else if(1===this.numComps&&l>u&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const t=s<=8?new Uint8Array(u):new Uint16Array(u);for(let e=0;e<u;e++)t[e]=e;const a=new Uint8ClampedArray(3*u);this.getRgbBuffer(t,0,u,a,0,s,0);if(d){h=new Uint8Array(3*l);let e=0;for(let t=0;t<l;++t){const r=3*o[t];h[e++]=a[r];h[e++]=a[r+1];h[e++]=a[r+2]}}else{let t=0;for(let r=0;r<l;++r){const i=3*o[r];e[t++]=a[i];e[t++]=a[i+1];e[t++]=a[i+2];t+=c}}}else if(d){h=new Uint8ClampedArray(3*l);this.getRgbBuffer(o,0,l,h,0,s,0)}else this.getRgbBuffer(o,0,r*n,e,0,s,c);if(h)if(d)!function resizeRgbImage(e,t,a,r,i,n,s){s=1!==s?0:s;const o=a/i,c=r/n;let l,h=0;const u=new Uint16Array(i),d=3*a;for(let e=0;e<i;e++)u[e]=3*Math.floor(e*o);for(let a=0;a<n;a++){const r=Math.floor(a*c)*d;for(let a=0;a<i;a++){l=r+u[a];t[h++]=e[l++];t[h++]=e[l++];t[h++]=e[l++];h+=s}}}(h,e,t,a,r,i,c);else{let t=0,a=0;for(let i=0,s=r*n;i<s;i++){e[t++]=h[a++];e[t++]=h[a++];e[t++]=h[a++];t+=c}}}get usesZeroToOneRange(){return shadow(this,"usesZeroToOneRange",!0)}static isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2*t!==e.length){warn("The decode map is not the correct length");return!0}for(let t=0,a=e.length;t<a;t+=2)if(0!==e[t]||1!==e[t+1])return!1;return!0}}class AlternateCS extends ColorSpace{constructor(e,t,a){super("Alternate",e);this.base=t;this.tintFn=a;this.tmpBuf=new Float32Array(t.numComps)}getRgbItem(e,t,a,r){const i=this.tmpBuf;this.tintFn(e,t,i,0);this.base.getRgbItem(i,0,a,r)}getRgbBuffer(e,t,a,r,i,n,s){const o=this.tintFn,c=this.base,l=1/((1<<n)-1),h=c.numComps,u=c.usesZeroToOneRange,d=(c.isPassthrough(8)||!u)&&0===s;let f=d?i:0;const g=d?r:new Uint8ClampedArray(h*a),p=this.numComps,m=new Float32Array(p),b=new Float32Array(h);let y,w;for(y=0;y<a;y++){for(w=0;w<p;w++)m[w]=e[t++]*l;o(m,0,b,0);if(u)for(w=0;w<h;w++)g[f++]=255*b[w];else{c.getRgbItem(b,0,g,f);f+=h}}d||c.getRgbBuffer(g,0,a,r,i,8,s)}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps/this.numComps,t)}}class PatternCS extends ColorSpace{constructor(e){super("Pattern",null);this.base=e}isDefaultDecode(e,t){unreachable("Should not call PatternCS.isDefaultDecode")}}class IndexedCS extends ColorSpace{constructor(e,t,a){super("Indexed",1);this.base=e;this.highVal=t;const r=e.numComps*(t+1);this.lookup=new Uint8Array(r);if(a instanceof BaseStream){const e=a.getBytes(r);this.lookup.set(e)}else{if("string"!=typeof a)throw new FormatError(`IndexedCS - unrecognized lookup table: ${a}`);for(let e=0;e<r;++e)this.lookup[e]=255&a.charCodeAt(e)}}getRgbItem(e,t,a,r){const{base:i,highVal:n,lookup:s}=this,o=MathClamp(Math.round(e[t]),0,n)*i.numComps;i.getRgbBuffer(s,o,1,a,r,8,0)}getRgbBuffer(e,t,a,r,i,n,s){const{base:o,highVal:c,lookup:l}=this,{numComps:h}=o,u=o.getOutputLength(h,s);for(let n=0;n<a;++n){const a=MathClamp(Math.round(e[t++]),0,c)*h;o.getRgbBuffer(l,a,1,r,i,8,s);i+=u}}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps,t)}isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2!==e.length){warn("Decode map length is not correct");return!0}if(!Number.isInteger(t)||t<1){warn("Bits per component is not correct");return!0}return 0===e[0]&&e[1]===(1<<t)-1}}class DeviceGrayCS extends ColorSpace{constructor(){super("DeviceGray",1)}getRgbItem(e,t,a,r){const i=255*e[t];a[r]=a[r+1]=a[r+2]=i}getRgbBuffer(e,t,a,r,i,n,s){const o=255/((1<<n)-1);let c=t,l=i;for(let t=0;t<a;++t){const t=o*e[c++];r[l++]=t;r[l++]=t;r[l++]=t;l+=s}}getOutputLength(e,t){return e*(3+t)}}class DeviceRgbCS extends ColorSpace{constructor(){super("DeviceRGB",3)}getRgbItem(e,t,a,r){a[r]=255*e[t];a[r+1]=255*e[t+1];a[r+2]=255*e[t+2]}getRgbBuffer(e,t,a,r,i,n,s){if(8===n&&0===s){r.set(e.subarray(t,t+3*a),i);return}const o=255/((1<<n)-1);let c=t,l=i;for(let t=0;t<a;++t){r[l++]=o*e[c++];r[l++]=o*e[c++];r[l++]=o*e[c++];l+=s}}getOutputLength(e,t){return e*(3+t)/3|0}isPassthrough(e){return 8===e}}class DeviceRgbaCS extends ColorSpace{constructor(){super("DeviceRGBA",4)}getOutputLength(e,t){return 4*e}isPassthrough(e){return 8===e}fillRgb(e,t,a,r,i,n,s,o,c){a!==i||t!==r?function resizeRgbaImage(e,t,a,r,i,n,s){const o=a/i,c=r/n;let l=0;const h=new Uint16Array(i);if(1===s){for(let e=0;e<i;e++)h[e]=Math.floor(e*o);const r=new Uint32Array(e.buffer),s=new Uint32Array(t.buffer),u=FeatureTest.isLittleEndian?16777215:4294967040;for(let e=0;e<n;e++){const t=r.subarray(Math.floor(e*c)*a);for(let e=0;e<i;e++)s[l++]|=t[h[e]]&u}}else{const r=4,s=a*r;for(let e=0;e<i;e++)h[e]=Math.floor(e*o)*r;for(let a=0;a<n;a++){const r=e.subarray(Math.floor(a*c)*s);for(let e=0;e<i;e++){const a=h[e];t[l++]=r[a];t[l++]=r[a+1];t[l++]=r[a+2]}}}}(o,e,t,a,r,i,c):function copyRgbaImage(e,t,a){if(1===a){const a=new Uint32Array(e.buffer),r=new Uint32Array(t.buffer),i=FeatureTest.isLittleEndian?16777215:4294967040;for(let e=0,t=a.length;e<t;e++)r[e]|=a[e]&i}else{let a=0;for(let r=0,i=e.length;r<i;r+=4){t[a++]=e[r];t[a++]=e[r+1];t[a++]=e[r+2]}}}(o,e,c)}}class DeviceCmykCS extends ColorSpace{constructor(){super("DeviceCMYK",4)}#i(e,t,a,r,i){const n=e[t]*a,s=e[t+1]*a,o=e[t+2]*a,c=e[t+3]*a;r[i]=255+n*(-4.387332384609988*n+54.48615194189176*s+18.82290502165302*o+212.25662451639585*c-285.2331026137004)+s*(1.7149763477362134*s-5.6096736904047315*o+-17.873870861415444*c-5.497006427196366)+o*(-2.5217340131683033*o-21.248923337353073*c+17.5119270841813)+c*(-21.86122147463605*c-189.48180835922747);r[i+1]=255+n*(8.841041422036149*n+60.118027045597366*s+6.871425592049007*o+31.159100130055922*c-79.2970844816548)+s*(-15.310361306967817*s+17.575251261109482*o+131.35250912493976*c-190.9453302588951)+o*(4.444339102852739*o+9.8632861493405*c-24.86741582555878)+c*(-20.737325471181034*c-187.80453709719578);r[i+2]=255+n*(.8842522430003296*n+8.078677503112928*s+30.89978309703729*o-.23883238689178934*c-14.183576799673286)+s*(10.49593273432072*s+63.02378494754052*o+50.606957656360734*c-112.23884253719248)+o*(.03296041114873217*o+115.60384449646641*c-193.58209356861505)+c*(-22.33816807309886*c-180.12613974708367)}getRgbItem(e,t,a,r){this.#i(e,t,1,a,r)}getRgbBuffer(e,t,a,r,i,n,s){const o=1/((1<<n)-1);for(let n=0;n<a;n++){this.#i(e,t,o,r,i);t+=4;i+=3+s}}getOutputLength(e,t){return e/4*(3+t)|0}}class CalGrayCS extends ColorSpace{constructor(e,t,a){super("CalGray",1);if(!e)throw new FormatError("WhitePoint missing - required for color space CalGray");[this.XW,this.YW,this.ZW]=e;[this.XB,this.YB,this.ZB]=t||[0,0,0];this.G=a||1;if(this.XW<0||this.ZW<0||1!==this.YW)throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);if(this.XB<0||this.YB<0||this.ZB<0){info(`Invalid BlackPoint for ${this.name}, falling back to default.`);this.XB=this.YB=this.ZB=0}0===this.XB&&0===this.YB&&0===this.ZB||warn(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`);if(this.G<1){info(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`);this.G=1}}#i(e,t,a,r,i){const n=(e[t]*i)**this.G,s=this.YW*n,o=Math.max(295.8*s**.3333333333333333-40.8,0);a[r]=o;a[r+1]=o;a[r+2]=o}getRgbItem(e,t,a,r){this.#i(e,t,a,r,1)}getRgbBuffer(e,t,a,r,i,n,s){const o=1/((1<<n)-1);for(let n=0;n<a;++n){this.#i(e,t,r,i,o);t+=1;i+=3+s}}getOutputLength(e,t){return e*(3+t)}}class CalRGBCS extends ColorSpace{static#n=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]);static#s=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]);static#o=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]);static#c=new Float32Array([1,1,1]);static#l=new Float32Array(3);static#h=new Float32Array(3);static#u=new Float32Array(3);static#d=(24/116)**3/8;constructor(e,t,a,r){super("CalRGB",3);if(!e)throw new FormatError("WhitePoint missing - required for color space CalRGB");const[i,n,s]=this.whitePoint=e,[o,c,l]=this.blackPoint=t||new Float32Array(3);[this.GR,this.GG,this.GB]=a||new Float32Array([1,1,1]);[this.MXA,this.MYA,this.MZA,this.MXB,this.MYB,this.MZB,this.MXC,this.MYC,this.MZC]=r||new Float32Array([1,0,0,0,1,0,0,0,1]);if(i<0||s<0||1!==n)throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);if(o<0||c<0||l<0){info(`Invalid BlackPoint for ${this.name} [${o}, ${c}, ${l}], falling back to default.`);this.blackPoint=new Float32Array(3)}if(this.GR<0||this.GG<0||this.GB<0){info(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`);this.GR=this.GG=this.GB=1}}#f(e,t,a){a[0]=e[0]*t[0]+e[1]*t[1]+e[2]*t[2];a[1]=e[3]*t[0]+e[4]*t[1]+e[5]*t[2];a[2]=e[6]*t[0]+e[7]*t[1]+e[8]*t[2]}#g(e,t,a){a[0]=1*t[0]/e[0];a[1]=1*t[1]/e[1];a[2]=1*t[2]/e[2]}#p(e,t,a){a[0]=.95047*t[0]/e[0];a[1]=1*t[1]/e[1];a[2]=1.08883*t[2]/e[2]}#m(e){return e<=.0031308?MathClamp(12.92*e,0,1):e>=.99554525?1:MathClamp(1.055*e**(1/2.4)-.055,0,1)}#b(e){return e<0?-this.#b(-e):e>8?((e+16)/116)**3:e*CalRGBCS.#d}#y(e,t,a){if(0===e[0]&&0===e[1]&&0===e[2]){a[0]=t[0];a[1]=t[1];a[2]=t[2];return}const r=this.#b(0),i=(1-r)/(1-this.#b(e[0])),n=1-i,s=(1-r)/(1-this.#b(e[1])),o=1-s,c=(1-r)/(1-this.#b(e[2])),l=1-c;a[0]=t[0]*i+n;a[1]=t[1]*s+o;a[2]=t[2]*c+l}#w(e,t,a){if(1===e[0]&&1===e[2]){a[0]=t[0];a[1]=t[1];a[2]=t[2];return}const r=a;this.#f(CalRGBCS.#n,t,r);const i=CalRGBCS.#l;this.#g(e,r,i);this.#f(CalRGBCS.#s,i,a)}#x(e,t,a){const r=a;this.#f(CalRGBCS.#n,t,r);const i=CalRGBCS.#l;this.#p(e,r,i);this.#f(CalRGBCS.#s,i,a)}#i(e,t,a,r,i){const n=MathClamp(e[t]*i,0,1),s=MathClamp(e[t+1]*i,0,1),o=MathClamp(e[t+2]*i,0,1),c=1===n?1:n**this.GR,l=1===s?1:s**this.GG,h=1===o?1:o**this.GB,u=this.MXA*c+this.MXB*l+this.MXC*h,d=this.MYA*c+this.MYB*l+this.MYC*h,f=this.MZA*c+this.MZB*l+this.MZC*h,g=CalRGBCS.#h;g[0]=u;g[1]=d;g[2]=f;const p=CalRGBCS.#u;this.#w(this.whitePoint,g,p);const m=CalRGBCS.#h;this.#y(this.blackPoint,p,m);const b=CalRGBCS.#u;this.#x(CalRGBCS.#c,m,b);const y=CalRGBCS.#h;this.#f(CalRGBCS.#o,b,y);a[r]=255*this.#m(y[0]);a[r+1]=255*this.#m(y[1]);a[r+2]=255*this.#m(y[2])}getRgbItem(e,t,a,r){this.#i(e,t,a,r,1)}getRgbBuffer(e,t,a,r,i,n,s){const o=1/((1<<n)-1);for(let n=0;n<a;++n){this.#i(e,t,r,i,o);t+=3;i+=3+s}}getOutputLength(e,t){return e*(3+t)/3|0}}class LabCS extends ColorSpace{constructor(e,t,a){super("Lab",3);if(!e)throw new FormatError("WhitePoint missing - required for color space Lab");[this.XW,this.YW,this.ZW]=e;[this.amin,this.amax,this.bmin,this.bmax]=a||[-100,100,-100,100];[this.XB,this.YB,this.ZB]=t||[0,0,0];if(this.XW<0||this.ZW<0||1!==this.YW)throw new FormatError("Invalid WhitePoint components, no fallback available");if(this.XB<0||this.YB<0||this.ZB<0){info("Invalid BlackPoint, falling back to default");this.XB=this.YB=this.ZB=0}if(this.amin>this.amax||this.bmin>this.bmax){info("Invalid Range, falling back to defaults");this.amin=-100;this.amax=100;this.bmin=-100;this.bmax=100}}#S(e){return e>=6/29?e**3:108/841*(e-4/29)}#A(e,t,a,r){return a+e*(r-a)/t}#i(e,t,a,r,i){let n=e[t],s=e[t+1],o=e[t+2];if(!1!==a){n=this.#A(n,a,0,100);s=this.#A(s,a,this.amin,this.amax);o=this.#A(o,a,this.bmin,this.bmax)}s>this.amax?s=this.amax:s<this.amin&&(s=this.amin);o>this.bmax?o=this.bmax:o<this.bmin&&(o=this.bmin);const c=(n+16)/116,l=c+s/500,h=c-o/200,u=this.XW*this.#S(l),d=this.YW*this.#S(c),f=this.ZW*this.#S(h);let g,p,m;if(this.ZW<1){g=3.1339*u+-1.617*d+-.4906*f;p=-.9785*u+1.916*d+.0333*f;m=.072*u+-.229*d+1.4057*f}else{g=3.2406*u+-1.5372*d+-.4986*f;p=-.9689*u+1.8758*d+.0415*f;m=.0557*u+-.204*d+1.057*f}r[i]=255*Math.sqrt(g);r[i+1]=255*Math.sqrt(p);r[i+2]=255*Math.sqrt(m)}getRgbItem(e,t,a,r){this.#i(e,t,!1,a,r)}getRgbBuffer(e,t,a,r,i,n,s){const o=(1<<n)-1;for(let n=0;n<a;n++){this.#i(e,t,o,r,i);t+=3;i+=3+s}}getOutputLength(e,t){return e*(3+t)/3|0}isDefaultDecode(e,t){return!0}get usesZeroToOneRange(){return shadow(this,"usesZeroToOneRange",!1)}}function fetchSync(e){const t=new XMLHttpRequest;t.open("GET",e,!1);t.responseType="arraybuffer";t.send(null);return t.response}class IccColorSpace extends ColorSpace{#k;#C;static#v=!0;static#F=null;static#I=new FinalizationRegistry((e=>{!function qcms_drop_transformer(e){Da.qcms_drop_transformer(e)}(e)}));constructor(e,t,a){if(!IccColorSpace.isUsable)throw new Error("No ICC color space support");super(t,a);let r;switch(a){case 1:r=Ea.Gray8;this.#C=(e,t,a)=>function qcms_convert_one(e,t,a){Da.qcms_convert_one(e,t,a)}(this.#k,255*e[t],a);break;case 3:r=Ea.RGB8;this.#C=(e,t,a)=>function qcms_convert_three(e,t,a,r,i){Da.qcms_convert_three(e,t,a,r,i)}(this.#k,255*e[t],255*e[t+1],255*e[t+2],a);break;case 4:r=Ea.CMYK;this.#C=(e,t,a)=>function qcms_convert_four(e,t,a,r,i,n){Da.qcms_convert_four(e,t,a,r,i,n)}(this.#k,255*e[t],255*e[t+1],255*e[t+2],255*e[t+3],a);break;default:throw new Error(`Unsupported number of components: ${a}`)}this.#k=function qcms_transformer_from_memory(e,t,a){const r=passArray8ToWasm0(e,Da.__wbindgen_malloc),i=Na;return Da.qcms_transformer_from_memory(r,i,t,a)>>>0}(e,r,Pa.Perceptual);if(!this.#k)throw new Error("Failed to create ICC color space");IccColorSpace.#I.register(this,this.#k)}getRgbHex(e,t){this.#C(e,t,!0);return QCMS._cssColor}getRgbItem(e,t,a,r){QCMS._destBuffer=a;QCMS._destOffset=r;QCMS._destLength=3;this.#C(e,t,!1);QCMS._destBuffer=null}getRgbBuffer(e,t,a,r,i,n,s){e=e.subarray(t,t+a*this.numComps);if(8!==n){const t=255/((1<<n)-1);for(let a=0,r=e.length;a<r;a++)e[a]*=t}QCMS._mustAddAlpha=s&&r.buffer===e.buffer;QCMS._destBuffer=r;QCMS._destOffset=i;QCMS._destLength=a*(3+s);!function qcms_convert_array(e,t){const a=passArray8ToWasm0(t,Da.__wbindgen_malloc),r=Na;Da.qcms_convert_array(e,a,r)}(this.#k,e);QCMS._mustAddAlpha=!1;QCMS._destBuffer=null}getOutputLength(e,t){return e/this.numComps*(3+t)|0}static setOptions({useWasm:e,useWorkerFetch:t,wasmUrl:a}){if(t){this.#v=e;this.#F=a}else this.#v=!1}static get isUsable(){let e=!1;if(this.#v)if(this.#F)try{this._module=function initSync(e){if(void 0!==Da)return Da;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module:e}=e):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const t=__wbg_get_imports();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));return __wbg_finalize_init(new WebAssembly.Instance(e,t),e)}({module:fetchSync(`${this.#F}qcms_bg.wasm`)});e=!!this._module;QCMS._memory=this._module.memory;QCMS._makeHexColor=Util.makeHexColor}catch(e){warn(`ICCBased color space: "${e}".`)}else warn("No ICC color space support due to missing `wasmUrl` API option");return shadow(this,"isUsable",e)}}class CmykICCBasedCS extends IccColorSpace{static#T;constructor(){super(new Uint8Array(fetchSync(`${CmykICCBasedCS.#T}CGATS001Compat-v2-micro.icc`)),"DeviceCMYK",4)}static setOptions({iccUrl:e}){this.#T=e}static get isUsable(){let e=!1;IccColorSpace.isUsable&&(this.#T?e=!0:warn("No CMYK ICC profile support due to missing `iccUrl` API option"));return shadow(this,"isUsable",e)}}class Stream extends BaseStream{constructor(e,t,a,r){super();this.bytes=e instanceof Uint8Array?e:new Uint8Array(e);this.start=t||0;this.pos=this.start;this.end=t+a||this.bytes.length;this.dict=r}get length(){return this.end-this.start}get isEmpty(){return 0===this.length}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(e){const t=this.bytes,a=this.pos,r=this.end;if(!e)return t.subarray(a,r);let i=a+e;i>r&&(i=r);this.pos=i;return t.subarray(a,i)}getByteRange(e,t){e<0&&(e=0);t>this.end&&(t=this.end);return this.bytes.subarray(e,t)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(e,t,a=null){return new Stream(this.bytes.buffer,e,t,a)}}class StringStream extends Stream{constructor(e){super(stringToBytes(e))}}class NullStream extends Stream{constructor(){super(new Uint8Array(0))}}class ChunkedStream extends Stream{constructor(e,t,a){super(new Uint8Array(e),0,e,null);this.chunkSize=t;this._loadedChunks=new Set;this.numChunks=Math.ceil(e/t);this.manager=a;this.progressiveDataLength=0;this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const e=[];for(let t=0,a=this.numChunks;t<a;++t)this._loadedChunks.has(t)||e.push(t);return e}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(e,t){const a=this.chunkSize;if(e%a!=0)throw new Error(`Bad begin offset: ${e}`);const r=e+t.byteLength;if(r%a!=0&&r!==this.bytes.length)throw new Error(`Bad end offset: ${r}`);this.bytes.set(new Uint8Array(t),e);const i=Math.floor(e/a),n=Math.floor((r-1)/a)+1;for(let e=i;e<n;++e)this._loadedChunks.add(e)}onReceiveProgressiveData(e){let t=this.progressiveDataLength;const a=Math.floor(t/this.chunkSize);this.bytes.set(new Uint8Array(e),t);t+=e.byteLength;this.progressiveDataLength=t;const r=t>=this.end?this.numChunks:Math.floor(t/this.chunkSize);for(let e=a;e<r;++e)this._loadedChunks.add(e)}ensureByte(e){if(e<this.progressiveDataLength)return;const t=Math.floor(e/this.chunkSize);if(!(t>this.numChunks)&&t!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(t))throw new MissingDataException(e,e+1);this.lastSuccessfulEnsureByteChunk=t}}ensureRange(e,t){if(e>=t)return;if(t<=this.progressiveDataLength)return;const a=Math.floor(e/this.chunkSize);if(a>this.numChunks)return;const r=Math.min(Math.floor((t-1)/this.chunkSize)+1,this.numChunks);for(let i=a;i<r;++i)if(!this._loadedChunks.has(i))throw new MissingDataException(e,t)}nextEmptyChunk(e){const t=this.numChunks;for(let a=0;a<t;++a){const r=(e+a)%t;if(!this._loadedChunks.has(r))return r}return null}hasChunk(e){return this._loadedChunks.has(e)}getByte(){const e=this.pos;if(e>=this.end)return-1;e>=this.progressiveDataLength&&this.ensureByte(e);return this.bytes[this.pos++]}getBytes(e){const t=this.bytes,a=this.pos,r=this.end;if(!e){r>this.progressiveDataLength&&this.ensureRange(a,r);return t.subarray(a,r)}let i=a+e;i>r&&(i=r);i>this.progressiveDataLength&&this.ensureRange(a,i);this.pos=i;return t.subarray(a,i)}getByteRange(e,t){e<0&&(e=0);t>this.end&&(t=this.end);t>this.progressiveDataLength&&this.ensureRange(e,t);return this.bytes.subarray(e,t)}makeSubStream(e,t,a=null){t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e);function ChunkedStreamSubstream(){}ChunkedStreamSubstream.prototype=Object.create(this);ChunkedStreamSubstream.prototype.getMissingChunks=function(){const e=this.chunkSize,t=Math.floor(this.start/e),a=Math.floor((this.end-1)/e)+1,r=[];for(let e=t;e<a;++e)this._loadedChunks.has(e)||r.push(e);return r};Object.defineProperty(ChunkedStreamSubstream.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks||0===this.getMissingChunks().length},configurable:!0});const r=new ChunkedStreamSubstream;r.pos=r.start=e;r.end=e+t||this.end;r.dict=a;return r}getBaseStreams(){return[this]}}class ChunkedStreamManager{constructor(e,t){this.length=t.length;this.chunkSize=t.rangeChunkSize;this.stream=new ChunkedStream(this.length,this.chunkSize,this);this.pdfNetworkStream=e;this.disableAutoFetch=t.disableAutoFetch;this.msgHandler=t.msgHandler;this.currRequestId=0;this._chunksNeededByRequest=new Map;this._requestsByChunk=new Map;this._promisesByRequest=new Map;this.progressiveDataLength=0;this.aborted=!1;this._loadedStreamCapability=Promise.withResolvers()}sendRequest(e,t){const a=this.pdfNetworkStream.getRangeReader(e,t);a.isStreamingSupported||(a.onProgress=this.onProgress.bind(this));let r=[],i=0;return new Promise(((e,t)=>{const readChunk=({value:n,done:s})=>{try{if(s){const t=arrayBuffersToBytes(r);r=null;e(t);return}i+=n.byteLength;a.isStreamingSupported&&this.onProgress({loaded:i});r.push(n);a.read().then(readChunk,t)}catch(e){t(e)}};a.read().then(readChunk,t)})).then((t=>{this.aborted||this.onReceiveData({chunk:t,begin:e})}))}requestAllChunks(e=!1){if(!e){const e=this.stream.getMissingChunks();this._requestChunks(e)}return this._loadedStreamCapability.promise}_requestChunks(e){const t=this.currRequestId++,a=new Set;this._chunksNeededByRequest.set(t,a);for(const t of e)this.stream.hasChunk(t)||a.add(t);if(0===a.size)return Promise.resolve();const r=Promise.withResolvers();this._promisesByRequest.set(t,r);const i=[];for(const e of a){let a=this._requestsByChunk.get(e);if(!a){a=[];this._requestsByChunk.set(e,a);i.push(e)}a.push(t)}if(i.length>0){const e=this.groupChunks(i);for(const t of e){const e=t.beginChunk*this.chunkSize,a=Math.min(t.endChunk*this.chunkSize,this.length);this.sendRequest(e,a).catch(r.reject)}}return r.promise.catch((e=>{if(!this.aborted)throw e}))}getStream(){return this.stream}requestRange(e,t){t=Math.min(t,this.length);const a=this.getBeginChunk(e),r=this.getEndChunk(t),i=[];for(let e=a;e<r;++e)i.push(e);return this._requestChunks(i)}requestRanges(e=[]){const t=[];for(const a of e){const e=this.getBeginChunk(a.begin),r=this.getEndChunk(a.end);for(let a=e;a<r;++a)t.includes(a)||t.push(a)}t.sort(((e,t)=>e-t));return this._requestChunks(t)}groupChunks(e){const t=[];let a=-1,r=-1;for(let i=0,n=e.length;i<n;++i){const n=e[i];a<0&&(a=n);if(r>=0&&r+1!==n){t.push({beginChunk:a,endChunk:r+1});a=n}i+1===e.length&&t.push({beginChunk:a,endChunk:n+1});r=n}return t}onProgress(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){const t=e.chunk,a=void 0===e.begin,r=a?this.progressiveDataLength:e.begin,i=r+t.byteLength,n=Math.floor(r/this.chunkSize),s=i<this.length?Math.floor(i/this.chunkSize):Math.ceil(i/this.chunkSize);if(a){this.stream.onReceiveProgressiveData(t);this.progressiveDataLength=i}else this.stream.onReceiveData(r,t);this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const o=[];for(let e=n;e<s;++e){const t=this._requestsByChunk.get(e);if(t){this._requestsByChunk.delete(e);for(const a of t){const t=this._chunksNeededByRequest.get(a);t.has(e)&&t.delete(e);t.size>0||o.push(a)}}}if(!this.disableAutoFetch&&0===this._requestsByChunk.size){let e;if(1===this.stream.numChunksLoaded){const t=this.stream.numChunks-1;this.stream.hasChunk(t)||(e=t)}else e=this.stream.nextEmptyChunk(s);Number.isInteger(e)&&this._requestChunks([e])}for(const e of o){const t=this._promisesByRequest.get(e);this._promisesByRequest.delete(e);t.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(e){this._loadedStreamCapability.reject(e)}getBeginChunk(e){return Math.floor(e/this.chunkSize)}getEndChunk(e){return Math.floor((e-1)/this.chunkSize)+1}abort(e){this.aborted=!0;this.pdfNetworkStream?.cancelAllRequests(e);for(const t of this._promisesByRequest.values())t.reject(e)}}function convertToRGBA(e){switch(e.kind){case k:return convertBlackAndWhiteToRGBA(e);case C:return function convertRGBToRGBA({src:e,srcPos:t=0,dest:a,destPos:r=0,width:i,height:n}){let s=0;const o=i*n*3,c=o>>2,l=new Uint32Array(e.buffer,t,c);if(FeatureTest.isLittleEndian){for(;s<c-2;s+=3,r+=4){const e=l[s],t=l[s+1],i=l[s+2];a[r]=4278190080|e;a[r+1]=e>>>24|t<<8|4278190080;a[r+2]=t>>>16|i<<16|4278190080;a[r+3]=i>>>8|4278190080}for(let i=4*s,n=t+o;i<n;i+=3)a[r++]=e[i]|e[i+1]<<8|e[i+2]<<16|4278190080}else{for(;s<c-2;s+=3,r+=4){const e=l[s],t=l[s+1],i=l[s+2];a[r]=255|e;a[r+1]=e<<24|t>>>8|255;a[r+2]=t<<16|i>>>16|255;a[r+3]=i<<8|255}for(let i=4*s,n=t+o;i<n;i+=3)a[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|255}return{srcPos:t+o,destPos:r}}(e)}return null}function convertBlackAndWhiteToRGBA({src:e,srcPos:t=0,dest:a,width:r,height:i,nonBlackColor:n=4294967295,inverseDecode:s=!1}){const o=FeatureTest.isLittleEndian?4278190080:255,[c,l]=s?[n,o]:[o,n],h=r>>3,u=7&r,d=e.length;a=new Uint32Array(a.buffer);let f=0;for(let r=0;r<i;r++){for(const r=t+h;t<r;t++){const r=t<d?e[t]:255;a[f++]=128&r?l:c;a[f++]=64&r?l:c;a[f++]=32&r?l:c;a[f++]=16&r?l:c;a[f++]=8&r?l:c;a[f++]=4&r?l:c;a[f++]=2&r?l:c;a[f++]=1&r?l:c}if(0===u)continue;const r=t<d?e[t++]:255;for(let e=0;e<u;e++)a[f++]=r&1<<7-e?l:c}return{srcPos:t,destPos:f}}class ImageResizer{static#O=2048;static#M=FeatureTest.isImageDecoderSupported;constructor(e,t){this._imgData=e;this._isMask=t}static get canUseImageDecoder(){return shadow(this,"canUseImageDecoder",this.#M?ImageDecoder.isTypeSupported("image/bmp"):Promise.resolve(!1))}static needsToBeResized(e,t){if(e<=this.#O&&t<=this.#O)return!1;const{MAX_DIM:a}=this;if(e>a||t>a)return!0;const r=e*t;if(this._hasMaxArea)return r>this.MAX_AREA;if(r<this.#O**2)return!1;if(this._areGoodDims(e,t)){this.#O=Math.max(this.#O,Math.floor(Math.sqrt(e*t)));return!1}this.#O=this._guessMax(this.#O,a,128,0);return r>(this.MAX_AREA=this.#O**2)}static getReducePowerForJPX(e,t,a){const r=e*t,i=2**30/(4*a);if(!this.needsToBeResized(e,t))return r>i?Math.ceil(Math.log2(r/i)):0;const{MAX_DIM:n,MAX_AREA:s}=this,o=Math.max(e/n,t/n,Math.sqrt(r/Math.min(i,s)));return Math.ceil(Math.log2(o))}static get MAX_DIM(){return shadow(this,"MAX_DIM",this._guessMax(2048,65537,0,1))}static get MAX_AREA(){this._hasMaxArea=!0;return shadow(this,"MAX_AREA",this._guessMax(this.#O,this.MAX_DIM,128,0)**2)}static set MAX_AREA(e){if(e>=0){this._hasMaxArea=!0;shadow(this,"MAX_AREA",e)}}static setOptions({canvasMaxAreaInBytes:e=-1,isImageDecoderSupported:t=!1}){this._hasMaxArea||(this.MAX_AREA=e>>2);this.#M=t}static _areGoodDims(e,t){try{const a=new OffscreenCanvas(e,t),r=a.getContext("2d");r.fillRect(0,0,1,1);const i=r.getImageData(0,0,1,1).data[3];a.width=a.height=1;return 0!==i}catch{return!1}}static _guessMax(e,t,a,r){for(;e+a+1<t;){const a=Math.floor((e+t)/2),i=r||a;this._areGoodDims(a,i)?e=a:t=a}return e}static async createImage(e,t=!1){return new ImageResizer(e,t)._createImage()}async _createImage(){const{_imgData:e}=this,{width:t,height:a}=e;if(t*a*4>va){const e=this.#D();if(e)return e}const r=this._encodeBMP();let i,n;if(await ImageResizer.canUseImageDecoder){i=new ImageDecoder({data:r,type:"image/bmp",preferAnimation:!1,transfer:[r.buffer]});n=i.decode().catch((e=>{warn(`BMP image decoding failed: ${e}`);return createImageBitmap(new Blob([this._encodeBMP().buffer],{type:"image/bmp"}))})).finally((()=>{i.close()}))}else n=createImageBitmap(new Blob([r.buffer],{type:"image/bmp"}));const{MAX_AREA:s,MAX_DIM:o}=ImageResizer,c=Math.max(t/o,a/o,Math.sqrt(t*a/s)),l=Math.max(c,2),h=Math.round(10*(c+1.25))/10/l,u=Math.floor(Math.log2(h)),d=new Array(u+2).fill(2);d[0]=l;d.splice(-1,1,h/(1<<u));let f=t,g=a;const p=await n;let m=p.image||p;for(const e of d){const t=f,a=g;f=Math.floor(f/e)-1;g=Math.floor(g/e)-1;const r=new OffscreenCanvas(f,g);r.getContext("2d").drawImage(m,0,0,t,a,0,0,f,g);m.close();m=r.transferToImageBitmap()}e.data=null;e.bitmap=m;e.width=f;e.height=g;return e}#D(){const{_imgData:e}=this,{data:t,width:a,height:r,kind:i}=e,n=a*r*4,s=Math.ceil(Math.log2(n/va)),o=a>>s,c=r>>s;let l,h=r;try{l=new Uint8Array(n)}catch{let e=Math.floor(Math.log2(n+1));for(;;)try{l=new Uint8Array(2**e-1);break}catch{e-=1}h=Math.floor((2**e-1)/(4*a));const t=a*h*4;t<l.length&&(l=new Uint8Array(t))}const u=new Uint32Array(l.buffer),d=new Uint32Array(o*c);let f=0,g=0;const p=Math.ceil(r/h),m=r%h==0?r:r%h;for(let e=0;e<p;e++){const r=e<p-1?h:m;({srcPos:f}=convertToRGBA({kind:i,src:t,dest:u,width:a,height:r,inverseDecode:this._isMask,srcPos:f}));for(let e=0,t=r>>s;e<t;e++){const t=u.subarray((e<<s)*a);for(let e=0;e<o;e++)d[g++]=t[e<<s]}}if(ImageResizer.needsToBeResized(o,c)){e.data=d;e.width=o;e.height=c;e.kind=v;return null}const b=new OffscreenCanvas(o,c);b.getContext("2d",{willReadFrequently:!0}).putImageData(new ImageData(new Uint8ClampedArray(d.buffer),o,c),0,0);e.data=null;e.bitmap=b.transferToImageBitmap();e.width=o;e.height=c;return e}_encodeBMP(){const{width:e,height:t,kind:a}=this._imgData;let r,i=this._imgData.data,n=new Uint8Array(0),s=n,o=0;switch(a){case k:{r=1;n=new Uint8Array(this._isMask?[255,255,255,255,0,0,0,0]:[0,0,0,0,255,255,255,255]);const a=e+7>>3,s=a+3&-4;if(a!==s){const e=new Uint8Array(s*t);let r=0;for(let n=0,o=t*a;n<o;n+=a,r+=s)e.set(i.subarray(n,n+a),r);i=e}break}case C:r=24;if(3&e){const a=3*e,r=a+3&-4,n=r-a,s=new Uint8Array(r*t);let o=0;for(let e=0,r=t*a;e<r;e+=a){const t=i.subarray(e,e+a);for(let e=0;e<a;e+=3){s[o++]=t[e+2];s[o++]=t[e+1];s[o++]=t[e]}o+=n}i=s}else for(let e=0,t=i.length;e<t;e+=3){const t=i[e];i[e]=i[e+2];i[e+2]=t}break;case v:r=32;o=3;s=new Uint8Array(68);const a=new DataView(s.buffer);if(FeatureTest.isLittleEndian){a.setUint32(0,255,!0);a.setUint32(4,65280,!0);a.setUint32(8,16711680,!0);a.setUint32(12,4278190080,!0)}else{a.setUint32(0,4278190080,!0);a.setUint32(4,16711680,!0);a.setUint32(8,65280,!0);a.setUint32(12,255,!0)}break;default:throw new Error("invalid format")}let c=0;const l=40+s.length,h=14+l+n.length+i.length,u=new Uint8Array(h),d=new DataView(u.buffer);d.setUint16(c,19778,!0);c+=2;d.setUint32(c,h,!0);c+=4;d.setUint32(c,0,!0);c+=4;d.setUint32(c,14+l+n.length,!0);c+=4;d.setUint32(c,l,!0);c+=4;d.setInt32(c,e,!0);c+=4;d.setInt32(c,-t,!0);c+=4;d.setUint16(c,1,!0);c+=2;d.setUint16(c,r,!0);c+=2;d.setUint32(c,o,!0);c+=4;d.setUint32(c,0,!0);c+=4;d.setInt32(c,0,!0);c+=4;d.setInt32(c,0,!0);c+=4;d.setUint32(c,n.length/4,!0);c+=4;d.setUint32(c,0,!0);c+=4;u.set(s,c);c+=s.length;u.set(n,c);c+=n.length;u.set(i,c);return u}}const La=new Uint8Array(0);class DecodeStream extends BaseStream{constructor(e){super();this._rawMinBufferLength=e||0;this.pos=0;this.bufferLength=0;this.eof=!1;this.buffer=La;this.minBufferLength=512;if(e)for(;this.minBufferLength<e;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength}ensureBuffer(e){const t=this.buffer;if(e<=t.byteLength)return t;let a=this.minBufferLength;for(;a<e;)a*=2;const r=new Uint8Array(a);r.set(t);return this.buffer=r}getByte(){const e=this.pos;for(;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(e,t=null){const a=this.pos;let r;if(e){this.ensureBuffer(a+e);r=a+e;for(;!this.eof&&this.bufferLength<r;)this.readBlock(t);const i=this.bufferLength;r>i&&(r=i)}else{for(;!this.eof;)this.readBlock(t);r=this.bufferLength}this.pos=r;return this.buffer.subarray(a,r)}async getImageData(e,t){if(!this.canAsyncDecodeImageFromBuffer)return this.isAsyncDecoder?this.decodeImage(null,t):this.getBytes(e,t);const a=await this.stream.asyncGetBytes();return this.decodeImage(a,t)}reset(){this.pos=0}makeSubStream(e,t,a=null){if(void 0===t)for(;!this.eof;)this.readBlock();else{const a=e+t;for(;this.bufferLength<=a&&!this.eof;)this.readBlock()}return new Stream(this.buffer,e,t,a)}getBaseStreams(){return this.str?this.str.getBaseStreams():null}}class StreamsSequenceStream extends DecodeStream{constructor(e,t=null){e=e.filter((e=>e instanceof BaseStream));let a=0;for(const t of e)a+=t instanceof DecodeStream?t._rawMinBufferLength:t.length;super(a);this.streams=e;this._onError=t}readBlock(){const e=this.streams;if(0===e.length){this.eof=!0;return}const t=e.shift();let a;try{a=t.getBytes()}catch(e){if(this._onError){this._onError(e,t.dict?.objId);return}throw e}const r=this.bufferLength,i=r+a.length;this.ensureBuffer(i).set(a,r);this.bufferLength=i}getBaseStreams(){const e=[];for(const t of this.streams){const a=t.getBaseStreams();a&&e.push(...a)}return e.length>0?e:null}}class ColorSpaceUtils{static parse({cs:e,xref:t,resources:a=null,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:n,asyncIfNotCached:s=!1}){const o={xref:t,resources:a,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:n};let c,l,h;if(e instanceof Ref){l=e;const a=i.getByRef(l)||n.getByRef(l);if(a)return a;e=t.fetch(e)}if(e instanceof Name){c=e.name;const t=n.getByName(c);if(t)return t}try{h=this.#B(e,o)}catch(e){if(s&&!(e instanceof MissingDataException))return Promise.reject(e);throw e}if(c||l){n.set(c,l,h);l&&i.set(null,l,h)}return s?Promise.resolve(h):h}static#R(e,t){const{globalColorSpaceCache:a}=t;let r;if(e instanceof Ref){r=e;const t=a.getByRef(r);if(t)return t}const i=this.#B(e,t);r&&a.set(null,r,i);return i}static#B(e,t){const{xref:a,resources:r,pdfFunctionFactory:i,globalColorSpaceCache:n}=t;if((e=a.fetchIfRef(e))instanceof Name)switch(e.name){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"DeviceRGBA":return this.rgba;case"CMYK":case"DeviceCMYK":return this.cmyk;case"Pattern":return new PatternCS(null);default:if(r instanceof Dict){const a=r.get("ColorSpace");if(a instanceof Dict){const r=a.get(e.name);if(r){if(r instanceof Name)return this.#B(r,t);e=r;break}}}warn(`Unrecognized ColorSpace: ${e.name}`);return this.gray}if(Array.isArray(e)){const r=a.fetchIfRef(e[0]).name;let s,o,c,l,h,u;switch(r){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"CMYK":case"DeviceCMYK":return this.cmyk;case"CalGray":s=a.fetchIfRef(e[1]);l=s.getArray("WhitePoint");h=s.getArray("BlackPoint");u=s.get("Gamma");return new CalGrayCS(l,h,u);case"CalRGB":s=a.fetchIfRef(e[1]);l=s.getArray("WhitePoint");h=s.getArray("BlackPoint");u=s.getArray("Gamma");const d=s.getArray("Matrix");return new CalRGBCS(l,h,u,d);case"ICCBased":const f=e[1]instanceof Ref;if(f){const t=n.getByRef(e[1]);if(t)return t}const g=a.fetchIfRef(e[1]),p=g.dict;o=p.get("N");if(IccColorSpace.isUsable)try{const t=new IccColorSpace(g.getBytes(),"ICCBased",o);f&&n.set(null,e[1],t);return t}catch(t){if(t instanceof MissingDataException)throw t;warn(`ICCBased color space (${e[1]}): "${t}".`)}const m=p.getRaw("Alternate");if(m){const e=this.#R(m,t);if(e.numComps===o)return e;warn("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===o)return this.gray;if(3===o)return this.rgb;if(4===o)return this.cmyk;break;case"Pattern":c=e[1]||null;c&&(c=this.#R(c,t));return new PatternCS(c);case"I":case"Indexed":c=this.#R(e[1],t);const b=MathClamp(a.fetchIfRef(e[2]),0,255),y=a.fetchIfRef(e[3]);return new IndexedCS(c,b,y);case"Separation":case"DeviceN":const w=a.fetchIfRef(e[1]);o=Array.isArray(w)?w.length:1;c=this.#R(e[2],t);const x=i.create(e[3]);return new AlternateCS(o,c,x);case"Lab":s=a.fetchIfRef(e[1]);l=s.getArray("WhitePoint");h=s.getArray("BlackPoint");const S=s.getArray("Range");return new LabCS(l,h,S);default:warn(`Unimplemented ColorSpace object: ${r}`);return this.gray}}warn(`Unrecognized ColorSpace object: ${e}`);return this.gray}static get gray(){return shadow(this,"gray",new DeviceGrayCS)}static get rgb(){return shadow(this,"rgb",new DeviceRgbCS)}static get rgba(){return shadow(this,"rgba",new DeviceRgbaCS)}static get cmyk(){if(CmykICCBasedCS.isUsable)try{return shadow(this,"cmyk",new CmykICCBasedCS)}catch{warn("CMYK fallback: DeviceCMYK")}return shadow(this,"cmyk",new DeviceCmykCS)}}class JpegError extends fa{constructor(e){super(e,"JpegError")}}class DNLMarkerError extends fa{constructor(e,t){super(e,"DNLMarkerError");this.scanLines=t}}class EOIMarkerError extends fa{constructor(e){super(e,"EOIMarkerError")}}const ja=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),_a=4017,Ua=799,Xa=3406,qa=2276,Ha=1567,Wa=3784,za=5793,$a=2896;function buildHuffmanTable(e,t){let a,r,i=0,n=16;for(;n>0&&!e[n-1];)n--;const s=[{children:[],index:0}];let o,c=s[0];for(a=0;a<n;a++){for(r=0;r<e[a];r++){c=s.pop();c.children[c.index]=t[i];for(;c.index>0;)c=s.pop();c.index++;s.push(c);for(;s.length<=a;){s.push(o={children:[],index:0});c.children[c.index]=o.children;c=o}i++}if(a+1<n){s.push(o={children:[],index:0});c.children[c.index]=o.children;c=o}}return s[0].children}function getBlockBufferOffset(e,t,a){return 64*((e.blocksPerLine+1)*t+a)}function decodeScan(e,t,a,r,i,n,s,o,c,l=!1){const h=a.mcusPerLine,u=a.progressive,d=t;let f=0,g=0;function readBit(){if(g>0){g--;return f>>g&1}f=e[t++];if(255===f){const r=e[t++];if(r){if(220===r&&l){const r=readUint16(e,t+=2);t+=2;if(r>0&&r!==a.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",r)}else if(217===r){if(l){const e=y*(8===a.precision?8:0);if(e>0&&Math.round(a.scanLines/e)>=5)throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",e)}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new JpegError(`unexpected marker ${(f<<8|r).toString(16)}`)}}g=7;return f>>>7}function decodeHuffman(e){let t=e;for(;;){t=t[readBit()];switch(typeof t){case"number":return t;case"object":continue}throw new JpegError("invalid huffman sequence")}}function receive(e){let t=0;for(;e>0;){t=t<<1|readBit();e--}return t}function receiveAndExtend(e){if(1===e)return 1===readBit()?1:-1;const t=receive(e);return t>=1<<e-1?t:t+(-1<<e)+1}let p=0;let m,b=0;let y=0;function decodeMcu(e,t,a,r,i){const n=a%h;y=(a/h|0)*e.v+r;const s=n*e.h+i;t(e,getBlockBufferOffset(e,y,s))}function decodeBlock(e,t,a){y=a/e.blocksPerLine|0;const r=a%e.blocksPerLine;t(e,getBlockBufferOffset(e,y,r))}const w=r.length;let x,S,k,C,v,F;F=u?0===n?0===o?function decodeDCFirst(e,t){const a=decodeHuffman(e.huffmanTableDC),r=0===a?0:receiveAndExtend(a)<<c;e.blockData[t]=e.pred+=r}:function decodeDCSuccessive(e,t){e.blockData[t]|=readBit()<<c}:0===o?function decodeACFirst(e,t){if(p>0){p--;return}let a=n;const r=s;for(;a<=r;){const r=decodeHuffman(e.huffmanTableAC),i=15&r,n=r>>4;if(0===i){if(n<15){p=receive(n)+(1<<n)-1;break}a+=16;continue}a+=n;const s=ja[a];e.blockData[t+s]=receiveAndExtend(i)*(1<<c);a++}}:function decodeACSuccessive(e,t){let a=n;const r=s;let i,o,l=0;for(;a<=r;){const r=t+ja[a],n=e.blockData[r]<0?-1:1;switch(b){case 0:o=decodeHuffman(e.huffmanTableAC);i=15&o;l=o>>4;if(0===i)if(l<15){p=receive(l)+(1<<l);b=4}else{l=16;b=1}else{if(1!==i)throw new JpegError("invalid ACn encoding");m=receiveAndExtend(i);b=l?2:3}continue;case 1:case 2:if(e.blockData[r])e.blockData[r]+=n*(readBit()<<c);else{l--;0===l&&(b=2===b?3:0)}break;case 3:if(e.blockData[r])e.blockData[r]+=n*(readBit()<<c);else{e.blockData[r]=m<<c;b=0}break;case 4:e.blockData[r]&&(e.blockData[r]+=n*(readBit()<<c))}a++}if(4===b){p--;0===p&&(b=0)}}:function decodeBaseline(e,t){const a=decodeHuffman(e.huffmanTableDC),r=0===a?0:receiveAndExtend(a);e.blockData[t]=e.pred+=r;let i=1;for(;i<64;){const a=decodeHuffman(e.huffmanTableAC),r=15&a,n=a>>4;if(0===r){if(n<15)break;i+=16;continue}i+=n;const s=ja[i];e.blockData[t+s]=receiveAndExtend(r);i++}};let T,O=0;const M=1===w?r[0].blocksPerLine*r[0].blocksPerColumn:h*a.mcusPerColumn;let D,R;for(;O<=M;){const a=i?Math.min(M-O,i):M;if(a>0){for(S=0;S<w;S++)r[S].pred=0;p=0;if(1===w){x=r[0];for(v=0;v<a;v++){decodeBlock(x,F,O);O++}}else for(v=0;v<a;v++){for(S=0;S<w;S++){x=r[S];D=x.h;R=x.v;for(k=0;k<R;k++)for(C=0;C<D;C++)decodeMcu(x,F,O,k,C)}O++}}g=0;T=findNextFileMarker(e,t);if(!T)break;if(T.invalid){warn(`decodeScan - ${a>0?"unexpected":"excessive"} MCU data, current marker is: ${T.invalid}`);t=T.offset}if(!(T.marker>=65488&&T.marker<=65495))break;t+=2}return t-d}function quantizeAndInverse(e,t,a){const r=e.quantizationTable,i=e.blockData;let n,s,o,c,l,h,u,d,f,g,p,m,b,y,w,x,S;if(!r)throw new JpegError("missing required Quantization Table.");for(let e=0;e<64;e+=8){f=i[t+e];g=i[t+e+1];p=i[t+e+2];m=i[t+e+3];b=i[t+e+4];y=i[t+e+5];w=i[t+e+6];x=i[t+e+7];f*=r[e];if(g|p|m|b|y|w|x){g*=r[e+1];p*=r[e+2];m*=r[e+3];b*=r[e+4];y*=r[e+5];w*=r[e+6];x*=r[e+7];n=za*f+128>>8;s=za*b+128>>8;o=p;c=w;l=$a*(g-x)+128>>8;d=$a*(g+x)+128>>8;h=m<<4;u=y<<4;n=n+s+1>>1;s=n-s;S=o*Wa+c*Ha+128>>8;o=o*Ha-c*Wa+128>>8;c=S;l=l+u+1>>1;u=l-u;d=d+h+1>>1;h=d-h;n=n+c+1>>1;c=n-c;s=s+o+1>>1;o=s-o;S=l*qa+d*Xa+2048>>12;l=l*Xa-d*qa+2048>>12;d=S;S=h*Ua+u*_a+2048>>12;h=h*_a-u*Ua+2048>>12;u=S;a[e]=n+d;a[e+7]=n-d;a[e+1]=s+u;a[e+6]=s-u;a[e+2]=o+h;a[e+5]=o-h;a[e+3]=c+l;a[e+4]=c-l}else{S=za*f+512>>10;a[e]=S;a[e+1]=S;a[e+2]=S;a[e+3]=S;a[e+4]=S;a[e+5]=S;a[e+6]=S;a[e+7]=S}}for(let e=0;e<8;++e){f=a[e];g=a[e+8];p=a[e+16];m=a[e+24];b=a[e+32];y=a[e+40];w=a[e+48];x=a[e+56];if(g|p|m|b|y|w|x){n=za*f+2048>>12;s=za*b+2048>>12;o=p;c=w;l=$a*(g-x)+2048>>12;d=$a*(g+x)+2048>>12;h=m;u=y;n=4112+(n+s+1>>1);s=n-s;S=o*Wa+c*Ha+2048>>12;o=o*Ha-c*Wa+2048>>12;c=S;l=l+u+1>>1;u=l-u;d=d+h+1>>1;h=d-h;n=n+c+1>>1;c=n-c;s=s+o+1>>1;o=s-o;S=l*qa+d*Xa+2048>>12;l=l*Xa-d*qa+2048>>12;d=S;S=h*Ua+u*_a+2048>>12;h=h*_a-u*Ua+2048>>12;u=S;f=n+d;x=n-d;g=s+u;w=s-u;p=o+h;y=o-h;m=c+l;b=c-l;f<16?f=0:f>=4080?f=255:f>>=4;g<16?g=0:g>=4080?g=255:g>>=4;p<16?p=0:p>=4080?p=255:p>>=4;m<16?m=0:m>=4080?m=255:m>>=4;b<16?b=0:b>=4080?b=255:b>>=4;y<16?y=0:y>=4080?y=255:y>>=4;w<16?w=0:w>=4080?w=255:w>>=4;x<16?x=0:x>=4080?x=255:x>>=4;i[t+e]=f;i[t+e+8]=g;i[t+e+16]=p;i[t+e+24]=m;i[t+e+32]=b;i[t+e+40]=y;i[t+e+48]=w;i[t+e+56]=x}else{S=za*f+8192>>14;S=S<-2040?0:S>=2024?255:S+2056>>4;i[t+e]=S;i[t+e+8]=S;i[t+e+16]=S;i[t+e+24]=S;i[t+e+32]=S;i[t+e+40]=S;i[t+e+48]=S;i[t+e+56]=S}}}function buildComponentData(e,t){const a=t.blocksPerLine,r=t.blocksPerColumn,i=new Int16Array(64);for(let e=0;e<r;e++)for(let r=0;r<a;r++){quantizeAndInverse(t,getBlockBufferOffset(t,e,r),i)}return t.blockData}function findNextFileMarker(e,t,a=t){const r=e.length-1;let i=a<t?a:t;if(t>=r)return null;const n=readUint16(e,t);if(n>=65472&&n<=65534)return{invalid:null,marker:n,offset:t};let s=readUint16(e,i);for(;!(s>=65472&&s<=65534);){if(++i>=r)return null;s=readUint16(e,i)}return{invalid:n.toString(16),marker:s,offset:i}}function prepareComponents(e){const t=Math.ceil(e.samplesPerLine/8/e.maxH),a=Math.ceil(e.scanLines/8/e.maxV);for(const r of e.components){const i=Math.ceil(Math.ceil(e.samplesPerLine/8)*r.h/e.maxH),n=Math.ceil(Math.ceil(e.scanLines/8)*r.v/e.maxV),s=t*r.h,o=64*(a*r.v)*(s+1);r.blockData=new Int16Array(o);r.blocksPerLine=i;r.blocksPerColumn=n}e.mcusPerLine=t;e.mcusPerColumn=a}function readDataBlock(e,t){const a=readUint16(e,t);let r=(t+=2)+a-2;const i=findNextFileMarker(e,r,t);if(i?.invalid){warn("readDataBlock - incorrect length, current marker is: "+i.invalid);r=i.offset}const n=e.subarray(t,r);return{appData:n,oldOffset:t,newOffset:t+n.length}}function skipData(e,t){const a=readUint16(e,t),r=(t+=2)+a-2,i=findNextFileMarker(e,r,t);return i?.invalid?i.offset:r}class JpegImage{constructor({decodeTransform:e=null,colorTransform:t=-1}={}){this._decodeTransform=e;this._colorTransform=t}static canUseImageDecoder(e,t=-1){let a=null,r=0,i=null,n=readUint16(e,r);r+=2;if(65496!==n)throw new JpegError("SOI not found");n=readUint16(e,r);r+=2;e:for(;65497!==n;){switch(n){case 65505:const{appData:t,oldOffset:s,newOffset:o}=readDataBlock(e,r);r=o;if(69===t[0]&&120===t[1]&&105===t[2]&&102===t[3]&&0===t[4]&&0===t[5]){if(a)throw new JpegError("Duplicate EXIF-blocks found.");a={exifStart:s+6,exifEnd:o}}n=readUint16(e,r);r+=2;continue;case 65472:case 65473:case 65474:i=e[r+7];break e;case 65535:255!==e[r]&&r--}r=skipData(e,r);n=readUint16(e,r);r+=2}return 4===i||3===i&&0===t?null:a||{}}parse(e,{dnlScanLines:t=null}={}){let a,r,i=0,n=null,s=null,o=0;const c=[],l=[],h=[];let u=readUint16(e,i);i+=2;if(65496!==u)throw new JpegError("SOI not found");u=readUint16(e,i);i+=2;e:for(;65497!==u;){let d,f,g;switch(u){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:const{appData:p,newOffset:m}=readDataBlock(e,i);i=m;65504===u&&74===p[0]&&70===p[1]&&73===p[2]&&70===p[3]&&0===p[4]&&(n={version:{major:p[5],minor:p[6]},densityUnits:p[7],xDensity:p[8]<<8|p[9],yDensity:p[10]<<8|p[11],thumbWidth:p[12],thumbHeight:p[13],thumbData:p.subarray(14,14+3*p[12]*p[13])});65518===u&&65===p[0]&&100===p[1]&&111===p[2]&&98===p[3]&&101===p[4]&&(s={version:p[5]<<8|p[6],flags0:p[7]<<8|p[8],flags1:p[9]<<8|p[10],transformCode:p[11]});break;case 65499:const b=readUint16(e,i);i+=2;const y=b+i-2;let w;for(;i<y;){const t=e[i++],a=new Uint16Array(64);if(t>>4){if(t>>4!=1)throw new JpegError("DQT - invalid table spec");for(f=0;f<64;f++){w=ja[f];a[w]=readUint16(e,i);i+=2}}else for(f=0;f<64;f++){w=ja[f];a[w]=e[i++]}c[15&t]=a}break;case 65472:case 65473:case 65474:if(a)throw new JpegError("Only single frame JPEGs supported");i+=2;a={};a.extended=65473===u;a.progressive=65474===u;a.precision=e[i++];const x=readUint16(e,i);i+=2;a.scanLines=t||x;a.samplesPerLine=readUint16(e,i);i+=2;a.components=[];a.componentIds={};const S=e[i++];let k=0,C=0;for(d=0;d<S;d++){const t=e[i],r=e[i+1]>>4,n=15&e[i+1];k<r&&(k=r);C<n&&(C=n);const s=e[i+2];g=a.components.push({h:r,v:n,quantizationId:s,quantizationTable:null});a.componentIds[t]=g-1;i+=3}a.maxH=k;a.maxV=C;prepareComponents(a);break;case 65476:const v=readUint16(e,i);i+=2;for(d=2;d<v;){const t=e[i++],a=new Uint8Array(16);let r=0;for(f=0;f<16;f++,i++)r+=a[f]=e[i];const n=new Uint8Array(r);for(f=0;f<r;f++,i++)n[f]=e[i];d+=17+r;(t>>4?l:h)[15&t]=buildHuffmanTable(a,n)}break;case 65501:i+=2;r=readUint16(e,i);i+=2;break;case 65498:const F=1==++o&&!t;i+=2;const T=e[i++],O=[];for(d=0;d<T;d++){const t=e[i++],r=a.componentIds[t],n=a.components[r];n.index=t;const s=e[i++];n.huffmanTableDC=h[s>>4];n.huffmanTableAC=l[15&s];O.push(n)}const M=e[i++],D=e[i++],R=e[i++];try{i+=decodeScan(e,i,a,O,r,M,D,R>>4,15&R,F)}catch(t){if(t instanceof DNLMarkerError){warn(`${t.message} -- attempting to re-parse the JPEG image.`);return this.parse(e,{dnlScanLines:t.scanLines})}if(t instanceof EOIMarkerError){warn(`${t.message} -- ignoring the rest of the image data.`);break e}throw t}break;case 65500:i+=4;break;case 65535:255!==e[i]&&i--;break;default:const N=findNextFileMarker(e,i-2,i-3);if(N?.invalid){warn("JpegImage.parse - unexpected data, current marker is: "+N.invalid);i=N.offset;break}if(!N||i>=e.length-1){warn("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new JpegError("JpegImage.parse - unknown marker: "+u.toString(16))}u=readUint16(e,i);i+=2}if(!a)throw new JpegError("JpegImage.parse - no frame data found.");this.width=a.samplesPerLine;this.height=a.scanLines;this.jfif=n;this.adobe=s;this.components=[];for(const e of a.components){const t=c[e.quantizationId];t&&(e.quantizationTable=t);this.components.push({index:e.index,output:buildComponentData(0,e),scaleX:e.h/a.maxH,scaleY:e.v/a.maxV,blocksPerLine:e.blocksPerLine,blocksPerColumn:e.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(e,t,a=!1){const r=this.width/e,i=this.height/t;let n,s,o,c,l,h,u,d,f,g,p,m=0;const b=this.components.length,y=e*t*b,w=new Uint8ClampedArray(y),x=new Uint32Array(e),S=4294967288;let k;for(u=0;u<b;u++){n=this.components[u];s=n.scaleX*r;o=n.scaleY*i;m=u;p=n.output;c=n.blocksPerLine+1<<3;if(s!==k){for(l=0;l<e;l++){d=0|l*s;x[l]=(d&S)<<3|7&d}k=s}for(h=0;h<t;h++){d=0|h*o;g=c*(d&S)|(7&d)<<3;for(l=0;l<e;l++){w[m]=p[g+x[l]];m+=b}}}let C=this._decodeTransform;a||4!==b||C||(C=new Int32Array([-256,255,-256,255,-256,255,-256,255]));if(C)for(u=0;u<y;)for(d=0,f=0;d<b;d++,u++,f+=2)w[u]=(w[u]*C[f]>>8)+C[f+1];return w}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform}_convertYccToRgb(e){let t,a,r;for(let i=0,n=e.length;i<n;i+=3){t=e[i];a=e[i+1];r=e[i+2];e[i]=t-179.456+1.402*r;e[i+1]=t+135.459-.344*a-.714*r;e[i+2]=t-226.816+1.772*a}return e}_convertYccToRgba(e,t){for(let a=0,r=0,i=e.length;a<i;a+=3,r+=4){const i=e[a],n=e[a+1],s=e[a+2];t[r]=i-179.456+1.402*s;t[r+1]=i+135.459-.344*n-.714*s;t[r+2]=i-226.816+1.772*n;t[r+3]=255}return t}_convertYcckToRgb(e){this._convertYcckToCmyk(e);return this._convertCmykToRgb(e)}_convertYcckToRgba(e){this._convertYcckToCmyk(e);return this._convertCmykToRgba(e)}_convertYcckToCmyk(e){let t,a,r;for(let i=0,n=e.length;i<n;i+=4){t=e[i];a=e[i+1];r=e[i+2];e[i]=434.456-t-1.402*r;e[i+1]=119.541-t+.344*a+.714*r;e[i+2]=481.816-t-1.772*a}return e}_convertCmykToRgb(e){const t=e.length/4;ColorSpaceUtils.cmyk.getRgbBuffer(e,0,t,e,0,8,0);return e.subarray(0,3*t)}_convertCmykToRgba(e){ColorSpaceUtils.cmyk.getRgbBuffer(e,0,e.length/4,e,0,8,1);if(ColorSpaceUtils.cmyk instanceof DeviceCmykCS)for(let t=3,a=e.length;t<a;t+=4)e[t]=255;return e}getData({width:e,height:t,forceRGBA:a=!1,forceRGB:r=!1,isSourcePDF:i=!1}){if(this.numComponents>4)throw new JpegError("Unsupported color mode");const n=this._getLinearizedBlockData(e,t,i);if(1===this.numComponents&&(a||r)){const e=n.length*(a?4:3),t=new Uint8ClampedArray(e);let r=0;if(a)!function grayToRGBA(e,t){if(FeatureTest.isLittleEndian)for(let a=0,r=e.length;a<r;a++)t[a]=65793*e[a]|4278190080;else for(let a=0,r=e.length;a<r;a++)t[a]=16843008*e[a]|255}(n,new Uint32Array(t.buffer));else for(const e of n){t[r++]=e;t[r++]=e;t[r++]=e}return t}if(3===this.numComponents&&this._isColorConversionNeeded){if(a){const e=new Uint8ClampedArray(n.length/3*4);return this._convertYccToRgba(n,e)}return this._convertYccToRgb(n)}if(4===this.numComponents){if(this._isColorConversionNeeded)return a?this._convertYcckToRgba(n):r?this._convertYcckToRgb(n):this._convertYcckToCmyk(n);if(a)return this._convertCmykToRgba(n);if(r)return this._convertCmykToRgb(n)}return n}}class JpegStream extends DecodeStream{static#M=FeatureTest.isImageDecoderSupported;constructor(e,t,a){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}static get canUseImageDecoder(){return shadow(this,"canUseImageDecoder",this.#M?ImageDecoder.isTypeSupported("image/jpeg"):Promise.resolve(!1))}static setOptions({isImageDecoderSupported:e=!1}){this.#M=e}get bytes(){return shadow(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}get jpegOptions(){const e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray("D","Decode");if((this.forceRGBA||this.forceRGB)&&Array.isArray(t)){const a=this.dict.get("BPC","BitsPerComponent")||8,r=t.length,i=new Int32Array(r);let n=!1;const s=(1<<a)-1;for(let e=0;e<r;e+=2){i[e]=256*(t[e+1]-t[e])|0;i[e+1]=t[e]*s|0;256===i[e]&&0===i[e+1]||(n=!0)}n&&(e.decodeTransform=i)}if(this.params instanceof Dict){const t=this.params.get("ColorTransform");Number.isInteger(t)&&(e.colorTransform=t)}return shadow(this,"jpegOptions",e)}#N(e){for(let t=0,a=e.length-1;t<a;t++)if(255===e[t]&&216===e[t+1]){t>0&&(e=e.subarray(t));break}return e}decodeImage(e){if(this.eof)return this.buffer;e=this.#N(e||this.bytes);const t=new JpegImage(this.jpegOptions);t.parse(e);const a=t.getData({width:this.drawWidth,height:this.drawHeight,forceRGBA:this.forceRGBA,forceRGB:this.forceRGB,isSourcePDF:!0});this.buffer=a;this.bufferLength=a.length;this.eof=!0;return this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}async getTransferableImage(){if(!await JpegStream.canUseImageDecoder)return null;const e=this.jpegOptions;if(e.decodeTransform)return null;let t;try{const a=this.canAsyncDecodeImageFromBuffer&&await this.stream.asyncGetBytes()||this.bytes;if(!a)return null;let r=this.#N(a);const i=JpegImage.canUseImageDecoder(r,e.colorTransform);if(!i)return null;if(i.exifStart){r=r.slice();r.fill(0,i.exifStart,i.exifEnd)}t=new ImageDecoder({data:r,type:"image/jpeg",preferAnimation:!1});return(await t.decode()).image}catch(e){warn(`getTransferableImage - failed: "${e}".`);return null}finally{t?.close()}}}var OpenJPEG=async function(e={}){var t,a,r=e,i=new Promise(((e,r)=>{t=e;a=r})),n="./this.program",quit_=(e,t)=>{throw t},s=import.meta.url;try{new URL(".",s).href}catch{}var o,c,l,h,u,d,f=console.log.bind(console),g=console.error.bind(console),p=!1;function updateMemoryViews(){var e=o.buffer;l=new Int8Array(e);new Int16Array(e);h=new Uint8Array(e);new Uint16Array(e);u=new Int32Array(e);d=new Uint32Array(e);new Float32Array(e);new Float64Array(e);new BigInt64Array(e);new BigUint64Array(e)}var m=0,b=null;class ExitStatus{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`;this.status=e}}var callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(r)},y=[],addOnPostRun=e=>y.push(e),w=[],addOnPreRun=e=>w.push(e),x=!0,S=0,k={},handleException=e=>{if(e instanceof ExitStatus||"unwind"==e)return c;quit_(0,e)},keepRuntimeAlive=()=>x||S>0,_proc_exit=e=>{c=e;if(!keepRuntimeAlive()){r.onExit?.(e);p=!0}quit_(0,new ExitStatus(e))},_exit=(e,t)=>{c=e;_proc_exit(e)},callUserCallback=e=>{if(!p)try{e();(()=>{if(!keepRuntimeAlive())try{_exit(c)}catch(e){handleException(e)}})()}catch(e){handleException(e)}},growMemory=e=>{var t=(e-o.buffer.byteLength+65535)/65536|0;try{o.grow(t);updateMemoryViews();return 1}catch(e){}},C={},getEnvStrings=()=>{if(!getEnvStrings.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:n||"./this.program"};for(var t in C)void 0===C[t]?delete e[t]:e[t]=C[t];var a=[];for(var t in e)a.push(`${t}=${e[t]}`);getEnvStrings.strings=a}return getEnvStrings.strings},lengthBytesUTF8=e=>{for(var t=0,a=0;a<e.length;++a){var r=e.charCodeAt(a);if(r<=127)t++;else if(r<=2047)t+=2;else if(r>=55296&&r<=57343){t+=4;++a}else t+=3}return t},v=[null,[],[]],F="undefined"!=typeof TextDecoder?new TextDecoder:void 0,UTF8ArrayToString=(e,t=0,a=NaN)=>{for(var r=t+a,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&F)return F.decode(e.subarray(t,i));for(var n="";t<i;){var s=e[t++];if(128&s){var o=63&e[t++];if(192!=(224&s)){var c=63&e[t++];if((s=224==(240&s)?(15&s)<<12|o<<6|c:(7&s)<<18|o<<12|c<<6|63&e[t++])<65536)n+=String.fromCharCode(s);else{var l=s-65536;n+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else n+=String.fromCharCode((31&s)<<6|o)}else n+=String.fromCharCode(s)}return n},printChar=(e,t)=>{var a=v[e];if(0===t||10===t){(1===e?f:g)(UTF8ArrayToString(a));a.length=0}else a.push(t)},UTF8ToString=(e,t)=>e?UTF8ArrayToString(h,e,t):"";r.noExitRuntime&&(x=r.noExitRuntime);r.print&&(f=r.print);r.printErr&&(g=r.printErr);r.wasmBinary&&r.wasmBinary;r.arguments&&r.arguments;r.thisProgram&&(n=r.thisProgram);r.writeArrayToMemory=(e,t)=>{l.set(e,t)};var T={l:()=>function abort(e){r.onAbort?.(e);g(e="Aborted("+e+")");p=!0;e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);a(t);throw t}(""),k:()=>{x=!1;S=0},m:(e,t)=>{if(k[e]){clearTimeout(k[e].id);delete k[e]}if(!t)return 0;var a=setTimeout((()=>{delete k[e];callUserCallback((()=>M(e,performance.now())))}),t);k[e]={id:a,timeout_ms:t};return 0},g:function _copy_pixels_1(e,t){e>>=2;const a=r.imageData=new Uint8ClampedArray(t),i=u.subarray(e,e+t);a.set(i)},f:function _copy_pixels_3(e,t,a,i){e>>=2;t>>=2;a>>=2;const n=r.imageData=new Uint8ClampedArray(3*i),s=u.subarray(e,e+i),o=u.subarray(t,t+i),c=u.subarray(a,a+i);for(let e=0;e<i;e++){n[3*e]=s[e];n[3*e+1]=o[e];n[3*e+2]=c[e]}},e:function _copy_pixels_4(e,t,a,i,n){e>>=2;t>>=2;a>>=2;i>>=2;const s=r.imageData=new Uint8ClampedArray(4*n),o=u.subarray(e,e+n),c=u.subarray(t,t+n),l=u.subarray(a,a+n),h=u.subarray(i,i+n);for(let e=0;e<n;e++){s[4*e]=o[e];s[4*e+1]=c[e];s[4*e+2]=l[e];s[4*e+3]=h[e]}},n:e=>{var t,a,r=h.length,i=2147483648;if((e>>>=0)>i)return!1;for(var n=1;n<=4;n*=2){var s=r*(1+.2/n);s=Math.min(s,e+100663296);var o=Math.min(i,(t=Math.max(e,s),a=65536,Math.ceil(t/a)*a));if(growMemory(o))return!0}return!1},p:(e,t)=>{var a=0,r=0;for(var i of getEnvStrings()){var n=t+a;d[e+r>>2]=n;a+=((e,t,a,r)=>{if(!(r>0))return 0;for(var i=a,n=a+r-1,s=0;s<e.length;++s){var o=e.charCodeAt(s);o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++s));if(o<=127){if(a>=n)break;t[a++]=o}else if(o<=2047){if(a+1>=n)break;t[a++]=192|o>>6;t[a++]=128|63&o}else if(o<=65535){if(a+2>=n)break;t[a++]=224|o>>12;t[a++]=128|o>>6&63;t[a++]=128|63&o}else{if(a+3>=n)break;t[a++]=240|o>>18;t[a++]=128|o>>12&63;t[a++]=128|o>>6&63;t[a++]=128|63&o}}t[a]=0;return a-i})(i,h,n,1/0)+1;r+=4}return 0},q:(e,t)=>{var a=getEnvStrings();d[e>>2]=a.length;var r=0;for(var i of a)r+=lengthBytesUTF8(i)+1;d[t>>2]=r;return 0},b:e=>52,o:function _fd_seek(e,t,a,r){t=(i=t)<-9007199254740992||i>9007199254740992?NaN:Number(i);var i;return 70},c:(e,t,a,r)=>{for(var i=0,n=0;n<a;n++){var s=d[t>>2],o=d[t+4>>2];t+=8;for(var c=0;c<o;c++)printChar(e,h[s+c]);i+=o}d[r>>2]=i;return 0},r:function _gray_to_rgba(e,t){e>>=2;const a=r.imageData=new Uint8ClampedArray(4*t),i=u.subarray(e,e+t);for(let e=0;e<t;e++){a[4*e]=a[4*e+1]=a[4*e+2]=i[e];a[4*e+3]=255}},i:function _graya_to_rgba(e,t,a){e>>=2;t>>=2;const i=r.imageData=new Uint8ClampedArray(4*a),n=u.subarray(e,e+a),s=u.subarray(t,t+a);for(let e=0;e<a;e++){i[4*e]=i[4*e+1]=i[4*e+2]=n[e];i[4*e+3]=s[e]}},d:function _jsPrintWarning(e){const t=UTF8ToString(e);(r.warn||console.warn)(`OpenJPEG: ${t}`)},j:_proc_exit,h:function _rgb_to_rgba(e,t,a,i){e>>=2;t>>=2;a>>=2;const n=r.imageData=new Uint8ClampedArray(4*i),s=u.subarray(e,e+i),o=u.subarray(t,t+i),c=u.subarray(a,a+i);for(let e=0;e<i;e++){n[4*e]=s[e];n[4*e+1]=o[e];n[4*e+2]=c[e];n[4*e+3]=255}},a:function _storeErrorMessage(e){const t=UTF8ToString(e);r.errorMessages?r.errorMessages+="\\n"+t:r.errorMessages=t}},O=await async function createWasm(){function receiveInstance(e,t){O=e.exports;o=O.s;updateMemoryViews();!function removeRunDependency(e){m--;r.monitorRunDependencies?.(m);if(0==m&&b){var t=b;b=null;t()}}();return O}!function addRunDependency(e){m++;r.monitorRunDependencies?.(m)}();var e=function getWasmImports(){return{a:T}}();return new Promise(((t,a)=>{r.instantiateWasm(e,((e,a)=>{t(receiveInstance(e))}))}))}(),M=(O.t,r._malloc=O.u,r._free=O.v,r._jp2_decode=O.w,O.x);!function preInit(){if(r.preInit){"function"==typeof r.preInit&&(r.preInit=[r.preInit]);for(;r.preInit.length>0;)r.preInit.shift()()}}();!function run(){if(m>0)b=run;else{!function preRun(){if(r.preRun){"function"==typeof r.preRun&&(r.preRun=[r.preRun]);for(;r.preRun.length;)addOnPreRun(r.preRun.shift())}callRuntimeCallbacks(w)}();if(m>0)b=run;else if(r.setStatus){r.setStatus("Running...");setTimeout((()=>{setTimeout((()=>r.setStatus("")),1);doRun()}),1)}else doRun()}function doRun(){r.calledRun=!0;if(!p){!function initRuntime(){O.t()}();t(r);r.onRuntimeInitialized?.();!function postRun(){if(r.postRun){"function"==typeof r.postRun&&(r.postRun=[r.postRun]);for(;r.postRun.length;)addOnPostRun(r.postRun.shift())}callRuntimeCallbacks(y)}()}}}();return i};const Ga=OpenJPEG;class JpxError extends fa{constructor(e){super(e,"JpxError")}}class JpxImage{static#E=null;static#P=null;static#L=null;static#v=!0;static#j=!0;static#F=null;static setOptions({handler:e,useWasm:t,useWorkerFetch:a,wasmUrl:r}){this.#v=t;this.#j=a;this.#F=r;a||(this.#P=e)}static async#_(e){const t=`${this.#F}openjpeg_nowasm_fallback.js`;let a=null;try{a=(await import(\n/*webpackIgnore: true*/\n/*@vite-ignore*/\nt)).default()}catch(e){warn(`JpxImage#getJsModule: ${e}`)}e(a)}static async#U(e,t,a){const r="openjpeg.wasm";try{this.#E||(this.#j?this.#E=await fetchBinaryData(`${this.#F}${r}`):this.#E=await this.#P.sendWithPromise("FetchBinaryData",{type:"wasmFactory",filename:r}));return a((await WebAssembly.instantiate(this.#E,t)).instance)}catch(t){warn(`JpxImage#instantiateWasm: ${t}`);this.#_(e);return null}finally{this.#P=null}}static async decode(e,{numComponents:t=4,isIndexedColormap:a=!1,smaskInData:r=!1,reducePower:i=0}={}){if(!this.#L){const{promise:e,resolve:t}=Promise.withResolvers(),a=[e];this.#v?a.push(Ga({warn,instantiateWasm:this.#U.bind(this,t)})):this.#_(t);this.#L=Promise.race(a)}const n=await this.#L;if(!n)throw new JpxError("OpenJPEG failed to initialize");let s;try{const o=e.length;s=n._malloc(o);n.writeArrayToMemory(e,s);if(n._jp2_decode(s,o,t>0?t:0,!!a,!!r,i)){const{errorMessages:e}=n;if(e){delete n.errorMessages;throw new JpxError(e)}throw new JpxError("Unknown error")}const{imageData:c}=n;n.imageData=null;return c}finally{s&&n._free(s)}}static cleanup(){this.#L=null}static parseImageProperties(e){let t=e.getByte();for(;t>=0;){const a=t;t=e.getByte();if(65361===(a<<8|t)){e.skip(4);const t=e.getInt32()>>>0,a=e.getInt32()>>>0,r=e.getInt32()>>>0,i=e.getInt32()>>>0;e.skip(16);return{width:t-r,height:a-i,bitsPerComponent:8,componentsCount:e.getUint16()}}}throw new JpxError("No size marker found in JPX stream")}}function addState(e,t,a,r,i){let n=e;for(let e=0,a=t.length-1;e<a;e++){const a=t[e];n=n[a]||=[]}n[t.at(-1)]={checkFn:a,iterateFn:r,processFn:i}}const Va=[];addState(Va,[Be,Ne,Yt,Re],null,(function iterateInlineImageGroup(e,t){const a=e.fnArray,r=(t-(e.iCurr-3))%4;switch(r){case 0:return a[t]===Be;case 1:return a[t]===Ne;case 2:return a[t]===Yt;case 3:return a[t]===Re}throw new Error(`iterateInlineImageGroup - invalid pos: ${r}`)}),(function foundInlineImageGroup(e,t){const a=e.fnArray,r=e.argsArray,i=e.iCurr,n=i-3,s=i-2,o=i-1,c=Math.min(Math.floor((t-n)/4),200);if(c<10)return t-(t-n)%4;let l=0;const h=[];let u=0,d=1,f=1;for(let e=0;e<c;e++){const t=r[s+(e<<2)],a=r[o+(e<<2)][0];if(d+a.width>1e3){l=Math.max(l,d);f+=u+2;d=0;u=0}h.push({transform:t,x:d,y:f,w:a.width,h:a.height});d+=a.width+2;u=Math.max(u,a.height)}const g=Math.max(l,d)+1,p=f+u+1,m=new Uint8Array(g*p*4),b=g<<2;for(let e=0;e<c;e++){const t=r[o+(e<<2)][0].data,a=h[e].w<<2;let i=0,n=h[e].x+h[e].y*g<<2;m.set(t.subarray(0,a),n-b);for(let r=0,s=h[e].h;r<s;r++){m.set(t.subarray(i,i+a),n);i+=a;n+=b}m.set(t.subarray(i-a,i),n);for(;n>=0;){t[n-4]=t[n];t[n-3]=t[n+1];t[n-2]=t[n+2];t[n-1]=t[n+3];t[n+a]=t[n+a-4];t[n+a+1]=t[n+a-3];t[n+a+2]=t[n+a-2];t[n+a+3]=t[n+a-1];n-=b}}const y={width:g,height:p};if(e.isOffscreenCanvasSupported){const e=new OffscreenCanvas(g,p);e.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(m.buffer),g,p),0,0);y.bitmap=e.transferToImageBitmap();y.data=null}else{y.kind=v;y.data=m}a.splice(n,4*c,Zt);r.splice(n,4*c,[y,h]);return n+1}));addState(Va,[Be,Ne,Vt,Re],null,(function iterateImageMaskGroup(e,t){const a=e.fnArray,r=(t-(e.iCurr-3))%4;switch(r){case 0:return a[t]===Be;case 1:return a[t]===Ne;case 2:return a[t]===Vt;case 3:return a[t]===Re}throw new Error(`iterateImageMaskGroup - invalid pos: ${r}`)}),(function foundImageMaskGroup(e,t){const a=e.fnArray,r=e.argsArray,i=e.iCurr,n=i-3,s=i-2,o=i-1;let c=Math.floor((t-n)/4);if(c<10)return t-(t-n)%4;let l,h,u=!1;const d=r[o][0],f=r[s][0],g=r[s][1],p=r[s][2],m=r[s][3];if(g===p){u=!0;l=s+4;let e=o+4;for(let t=1;t<c;t++,l+=4,e+=4){h=r[l];if(r[e][0]!==d||h[0]!==f||h[1]!==g||h[2]!==p||h[3]!==m){t<10?u=!1:c=t;break}}}if(u){c=Math.min(c,1e3);const e=new Float32Array(2*c);l=s;for(let t=0;t<c;t++,l+=4){h=r[l];e[t<<1]=h[4];e[1+(t<<1)]=h[5]}a.splice(n,4*c,ea);r.splice(n,4*c,[d,f,g,p,m,e])}else{c=Math.min(c,100);const e=[];for(let t=0;t<c;t++){h=r[s+(t<<2)];const a=r[o+(t<<2)][0];e.push({data:a.data,width:a.width,height:a.height,interpolate:a.interpolate,count:a.count,transform:h})}a.splice(n,4*c,Kt);r.splice(n,4*c,[e])}return n+1}));addState(Va,[Be,Ne,Jt,Re],(function(e){const t=e.argsArray,a=e.iCurr-2;return 0===t[a][1]&&0===t[a][2]}),(function iterateImageGroup(e,t){const a=e.fnArray,r=e.argsArray,i=(t-(e.iCurr-3))%4;switch(i){case 0:return a[t]===Be;case 1:if(a[t]!==Ne)return!1;const i=e.iCurr-2,n=r[i][0],s=r[i][3];return r[t][0]===n&&0===r[t][1]&&0===r[t][2]&&r[t][3]===s;case 2:if(a[t]!==Jt)return!1;const o=r[e.iCurr-1][0];return r[t][0]===o;case 3:return a[t]===Re}throw new Error(`iterateImageGroup - invalid pos: ${i}`)}),(function(e,t){const a=e.fnArray,r=e.argsArray,i=e.iCurr,n=i-3,s=i-2,o=r[i-1][0],c=r[s][0],l=r[s][3],h=Math.min(Math.floor((t-n)/4),1e3);if(h<3)return t-(t-n)%4;const u=new Float32Array(2*h);let d=s;for(let e=0;e<h;e++,d+=4){const t=r[d];u[e<<1]=t[4];u[1+(e<<1)]=t[5]}const f=[o,c,l,u];a.splice(n,4*h,Qt);r.splice(n,4*h,f);return n+1}));addState(Va,[Qe,nt,ht,dt,et],null,(function iterateShowTextGroup(e,t){const a=e.fnArray,r=e.argsArray,i=(t-(e.iCurr-4))%5;switch(i){case 0:return a[t]===Qe;case 1:return a[t]===nt;case 2:return a[t]===ht;case 3:if(a[t]!==dt)return!1;const i=e.iCurr-3,n=r[i][0],s=r[i][1];return r[t][0]===n&&r[t][1]===s;case 4:return a[t]===et}throw new Error(`iterateShowTextGroup - invalid pos: ${i}`)}),(function(e,t){const a=e.fnArray,r=e.argsArray,i=e.iCurr,n=i-4,s=i-3,o=i-2,c=i-1,l=i,h=r[s][0],u=r[s][1];let d=Math.min(Math.floor((t-n)/5),1e3);if(d<3)return t-(t-n)%5;let f=n;if(n>=4&&a[n-4]===a[s]&&a[n-3]===a[o]&&a[n-2]===a[c]&&a[n-1]===a[l]&&r[n-4][0]===h&&r[n-4][1]===u){d++;f-=5}let g=f+4;for(let e=1;e<d;e++){a.splice(g,3);r.splice(g,3);g+=2}return g+1}));addState(Va,[Be,Ne,aa,Re],(e=>{const t=e.argsArray,a=t[e.iCurr-1][0];if(a!==qe&&a!==He&&a!==$e&&a!==Ge&&a!==Ve&&a!==Ke)return!0;const r=t[e.iCurr-2];return 1===r[0]&&0===r[1]&&0===r[2]&&1===r[3]}),(()=>!1),((e,t)=>{const{fnArray:a,argsArray:r}=e,i=e.iCurr,n=i-3,s=i-2,o=r[i-1],c=r[s],[,[l],h]=o;if(h){Util.scaleMinMax(c,h);for(let e=0,t=l.length;e<t;)switch(l[e++]){case sa:case oa:Util.applyTransform(l,c,e);e+=2;break;case ca:Util.applyTransformToBezier(l,c,e);e+=6}}a.splice(n,4,aa);r.splice(n,4,o);return n+1}));class NullOptimizer{constructor(e){this.queue=e}_optimize(){}push(e,t){this.queue.fnArray.push(e);this.queue.argsArray.push(t);this._optimize()}flush(){}reset(){}}class QueueOptimizer extends NullOptimizer{constructor(e){super(e);this.state=null;this.context={iCurr:0,fnArray:e.fnArray,argsArray:e.argsArray,isOffscreenCanvasSupported:OperatorList.isOffscreenCanvasSupported};this.match=null;this.lastProcessed=0}_optimize(){const e=this.queue.fnArray;let t=this.lastProcessed,a=e.length,r=this.state,i=this.match;if(!r&&!i&&t+1===a&&!Va[e[t]]){this.lastProcessed=a;return}const n=this.context;for(;t<a;){if(i){if((0,i.iterateFn)(n,t)){t++;continue}t=(0,i.processFn)(n,t+1);a=e.length;i=null;r=null;if(t>=a)break}r=(r||Va)[e[t]];if(r&&!Array.isArray(r)){n.iCurr=t;t++;if(!r.checkFn||(0,r.checkFn)(n)){i=r;r=null}else r=null}else t++}this.state=r;this.match=i;this.lastProcessed=t}flush(){for(;this.match;){const e=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,e);this.match=null;this.state=null;this._optimize()}}reset(){this.state=null;this.match=null;this.lastProcessed=0}}class OperatorList{static CHUNK_SIZE=1e3;static CHUNK_SIZE_ABOUT=this.CHUNK_SIZE-5;static isOffscreenCanvasSupported=!1;constructor(e=0,t){this._streamSink=t;this.fnArray=[];this.argsArray=[];this.optimizer=!t||e&d?new NullOptimizer(this):new QueueOptimizer(this);this.dependencies=new Set;this._totalLength=0;this.weight=0;this._resolved=t?null:Promise.resolve()}static setOptions({isOffscreenCanvasSupported:e}){this.isOffscreenCanvasSupported=e}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(e,t){this.optimizer.push(e,t);this.weight++;this._streamSink&&(this.weight>=OperatorList.CHUNK_SIZE||this.weight>=OperatorList.CHUNK_SIZE_ABOUT&&(e===Re||e===et))&&this.flush()}addImageOps(e,t,a,r=!1){if(r){this.addOp(Be);this.addOp(De,[[["SMask",!1]]])}void 0!==a&&this.addOp(jt,["OC",a]);this.addOp(e,t);void 0!==a&&this.addOp(_t,[]);r&&this.addOp(Re)}addDependency(e){if(!this.dependencies.has(e)){this.dependencies.add(e);this.addOp(ke,[e])}}addDependencies(e){for(const t of e)this.addDependency(t)}addOpList(e){if(e instanceof OperatorList){for(const t of e.dependencies)this.dependencies.add(t);for(let t=0,a=e.length;t<a;t++)this.addOp(e.fnArray[t],e.argsArray[t])}else warn(\'addOpList - ignoring invalid "opList" parameter.\')}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){const e=[],{fnArray:t,argsArray:a,length:r}=this;for(let i=0;i<r;i++)switch(t[i]){case Yt:case Zt:case Vt:{const{bitmap:t,data:r}=a[i][0];(t||r?.buffer)&&e.push(t||r.buffer);break}case aa:{const[,[t],r]=a[i];t&&e.push(t.buffer,r.buffer);break}case qt:const[t,r]=a[i];t&&e.push(t.buffer);r&&e.push(r.buffer);break;case ht:e.push(a[i][0].buffer)}return e}flush(e=!1,t=null){this.optimizer.flush();const a=this.length;this._totalLength+=a;this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:e,separateAnnots:t,length:a},1,this._transfers);this.dependencies.clear();this.fnArray.length=0;this.argsArray.length=0;this.weight=0;this.optimizer.reset()}}function hexToInt(e,t){let a=0;for(let r=0;r<=t;r++)a=a<<8|e[r];return a>>>0}function hexToStr(e,t){return 1===t?String.fromCharCode(e[0],e[1]):3===t?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode(...e.subarray(0,t+1))}function addHex(e,t,a){let r=0;for(let i=a;i>=0;i--){r+=e[i]+t[i];e[i]=255&r;r>>=8}}function incHex(e,t){let a=1;for(let r=t;r>=0&&a>0;r--){a+=e[r];e[r]=255&a;a>>=8}}const Ka=16;class BinaryCMapStream{constructor(e){this.buffer=e;this.pos=0;this.end=e.length;this.tmpBuf=new Uint8Array(19)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){let e,t=0;do{const a=this.readByte();if(a<0)throw new FormatError("unexpected EOF in bcmap");e=!(128&a);t=t<<7|127&a}while(!e);return t}readSigned(){const e=this.readNumber();return 1&e?~(e>>>1):e>>>1}readHex(e,t){e.set(this.buffer.subarray(this.pos,this.pos+t+1));this.pos+=t+1}readHexNumber(e,t){let a;const r=this.tmpBuf;let i=0;do{const e=this.readByte();if(e<0)throw new FormatError("unexpected EOF in bcmap");a=!(128&e);r[i++]=127&e}while(!a);let n=t,s=0,o=0;for(;n>=0;){for(;o<8&&r.length>0;){s|=r[--i]<<o;o+=7}e[n]=255&s;n--;s>>=8;o-=8}}readHexSigned(e,t){this.readHexNumber(e,t);const a=1&e[t]?255:0;let r=0;for(let i=0;i<=t;i++){r=(1&r)<<8|e[i];e[i]=r>>1^a}}readString(){const e=this.readNumber(),t=new Array(e);for(let a=0;a<e;a++)t[a]=this.readNumber();return String.fromCharCode(...t)}}class BinaryCMapReader{async process(e,t,a){const r=new BinaryCMapStream(e),i=r.readByte();t.vertical=!!(1&i);let n=null;const s=new Uint8Array(Ka),o=new Uint8Array(Ka),c=new Uint8Array(Ka),l=new Uint8Array(Ka),h=new Uint8Array(Ka);let u,d;for(;(d=r.readByte())>=0;){const e=d>>5;if(7===e){switch(31&d){case 0:r.readString();break;case 1:n=r.readString()}continue}const a=!!(16&d),i=15&d;if(i+1>Ka)throw new Error("BinaryCMapReader.process: Invalid dataSize.");const f=1,g=r.readNumber();switch(e){case 0:r.readHex(s,i);r.readHexNumber(o,i);addHex(o,s,i);t.addCodespaceRange(i+1,hexToInt(s,i),hexToInt(o,i));for(let e=1;e<g;e++){incHex(o,i);r.readHexNumber(s,i);addHex(s,o,i);r.readHexNumber(o,i);addHex(o,s,i);t.addCodespaceRange(i+1,hexToInt(s,i),hexToInt(o,i))}break;case 1:r.readHex(s,i);r.readHexNumber(o,i);addHex(o,s,i);r.readNumber();for(let e=1;e<g;e++){incHex(o,i);r.readHexNumber(s,i);addHex(s,o,i);r.readHexNumber(o,i);addHex(o,s,i);r.readNumber()}break;case 2:r.readHex(c,i);u=r.readNumber();t.mapOne(hexToInt(c,i),u);for(let e=1;e<g;e++){incHex(c,i);if(!a){r.readHexNumber(h,i);addHex(c,h,i)}u=r.readSigned()+(u+1);t.mapOne(hexToInt(c,i),u)}break;case 3:r.readHex(s,i);r.readHexNumber(o,i);addHex(o,s,i);u=r.readNumber();t.mapCidRange(hexToInt(s,i),hexToInt(o,i),u);for(let e=1;e<g;e++){incHex(o,i);if(a)s.set(o);else{r.readHexNumber(s,i);addHex(s,o,i)}r.readHexNumber(o,i);addHex(o,s,i);u=r.readNumber();t.mapCidRange(hexToInt(s,i),hexToInt(o,i),u)}break;case 4:r.readHex(c,f);r.readHex(l,i);t.mapOne(hexToInt(c,f),hexToStr(l,i));for(let e=1;e<g;e++){incHex(c,f);if(!a){r.readHexNumber(h,f);addHex(c,h,f)}incHex(l,i);r.readHexSigned(h,i);addHex(l,h,i);t.mapOne(hexToInt(c,f),hexToStr(l,i))}break;case 5:r.readHex(s,f);r.readHexNumber(o,f);addHex(o,s,f);r.readHex(l,i);t.mapBfRange(hexToInt(s,f),hexToInt(o,f),hexToStr(l,i));for(let e=1;e<g;e++){incHex(o,f);if(a)s.set(o);else{r.readHexNumber(s,f);addHex(s,o,f)}r.readHexNumber(o,f);addHex(o,s,f);r.readHex(l,i);t.mapBfRange(hexToInt(s,f),hexToInt(o,f),hexToStr(l,i))}break;default:throw new Error(`BinaryCMapReader.process - unknown type: ${e}`)}}return n?a(n):t}}class Ascii85Stream extends DecodeStream{constructor(e,t){t&&(t*=.8);super(t);this.str=e;this.dict=e.dict;this.input=new Uint8Array(5)}readBlock(){const e=this.str;let t=e.getByte();for(;isWhiteSpace(t);)t=e.getByte();if(-1===t||126===t){this.eof=!0;return}const a=this.bufferLength;let r,i;if(122===t){r=this.ensureBuffer(a+4);for(i=0;i<4;++i)r[a+i]=0;this.bufferLength+=4}else{const n=this.input;n[0]=t;for(i=1;i<5;++i){t=e.getByte();for(;isWhiteSpace(t);)t=e.getByte();n[i]=t;if(-1===t||126===t)break}r=this.ensureBuffer(a+i-1);this.bufferLength+=i-1;if(i<5){for(;i<5;++i)n[i]=117;this.eof=!0}let s=0;for(i=0;i<5;++i)s=85*s+(n[i]-33);for(i=3;i>=0;--i){r[a+i]=255&s;s>>=8}}}}class AsciiHexStream extends DecodeStream{constructor(e,t){t&&(t*=.5);super(t);this.str=e;this.dict=e.dict;this.firstDigit=-1}readBlock(){const e=this.str.getBytes(8e3);if(!e.length){this.eof=!0;return}const t=e.length+1>>1,a=this.ensureBuffer(this.bufferLength+t);let r=this.bufferLength,i=this.firstDigit;for(const t of e){let e;if(t>=48&&t<=57)e=15&t;else{if(!(t>=65&&t<=70||t>=97&&t<=102)){if(62===t){this.eof=!0;break}continue}e=9+(15&t)}if(i<0)i=e;else{a[r++]=i<<4|e;i=-1}}if(i>=0&&this.eof){a[r++]=i<<4;i=-1}this.firstDigit=i;this.bufferLength=r}}const Ja=-1,Ya=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],Za=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],Qa=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],er=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],tr=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],ar=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];class CCITTFaxDecoder{constructor(e,t={}){if("function"!=typeof e?.next)throw new Error(\'CCITTFaxDecoder - invalid "source" parameter.\');this.source=e;this.eof=!1;this.encoding=t.K||0;this.eoline=t.EndOfLine||!1;this.byteAlign=t.EncodedByteAlign||!1;this.columns=t.Columns||1728;this.rows=t.Rows||0;this.eoblock=t.EndOfBlock??!0;this.black=t.BlackIs1||!1;this.codingLine=new Uint32Array(this.columns+1);this.refLine=new Uint32Array(this.columns+2);this.codingLine[0]=this.columns;this.codingPos=0;this.row=0;this.nextLine2D=this.encoding<0;this.inputBits=0;this.inputBuf=0;this.outputBits=0;this.rowsDone=!1;let a;for(;0===(a=this._lookBits(12));)this._eatBits(1);1===a&&this._eatBits(12);if(this.encoding>0){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}}readNextChar(){if(this.eof)return-1;const e=this.refLine,t=this.codingLine,a=this.columns;let r,i,n,s,o;if(0===this.outputBits){this.rowsDone&&(this.eof=!0);if(this.eof)return-1;this.err=!1;let n,o,c;if(this.nextLine2D){for(s=0;t[s]<a;++s)e[s]=t[s];e[s++]=a;e[s]=a;t[0]=0;this.codingPos=0;r=0;i=0;for(;t[this.codingPos]<a;){n=this._getTwoDimCode();switch(n){case 0:this._addPixels(e[r+1],i);e[r+1]<a&&(r+=2);break;case 1:n=o=0;if(i){do{n+=c=this._getBlackCode()}while(c>=64);do{o+=c=this._getWhiteCode()}while(c>=64)}else{do{n+=c=this._getWhiteCode()}while(c>=64);do{o+=c=this._getBlackCode()}while(c>=64)}this._addPixels(t[this.codingPos]+n,i);t[this.codingPos]<a&&this._addPixels(t[this.codingPos]+o,1^i);for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2;break;case 7:this._addPixels(e[r]+3,i);i^=1;if(t[this.codingPos]<a){++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 5:this._addPixels(e[r]+2,i);i^=1;if(t[this.codingPos]<a){++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 3:this._addPixels(e[r]+1,i);i^=1;if(t[this.codingPos]<a){++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 2:this._addPixels(e[r],i);i^=1;if(t[this.codingPos]<a){++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 8:this._addPixelsNeg(e[r]-3,i);i^=1;if(t[this.codingPos]<a){r>0?--r:++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 6:this._addPixelsNeg(e[r]-2,i);i^=1;if(t[this.codingPos]<a){r>0?--r:++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 4:this._addPixelsNeg(e[r]-1,i);i^=1;if(t[this.codingPos]<a){r>0?--r:++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case Ja:this._addPixels(a,0);this.eof=!0;break;default:info("bad 2d code");this._addPixels(a,0);this.err=!0}}}else{t[0]=0;this.codingPos=0;i=0;for(;t[this.codingPos]<a;){n=0;if(i)do{n+=c=this._getBlackCode()}while(c>=64);else do{n+=c=this._getWhiteCode()}while(c>=64);this._addPixels(t[this.codingPos]+n,i);i^=1}}let l=!1;this.byteAlign&&(this.inputBits&=-8);if(this.eoblock||this.row!==this.rows-1){n=this._lookBits(12);if(this.eoline)for(;n!==Ja&&1!==n;){this._eatBits(1);n=this._lookBits(12)}else for(;0===n;){this._eatBits(1);n=this._lookBits(12)}if(1===n){this._eatBits(12);l=!0}else n===Ja&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}if(this.eoblock&&l&&this.byteAlign){n=this._lookBits(12);if(1===n){this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}if(this.encoding>=0)for(s=0;s<4;++s){n=this._lookBits(12);1!==n&&info("bad rtc code: "+n);this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}}this.eof=!0}}else if(this.err&&this.eoline){for(;;){n=this._lookBits(13);if(n===Ja){this.eof=!0;return-1}if(n>>1==1)break;this._eatBits(1)}this._eatBits(12);if(this.encoding>0){this._eatBits(1);this.nextLine2D=!(1&n)}}this.outputBits=t[0]>0?t[this.codingPos=0]:t[this.codingPos=1];this.row++}if(this.outputBits>=8){o=1&this.codingPos?0:255;this.outputBits-=8;if(0===this.outputBits&&t[this.codingPos]<a){this.codingPos++;this.outputBits=t[this.codingPos]-t[this.codingPos-1]}}else{n=8;o=0;do{if("number"!=typeof this.outputBits)throw new FormatError(\'Invalid /CCITTFaxDecode data, "outputBits" must be a number.\');if(this.outputBits>n){o<<=n;1&this.codingPos||(o|=255>>8-n);this.outputBits-=n;n=0}else{o<<=this.outputBits;1&this.codingPos||(o|=255>>8-this.outputBits);n-=this.outputBits;this.outputBits=0;if(t[this.codingPos]<a){this.codingPos++;this.outputBits=t[this.codingPos]-t[this.codingPos-1]}else if(n>0){o<<=n;n=0}}}while(n)}this.black&&(o^=255);return o}_addPixels(e,t){const a=this.codingLine;let r=this.codingPos;if(e>a[r]){if(e>this.columns){info("row is wrong length");this.err=!0;e=this.columns}1&r^t&&++r;a[r]=e}this.codingPos=r}_addPixelsNeg(e,t){const a=this.codingLine;let r=this.codingPos;if(e>a[r]){if(e>this.columns){info("row is wrong length");this.err=!0;e=this.columns}1&r^t&&++r;a[r]=e}else if(e<a[r]){if(e<0){info("invalid code");this.err=!0;e=0}for(;r>0&&e<a[r-1];)--r;a[r]=e}this.codingPos=r}_findTableCode(e,t,a,r){const i=r||0;for(let r=e;r<=t;++r){let e=this._lookBits(r);if(e===Ja)return[!0,1,!1];r<t&&(e<<=t-r);if(!i||e>=i){const t=a[e-i];if(t[0]===r){this._eatBits(r);return[!0,t[1],!0]}}}return[!1,0,!1]}_getTwoDimCode(){let e,t=0;if(this.eoblock){t=this._lookBits(7);e=Ya[t];if(e?.[0]>0){this._eatBits(e[0]);return e[1]}}else{const e=this._findTableCode(1,7,Ya);if(e[0]&&e[2])return e[1]}info("Bad two dim code");return Ja}_getWhiteCode(){let e,t=0;if(this.eoblock){t=this._lookBits(12);if(t===Ja)return 1;e=t>>5?Qa[t>>3]:Za[t];if(e[0]>0){this._eatBits(e[0]);return e[1]}}else{let e=this._findTableCode(1,9,Qa);if(e[0])return e[1];e=this._findTableCode(11,12,Za);if(e[0])return e[1]}info("bad white code");this._eatBits(1);return 1}_getBlackCode(){let e,t;if(this.eoblock){e=this._lookBits(13);if(e===Ja)return 1;t=e>>7?!(e>>9)&&e>>7?tr[(e>>1)-64]:ar[e>>7]:er[e];if(t[0]>0){this._eatBits(t[0]);return t[1]}}else{let e=this._findTableCode(2,6,ar);if(e[0])return e[1];e=this._findTableCode(7,12,tr,64);if(e[0])return e[1];e=this._findTableCode(10,13,er);if(e[0])return e[1]}info("bad black code");this._eatBits(1);return 1}_lookBits(e){let t;for(;this.inputBits<e;){if(-1===(t=this.source.next()))return 0===this.inputBits?Ja:this.inputBuf<<e-this.inputBits&65535>>16-e;this.inputBuf=this.inputBuf<<8|t;this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e}_eatBits(e){(this.inputBits-=e)<0&&(this.inputBits=0)}}class CCITTFaxStream extends DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;a instanceof Dict||(a=Dict.empty);const r={next:()=>e.getByte()};this.ccittFaxDecoder=new CCITTFaxDecoder(r,{K:a.get("K"),EndOfLine:a.get("EndOfLine"),EncodedByteAlign:a.get("EncodedByteAlign"),Columns:a.get("Columns"),Rows:a.get("Rows"),EndOfBlock:a.get("EndOfBlock"),BlackIs1:a.get("BlackIs1")})}readBlock(){for(;!this.eof;){const e=this.ccittFaxDecoder.readNextChar();if(-1===e){this.eof=!0;return}this.ensureBuffer(this.bufferLength+1);this.buffer[this.bufferLength++]=e}}}const rr=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ir=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),nr=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),sr=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],or=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];class FlateStream extends DecodeStream{constructor(e,t){super(t);this.str=e;this.dict=e.dict;const a=e.getByte(),r=e.getByte();if(-1===a||-1===r)throw new FormatError(`Invalid header in flate stream: ${a}, ${r}`);if(8!=(15&a))throw new FormatError(`Unknown compression method in flate stream: ${a}, ${r}`);if(((a<<8)+r)%31!=0)throw new FormatError(`Bad FCHECK in flate stream: ${a}, ${r}`);if(32&r)throw new FormatError(`FDICT bit set in flate stream: ${a}, ${r}`);this.codeSize=0;this.codeBuf=0}async getImageData(e,t){const a=await this.asyncGetBytes();return a?a.length<=e?a:a.subarray(0,e):this.getBytes(e)}async asyncGetBytes(){this.str.reset();const e=this.str.getBytes();try{const{readable:t,writable:a}=new DecompressionStream("deflate"),r=a.getWriter();await r.ready;r.write(e).then((async()=>{await r.ready;await r.close()})).catch((()=>{}));const i=[];let n=0;for await(const e of t){i.push(e);n+=e.byteLength}const s=new Uint8Array(n);let o=0;for(const e of i){s.set(e,o);o+=e.byteLength}return s}catch{this.str=new Stream(e,2,e.length,this.str.dict);this.reset();return null}}get isAsync(){return!0}getBits(e){const t=this.str;let a,r=this.codeSize,i=this.codeBuf;for(;r<e;){if(-1===(a=t.getByte()))throw new FormatError("Bad encoding in flate stream");i|=a<<r;r+=8}a=i&(1<<e)-1;this.codeBuf=i>>e;this.codeSize=r-=e;return a}getCode(e){const t=this.str,a=e[0],r=e[1];let i,n=this.codeSize,s=this.codeBuf;for(;n<r&&-1!==(i=t.getByte());){s|=i<<n;n+=8}const o=a[s&(1<<r)-1],c=o>>16,l=65535&o;if(c<1||n<c)throw new FormatError("Bad encoding in flate stream");this.codeBuf=s>>c;this.codeSize=n-c;return l}generateHuffmanTable(e){const t=e.length;let a,r=0;for(a=0;a<t;++a)e[a]>r&&(r=e[a]);const i=1<<r,n=new Int32Array(i);for(let s=1,o=0,c=2;s<=r;++s,o<<=1,c<<=1)for(let r=0;r<t;++r)if(e[r]===s){let e=0,t=o;for(a=0;a<s;++a){e=e<<1|1&t;t>>=1}for(a=e;a<i;a+=c)n[a]=s<<16|r;++o}return[n,r]}#X(e){info(e);this.eof=!0}readBlock(){let e,t,a;const r=this.str;try{t=this.getBits(3)}catch(e){this.#X(e.message);return}1&t&&(this.eof=!0);t>>=1;if(0===t){let t;if(-1===(t=r.getByte())){this.#X("Bad block header in flate stream");return}let a=t;if(-1===(t=r.getByte())){this.#X("Bad block header in flate stream");return}a|=t<<8;if(-1===(t=r.getByte())){this.#X("Bad block header in flate stream");return}let i=t;if(-1===(t=r.getByte())){this.#X("Bad block header in flate stream");return}i|=t<<8;if(i!==(65535&~a)&&(0!==a||0!==i))throw new FormatError("Bad uncompressed block length in flate stream");this.codeBuf=0;this.codeSize=0;const n=this.bufferLength,s=n+a;e=this.ensureBuffer(s);this.bufferLength=s;if(0===a)-1===r.peekByte()&&(this.eof=!0);else{const t=r.getBytes(a);e.set(t,n);t.length<a&&(this.eof=!0)}return}let i,n;if(1===t){i=sr;n=or}else{if(2!==t)throw new FormatError("Unknown block type in flate stream");{const e=this.getBits(5)+257,t=this.getBits(5)+1,r=this.getBits(4)+4,s=new Uint8Array(rr.length);let o;for(o=0;o<r;++o)s[rr[o]]=this.getBits(3);const c=this.generateHuffmanTable(s);a=0;o=0;const l=e+t,h=new Uint8Array(l);let u,d,f;for(;o<l;){const e=this.getCode(c);if(16===e){u=2;d=3;f=a}else if(17===e){u=3;d=3;f=a=0}else{if(18!==e){h[o++]=a=e;continue}u=7;d=11;f=a=0}let t=this.getBits(u)+d;for(;t-- >0;)h[o++]=f}i=this.generateHuffmanTable(h.subarray(0,e));n=this.generateHuffmanTable(h.subarray(e,l))}}e=this.buffer;let s=e?e.length:0,o=this.bufferLength;for(;;){let t=this.getCode(i);if(t<256){if(o+1>=s){e=this.ensureBuffer(o+1);s=e.length}e[o++]=t;continue}if(256===t){this.bufferLength=o;return}t-=257;t=ir[t];let r=t>>16;r>0&&(r=this.getBits(r));a=(65535&t)+r;t=this.getCode(n);t=nr[t];r=t>>16;r>0&&(r=this.getBits(r));const c=(65535&t)+r;if(o+a>=s){e=this.ensureBuffer(o+a);s=e.length}for(let t=0;t<a;++t,++o)e[o]=e[o-c]}}}const cr=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];class ArithmeticDecoder{constructor(e,t,a){this.data=e;this.bp=t;this.dataEnd=a;this.chigh=e[t];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&65535|this.clow>>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}byteIn(){const e=this.data;let t=this.bp;if(255===e[t])if(e[t+1]>143){this.clow+=65280;this.ct=8}else{t++;this.clow+=e[t]<<9;this.ct=7;this.bp=t}else{t++;this.clow+=t<this.dataEnd?e[t]<<8:65280;this.ct=8;this.bp=t}if(this.clow>65535){this.chigh+=this.clow>>16;this.clow&=65535}}readBit(e,t){let a=e[t]>>1,r=1&e[t];const i=cr[a],n=i.qe;let s,o=this.a-n;if(this.chigh<n)if(o<n){o=n;s=r;a=i.nmps}else{o=n;s=1^r;1===i.switchFlag&&(r=s);a=i.nlps}else{this.chigh-=n;if(32768&o){this.a=o;return r}if(o<n){s=1^r;1===i.switchFlag&&(r=s);a=i.nlps}else{s=r;a=i.nmps}}do{0===this.ct&&this.byteIn();o<<=1;this.chigh=this.chigh<<1&65535|this.clow>>15&1;this.clow=this.clow<<1&65535;this.ct--}while(!(32768&o));this.a=o;e[t]=a<<1|r;return s}}class Jbig2Error extends fa{constructor(e){super(e,"Jbig2Error")}}class ContextCache{getContexts(e){return e in this?this[e]:this[e]=new Int8Array(65536)}}class DecodingContext{constructor(e,t,a){this.data=e;this.start=t;this.end=a}get decoder(){return shadow(this,"decoder",new ArithmeticDecoder(this.data,this.start,this.end))}get contextCache(){return shadow(this,"contextCache",new ContextCache)}}function decodeInteger(e,t,a){const r=e.getContexts(t);let i=1;function readBits(e){let t=0;for(let n=0;n<e;n++){const e=a.readBit(r,i);i=i<256?i<<1|e:511&(i<<1|e)|256;t=t<<1|e}return t>>>0}const n=readBits(1),s=readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(32)+4436:readBits(12)+340:readBits(8)+84:readBits(6)+20:readBits(4)+4:readBits(2);let o;0===n?o=s:s>0&&(o=-s);return o>=-2147483648&&o<=va?o:null}function decodeIAID(e,t,a){const r=e.getContexts("IAID");let i=1;for(let e=0;e<a;e++){i=i<<1|t.readBit(r,i)}return a<31?i&(1<<a)-1:2147483647&i}const lr=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],hr=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],ur=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],dr=[39717,1941,229,405],fr=[32,8];function decodeBitmap(e,t,a,r,i,n,s,o){if(e){return decodeMMRBitmap(new Reader(o.data,o.start,o.end),t,a,!1)}if(0===r&&!n&&!i&&4===s.length&&3===s[0].x&&-1===s[0].y&&-3===s[1].x&&-1===s[1].y&&2===s[2].x&&-2===s[2].y&&-2===s[3].x&&-2===s[3].y)return function decodeBitmapTemplate0(e,t,a){const r=a.decoder,i=a.contextCache.getContexts("GB"),n=[];let s,o,c,l,h,u,d;for(o=0;o<t;o++){h=n[o]=new Uint8Array(e);u=o<1?h:n[o-1];d=o<2?h:n[o-2];s=d[0]<<13|d[1]<<12|d[2]<<11|u[0]<<7|u[1]<<6|u[2]<<5|u[3]<<4;for(c=0;c<e;c++){h[c]=l=r.readBit(i,s);s=(31735&s)<<1|(c+3<e?d[c+3]<<11:0)|(c+4<e?u[c+4]<<4:0)|l}}return n}(t,a,o);const c=!!n,l=hr[r].concat(s);l.sort(((e,t)=>e.y-t.y||e.x-t.x));const h=l.length,u=new Int8Array(h),d=new Int8Array(h),f=[];let g,p,m=0,b=0,y=0,w=0;for(p=0;p<h;p++){u[p]=l[p].x;d[p]=l[p].y;b=Math.min(b,l[p].x);y=Math.max(y,l[p].x);w=Math.min(w,l[p].y);p<h-1&&l[p].y===l[p+1].y&&l[p].x===l[p+1].x-1?m|=1<<h-1-p:f.push(p)}const x=f.length,S=new Int8Array(x),k=new Int8Array(x),C=new Uint16Array(x);for(g=0;g<x;g++){p=f[g];S[g]=l[p].x;k[g]=l[p].y;C[g]=1<<h-1-p}const v=-b,F=-w,T=t-y,O=dr[r];let M=new Uint8Array(t);const D=[],R=o.decoder,N=o.contextCache.getContexts("GB");let E,L,j,_,U,X=0,q=0;for(let e=0;e<a;e++){if(i){X^=R.readBit(N,O);if(X){D.push(M);continue}}M=new Uint8Array(M);D.push(M);for(E=0;E<t;E++){if(c&&n[e][E]){M[E]=0;continue}if(E>=v&&E<T&&e>=F){q=q<<1&m;for(p=0;p<x;p++){L=e+k[p];j=E+S[p];_=D[L][j];if(_){_=C[p];q|=_}}}else{q=0;U=h-1;for(p=0;p<h;p++,U--){j=E+u[p];if(j>=0&&j<t){L=e+d[p];if(L>=0){_=D[L][j];_&&(q|=_<<U)}}}}const a=R.readBit(N,q);M[E]=a}}return D}function decodeRefinement(e,t,a,r,i,n,s,o,c){let l=ur[a].coding;0===a&&(l=l.concat([o[0]]));const h=l.length,u=new Int32Array(h),d=new Int32Array(h);let f;for(f=0;f<h;f++){u[f]=l[f].x;d[f]=l[f].y}let g=ur[a].reference;0===a&&(g=g.concat([o[1]]));const p=g.length,m=new Int32Array(p),b=new Int32Array(p);for(f=0;f<p;f++){m[f]=g[f].x;b[f]=g[f].y}const y=r[0].length,w=r.length,x=fr[a],S=[],k=c.decoder,C=c.contextCache.getContexts("GR");let v=0;for(let a=0;a<t;a++){if(s){v^=k.readBit(C,x);if(v)throw new Jbig2Error("prediction is not supported")}const t=new Uint8Array(e);S.push(t);for(let s=0;s<e;s++){let o,c,l=0;for(f=0;f<h;f++){o=a+d[f];c=s+u[f];o<0||c<0||c>=e?l<<=1:l=l<<1|S[o][c]}for(f=0;f<p;f++){o=a+b[f]-n;c=s+m[f]-i;o<0||o>=w||c<0||c>=y?l<<=1:l=l<<1|r[o][c]}const g=k.readBit(C,l);t[s]=g}}return S}function decodeTextRegion(e,t,a,r,i,n,s,o,c,l,h,u,d,f,g,p,m,b,y){if(e&&t)throw new Jbig2Error("refinement with Huffman is not supported");const w=[];let x,S;for(x=0;x<r;x++){S=new Uint8Array(a);i&&S.fill(i);w.push(S)}const k=m.decoder,C=m.contextCache;let v=e?-f.tableDeltaT.decode(y):-decodeInteger(C,"IADT",k),F=0;x=0;for(;x<n;){v+=e?f.tableDeltaT.decode(y):decodeInteger(C,"IADT",k);F+=e?f.tableFirstS.decode(y):decodeInteger(C,"IAFS",k);let r=F;for(;;){let i=0;s>1&&(i=e?y.readBits(b):decodeInteger(C,"IAIT",k));const n=s*v+i,F=e?f.symbolIDTable.decode(y):decodeIAID(C,k,c),T=t&&(e?y.readBit():decodeInteger(C,"IARI",k));let O=o[F],M=O[0].length,D=O.length;if(T){const e=decodeInteger(C,"IARDW",k),t=decodeInteger(C,"IARDH",k);M+=e;D+=t;O=decodeRefinement(M,D,g,O,(e>>1)+decodeInteger(C,"IARDX",k),(t>>1)+decodeInteger(C,"IARDY",k),!1,p,m)}let R=0;l?1&u?R=D-1:r+=D-1:u>1?r+=M-1:R=M-1;const N=n-(1&u?0:D-1),E=r-(2&u?M-1:0);let L,j,_;if(l)for(L=0;L<D;L++){S=w[E+L];if(!S)continue;_=O[L];const e=Math.min(a-N,M);switch(d){case 0:for(j=0;j<e;j++)S[N+j]|=_[j];break;case 2:for(j=0;j<e;j++)S[N+j]^=_[j];break;default:throw new Jbig2Error(`operator ${d} is not supported`)}}else for(j=0;j<D;j++){S=w[N+j];if(S){_=O[j];switch(d){case 0:for(L=0;L<M;L++)S[E+L]|=_[L];break;case 2:for(L=0;L<M;L++)S[E+L]^=_[L];break;default:throw new Jbig2Error(`operator ${d} is not supported`)}}}x++;const U=e?f.tableDeltaS.decode(y):decodeInteger(C,"IADS",k);if(null===U)break;r+=R+U+h}}return w}function readSegmentHeader(e,t){const a={};a.number=readUint32(e,t);const r=e[t+4],i=63&r;if(!lr[i])throw new Jbig2Error("invalid segment type: "+i);a.type=i;a.typeName=lr[i];a.deferredNonRetain=!!(128&r);const n=!!(64&r),s=e[t+5];let o=s>>5&7;const c=[31&s];let l=t+6;if(7===s){o=536870911&readUint32(e,l-1);l+=3;let t=o+7>>3;c[0]=e[l++];for(;--t>0;)c.push(e[l++])}else if(5===s||6===s)throw new Jbig2Error("invalid referred-to flags");a.retainBits=c;let h=4;a.number<=256?h=1:a.number<=65536&&(h=2);const u=[];let d,f;for(d=0;d<o;d++){let t;t=1===h?e[l]:2===h?readUint16(e,l):readUint32(e,l);u.push(t);l+=h}a.referredTo=u;if(n){a.pageAssociation=readUint32(e,l);l+=4}else a.pageAssociation=e[l++];a.length=readUint32(e,l);l+=4;if(4294967295===a.length){if(38!==i)throw new Jbig2Error("invalid unknown segment length");{const t=readRegionSegmentInformation(e,l),r=!!(1&e[l+gr]),i=6,n=new Uint8Array(i);if(!r){n[0]=255;n[1]=172}n[2]=t.height>>>24&255;n[3]=t.height>>16&255;n[4]=t.height>>8&255;n[5]=255&t.height;for(d=l,f=e.length;d<f;d++){let t=0;for(;t<i&&n[t]===e[d+t];)t++;if(t===i){a.length=d+i;break}}if(4294967295===a.length)throw new Jbig2Error("segment end was not found")}}a.headerEnd=l;return a}function readSegments(e,t,a,r){const i=[];let n=a;for(;n<r;){const a=readSegmentHeader(t,n);n=a.headerEnd;const r={header:a,data:t};if(!e.randomAccess){r.start=n;n+=a.length;r.end=n}i.push(r);if(51===a.type)break}if(e.randomAccess)for(let e=0,t=i.length;e<t;e++){i[e].start=n;n+=i[e].header.length;i[e].end=n}return i}function readRegionSegmentInformation(e,t){return{width:readUint32(e,t),height:readUint32(e,t+4),x:readUint32(e,t+8),y:readUint32(e,t+12),combinationOperator:7&e[t+16]}}const gr=17;function processSegment(e,t){const a=e.header,r=e.data,i=e.end;let n,s,o,c,l=e.start;switch(a.type){case 0:const e={},t=readUint16(r,l);e.huffman=!!(1&t);e.refinement=!!(2&t);e.huffmanDHSelector=t>>2&3;e.huffmanDWSelector=t>>4&3;e.bitmapSizeSelector=t>>6&1;e.aggregationInstancesSelector=t>>7&1;e.bitmapCodingContextUsed=!!(256&t);e.bitmapCodingContextRetained=!!(512&t);e.template=t>>10&3;e.refinementTemplate=t>>12&1;l+=2;if(!e.huffman){c=0===e.template?4:1;s=[];for(o=0;o<c;o++){s.push({x:readInt8(r,l),y:readInt8(r,l+1)});l+=2}e.at=s}if(e.refinement&&!e.refinementTemplate){s=[];for(o=0;o<2;o++){s.push({x:readInt8(r,l),y:readInt8(r,l+1)});l+=2}e.refinementAt=s}e.numberOfExportedSymbols=readUint32(r,l);l+=4;e.numberOfNewSymbols=readUint32(r,l);l+=4;n=[e,a.number,a.referredTo,r,l,i];break;case 6:case 7:const h={};h.info=readRegionSegmentInformation(r,l);l+=gr;const u=readUint16(r,l);l+=2;h.huffman=!!(1&u);h.refinement=!!(2&u);h.logStripSize=u>>2&3;h.stripSize=1<<h.logStripSize;h.referenceCorner=u>>4&3;h.transposed=!!(64&u);h.combinationOperator=u>>7&3;h.defaultPixelValue=u>>9&1;h.dsOffset=u<<17>>27;h.refinementTemplate=u>>15&1;if(h.huffman){const e=readUint16(r,l);l+=2;h.huffmanFS=3&e;h.huffmanDS=e>>2&3;h.huffmanDT=e>>4&3;h.huffmanRefinementDW=e>>6&3;h.huffmanRefinementDH=e>>8&3;h.huffmanRefinementDX=e>>10&3;h.huffmanRefinementDY=e>>12&3;h.huffmanRefinementSizeSelector=!!(16384&e)}if(h.refinement&&!h.refinementTemplate){s=[];for(o=0;o<2;o++){s.push({x:readInt8(r,l),y:readInt8(r,l+1)});l+=2}h.refinementAt=s}h.numberOfSymbolInstances=readUint32(r,l);l+=4;n=[h,a.referredTo,r,l,i];break;case 16:const d={},f=r[l++];d.mmr=!!(1&f);d.template=f>>1&3;d.patternWidth=r[l++];d.patternHeight=r[l++];d.maxPatternIndex=readUint32(r,l);l+=4;n=[d,a.number,r,l,i];break;case 22:case 23:const g={};g.info=readRegionSegmentInformation(r,l);l+=gr;const p=r[l++];g.mmr=!!(1&p);g.template=p>>1&3;g.enableSkip=!!(8&p);g.combinationOperator=p>>4&7;g.defaultPixelValue=p>>7&1;g.gridWidth=readUint32(r,l);l+=4;g.gridHeight=readUint32(r,l);l+=4;g.gridOffsetX=4294967295&readUint32(r,l);l+=4;g.gridOffsetY=4294967295&readUint32(r,l);l+=4;g.gridVectorX=readUint16(r,l);l+=2;g.gridVectorY=readUint16(r,l);l+=2;n=[g,a.referredTo,r,l,i];break;case 38:case 39:const m={};m.info=readRegionSegmentInformation(r,l);l+=gr;const b=r[l++];m.mmr=!!(1&b);m.template=b>>1&3;m.prediction=!!(8&b);if(!m.mmr){c=0===m.template?4:1;s=[];for(o=0;o<c;o++){s.push({x:readInt8(r,l),y:readInt8(r,l+1)});l+=2}m.at=s}n=[m,r,l,i];break;case 48:const y={width:readUint32(r,l),height:readUint32(r,l+4),resolutionX:readUint32(r,l+8),resolutionY:readUint32(r,l+12)};4294967295===y.height&&delete y.height;const w=r[l+16];readUint16(r,l+17);y.lossless=!!(1&w);y.refinement=!!(2&w);y.defaultPixelValue=w>>2&1;y.combinationOperator=w>>3&3;y.requiresBuffer=!!(32&w);y.combinationOperatorOverride=!!(64&w);n=[y];break;case 49:case 50:case 51:case 62:break;case 53:n=[a.number,r,l,i];break;default:throw new Jbig2Error(`segment type ${a.typeName}(${a.type}) is not implemented`)}const h="on"+a.typeName;h in t&&t[h].apply(t,n)}function processSegments(e,t){for(let a=0,r=e.length;a<r;a++)processSegment(e[a],t)}class SimpleSegmentVisitor{onPageInformation(e){this.currentPageInfo=e;const t=e.width+7>>3,a=new Uint8ClampedArray(t*e.height);e.defaultPixelValue&&a.fill(255);this.buffer=a}drawBitmap(e,t){const a=this.currentPageInfo,r=e.width,i=e.height,n=a.width+7>>3,s=a.combinationOperatorOverride?e.combinationOperator:a.combinationOperator,o=this.buffer,c=128>>(7&e.x);let l,h,u,d,f=e.y*n+(e.x>>3);switch(s){case 0:for(l=0;l<i;l++){u=c;d=f;for(h=0;h<r;h++){t[l][h]&&(o[d]|=u);u>>=1;if(!u){u=128;d++}}f+=n}break;case 2:for(l=0;l<i;l++){u=c;d=f;for(h=0;h<r;h++){t[l][h]&&(o[d]^=u);u>>=1;if(!u){u=128;d++}}f+=n}break;default:throw new Jbig2Error(`operator ${s} is not supported`)}}onImmediateGenericRegion(e,t,a,r){const i=e.info,n=new DecodingContext(t,a,r),s=decodeBitmap(e.mmr,i.width,i.height,e.template,e.prediction,null,e.at,n);this.drawBitmap(i,s)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(e,t,a,r,i,n){let s,o;if(e.huffman){s=function getSymbolDictionaryHuffmanTables(e,t,a){let r,i,n,s,o=0;switch(e.huffmanDHSelector){case 0:case 1:r=getStandardTable(e.huffmanDHSelector+4);break;case 3:r=getCustomHuffmanTable(o,t,a);o++;break;default:throw new Jbig2Error("invalid Huffman DH selector")}switch(e.huffmanDWSelector){case 0:case 1:i=getStandardTable(e.huffmanDWSelector+2);break;case 3:i=getCustomHuffmanTable(o,t,a);o++;break;default:throw new Jbig2Error("invalid Huffman DW selector")}if(e.bitmapSizeSelector){n=getCustomHuffmanTable(o,t,a);o++}else n=getStandardTable(1);s=e.aggregationInstancesSelector?getCustomHuffmanTable(o,t,a):getStandardTable(1);return{tableDeltaHeight:r,tableDeltaWidth:i,tableBitmapSize:n,tableAggregateInstances:s}}(e,a,this.customTables);o=new Reader(r,i,n)}let c=this.symbols;c||(this.symbols=c={});const l=[];for(const e of a){const t=c[e];t&&l.push(...t)}const h=new DecodingContext(r,i,n);c[t]=function decodeSymbolDictionary(e,t,a,r,i,n,s,o,c,l,h,u){if(e&&t)throw new Jbig2Error("symbol refinement with Huffman is not supported");const d=[];let f=0,g=log2(a.length+r);const p=h.decoder,m=h.contextCache;let b,y;if(e){b=getStandardTable(1);y=[];g=Math.max(g,1)}for(;d.length<r;){f+=e?n.tableDeltaHeight.decode(u):decodeInteger(m,"IADH",p);let r=0,i=0;const b=e?y.length:0;for(;;){const b=e?n.tableDeltaWidth.decode(u):decodeInteger(m,"IADW",p);if(null===b)break;r+=b;i+=r;let w;if(t){const i=decodeInteger(m,"IAAI",p);if(i>1)w=decodeTextRegion(e,t,r,f,0,i,1,a.concat(d),g,0,0,1,0,n,c,l,h,0,u);else{const e=decodeIAID(m,p,g),t=decodeInteger(m,"IARDX",p),i=decodeInteger(m,"IARDY",p);w=decodeRefinement(r,f,c,e<a.length?a[e]:d[e-a.length],t,i,!1,l,h)}d.push(w)}else if(e)y.push(r);else{w=decodeBitmap(!1,r,f,s,!1,null,o,h);d.push(w)}}if(e&&!t){const e=n.tableBitmapSize.decode(u);u.byteAlign();let t;if(0===e)t=readUncompressedBitmap(u,i,f);else{const a=u.end,r=u.position+e;u.end=r;t=decodeMMRBitmap(u,i,f,!1);u.end=a;u.position=r}const a=y.length;if(b===a-1)d.push(t);else{let e,r,i,n,s,o=0;for(e=b;e<a;e++){n=y[e];i=o+n;s=[];for(r=0;r<f;r++)s.push(t[r].subarray(o,i));d.push(s);o=i}}}}const w=[],x=[];let S,k,C=!1;const v=a.length+r;for(;x.length<v;){let t=e?b.decode(u):decodeInteger(m,"IAEX",p);for(;t--;)x.push(C);C=!C}for(S=0,k=a.length;S<k;S++)x[S]&&w.push(a[S]);for(let e=0;e<r;S++,e++)x[S]&&w.push(d[e]);return w}(e.huffman,e.refinement,l,e.numberOfNewSymbols,e.numberOfExportedSymbols,s,e.template,e.at,e.refinementTemplate,e.refinementAt,h,o)}onImmediateTextRegion(e,t,a,r,i){const n=e.info;let s,o;const c=this.symbols,l=[];for(const e of t){const t=c[e];t&&l.push(...t)}const h=log2(l.length);if(e.huffman){o=new Reader(a,r,i);s=function getTextRegionHuffmanTables(e,t,a,r,i){const n=[];for(let e=0;e<=34;e++){const t=i.readBits(4);n.push(new HuffmanLine([e,t,0,0]))}const s=new HuffmanTable(n,!1);n.length=0;for(let e=0;e<r;){const t=s.decode(i);if(t>=32){let a,r,s;switch(t){case 32:if(0===e)throw new Jbig2Error("no previous value in symbol ID table");r=i.readBits(2)+3;a=n[e-1].prefixLength;break;case 33:r=i.readBits(3)+3;a=0;break;case 34:r=i.readBits(7)+11;a=0;break;default:throw new Jbig2Error("invalid code length in symbol ID table")}for(s=0;s<r;s++){n.push(new HuffmanLine([e,a,0,0]));e++}}else{n.push(new HuffmanLine([e,t,0,0]));e++}}i.byteAlign();const o=new HuffmanTable(n,!1);let c,l,h,u=0;switch(e.huffmanFS){case 0:case 1:c=getStandardTable(e.huffmanFS+6);break;case 3:c=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman FS selector")}switch(e.huffmanDS){case 0:case 1:case 2:l=getStandardTable(e.huffmanDS+8);break;case 3:l=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman DS selector")}switch(e.huffmanDT){case 0:case 1:case 2:h=getStandardTable(e.huffmanDT+11);break;case 3:h=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman DT selector")}if(e.refinement)throw new Jbig2Error("refinement with Huffman is not supported");return{symbolIDTable:o,tableFirstS:c,tableDeltaS:l,tableDeltaT:h}}(e,t,this.customTables,l.length,o)}const u=new DecodingContext(a,r,i),d=decodeTextRegion(e.huffman,e.refinement,n.width,n.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,l,h,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,s,e.refinementTemplate,e.refinementAt,u,e.logStripSize,o);this.drawBitmap(n,d)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(e,t,a,r,i){let n=this.patterns;n||(this.patterns=n={});const s=new DecodingContext(a,r,i);n[t]=function decodePatternDictionary(e,t,a,r,i,n){const s=[];if(!e){s.push({x:-t,y:0});0===i&&s.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}const o=decodeBitmap(e,(r+1)*t,a,i,!1,null,s,n),c=[];for(let e=0;e<=r;e++){const r=[],i=t*e,n=i+t;for(let e=0;e<a;e++)r.push(o[e].subarray(i,n));c.push(r)}return c}(e.mmr,e.patternWidth,e.patternHeight,e.maxPatternIndex,e.template,s)}onImmediateHalftoneRegion(e,t,a,r,i){const n=this.patterns[t[0]],s=e.info,o=new DecodingContext(a,r,i),c=function decodeHalftoneRegion(e,t,a,r,i,n,s,o,c,l,h,u,d,f,g){if(s)throw new Jbig2Error("skip is not supported");if(0!==o)throw new Jbig2Error(`operator "${o}" is not supported in halftone region`);const p=[];let m,b,y;for(m=0;m<i;m++){y=new Uint8Array(r);n&&y.fill(n);p.push(y)}const w=t.length,x=t[0],S=x[0].length,k=x.length,C=log2(w),v=[];if(!e){v.push({x:a<=1?3:2,y:-1});0===a&&v.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}const F=[];let T,O,M,D,R,N,E,L,j,_,U;e&&(T=new Reader(g.data,g.start,g.end));for(m=C-1;m>=0;m--){O=e?decodeMMRBitmap(T,c,l,!0):decodeBitmap(!1,c,l,a,!1,null,v,g);F[m]=O}for(M=0;M<l;M++)for(D=0;D<c;D++){R=0;N=0;for(b=C-1;b>=0;b--){R^=F[b][M][D];N|=R<<b}E=t[N];L=h+M*f+D*d>>8;j=u+M*d-D*f>>8;if(L>=0&&L+S<=r&&j>=0&&j+k<=i)for(m=0;m<k;m++){U=p[j+m];_=E[m];for(b=0;b<S;b++)U[L+b]|=_[b]}else{let e,t;for(m=0;m<k;m++){t=j+m;if(!(t<0||t>=i)){U=p[t];_=E[m];for(b=0;b<S;b++){e=L+b;e>=0&&e<r&&(U[e]|=_[b])}}}}}return p}(e.mmr,n,e.template,s.width,s.height,e.defaultPixelValue,e.enableSkip,e.combinationOperator,e.gridWidth,e.gridHeight,e.gridOffsetX,e.gridOffsetY,e.gridVectorX,e.gridVectorY,o);this.drawBitmap(s,c)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(e,t,a,r){let i=this.customTables;i||(this.customTables=i={});i[e]=function decodeTablesSegment(e,t,a){const r=e[t],i=4294967295&readUint32(e,t+1),n=4294967295&readUint32(e,t+5),s=new Reader(e,t+9,a),o=1+(r>>1&7),c=1+(r>>4&7),l=[];let h,u,d=i;do{h=s.readBits(o);u=s.readBits(c);l.push(new HuffmanLine([d,h,u,0]));d+=1<<u}while(d<n);h=s.readBits(o);l.push(new HuffmanLine([i-1,h,32,0,"lower"]));h=s.readBits(o);l.push(new HuffmanLine([n,h,32,0]));if(1&r){h=s.readBits(o);l.push(new HuffmanLine([h,0]))}return new HuffmanTable(l,!1)}(t,a,r)}}class HuffmanLine{constructor(e){if(2===e.length){this.isOOB=!0;this.rangeLow=0;this.prefixLength=e[0];this.rangeLength=0;this.prefixCode=e[1];this.isLowerRange=!1}else{this.isOOB=!1;this.rangeLow=e[0];this.prefixLength=e[1];this.rangeLength=e[2];this.prefixCode=e[3];this.isLowerRange="lower"===e[4]}}}class HuffmanTreeNode{constructor(e){this.children=[];if(e){this.isLeaf=!0;this.rangeLength=e.rangeLength;this.rangeLow=e.rangeLow;this.isLowerRange=e.isLowerRange;this.isOOB=e.isOOB}else this.isLeaf=!1}buildTree(e,t){const a=e.prefixCode>>t&1;if(t<=0)this.children[a]=new HuffmanTreeNode(e);else{let r=this.children[a];r||(this.children[a]=r=new HuffmanTreeNode(null));r.buildTree(e,t-1)}}decodeNode(e){if(this.isLeaf){if(this.isOOB)return null;const t=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-t:t)}const t=this.children[e.readBit()];if(!t)throw new Jbig2Error("invalid Huffman data");return t.decodeNode(e)}}class HuffmanTable{constructor(e,t){t||this.assignPrefixCodes(e);this.rootNode=new HuffmanTreeNode(null);for(let t=0,a=e.length;t<a;t++){const a=e[t];a.prefixLength>0&&this.rootNode.buildTree(a,a.prefixLength-1)}}decode(e){return this.rootNode.decodeNode(e)}assignPrefixCodes(e){const t=e.length;let a=0;for(let r=0;r<t;r++)a=Math.max(a,e[r].prefixLength);const r=new Uint32Array(a+1);for(let a=0;a<t;a++)r[e[a].prefixLength]++;let i,n,s,o=1,c=0;r[0]=0;for(;o<=a;){c=c+r[o-1]<<1;i=c;n=0;for(;n<t;){s=e[n];if(s.prefixLength===o){s.prefixCode=i;i++}n++}o++}}}const pr={};function getStandardTable(e){let t,a=pr[e];if(a)return a;switch(e){case 1:t=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:t=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:t=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:t=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:t=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:t=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:t=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:t=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:t=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:t=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:t=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:t=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:t=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:t=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:t=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new Jbig2Error(`standard table B.${e} does not exist`)}for(let e=0,a=t.length;e<a;e++)t[e]=new HuffmanLine(t[e]);a=new HuffmanTable(t,!0);pr[e]=a;return a}class Reader{constructor(e,t,a){this.data=e;this.start=t;this.end=a;this.position=t;this.shift=-1;this.currentByte=0}readBit(){if(this.shift<0){if(this.position>=this.end)throw new Jbig2Error("end of data while reading bit");this.currentByte=this.data[this.position++];this.shift=7}const e=this.currentByte>>this.shift&1;this.shift--;return e}readBits(e){let t,a=0;for(t=e-1;t>=0;t--)a|=this.readBit()<<t;return a}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}}function getCustomHuffmanTable(e,t,a){let r=0;for(let i=0,n=t.length;i<n;i++){const n=a[t[i]];if(n){if(e===r)return n;r++}}throw new Jbig2Error("can\'t find custom Huffman table")}function readUncompressedBitmap(e,t,a){const r=[];for(let i=0;i<a;i++){const a=new Uint8Array(t);r.push(a);for(let r=0;r<t;r++)a[r]=e.readBit();e.byteAlign()}return r}function decodeMMRBitmap(e,t,a,r){const i=new CCITTFaxDecoder(e,{K:-1,Columns:t,Rows:a,BlackIs1:!0,EndOfBlock:r}),n=[];let s,o=!1;for(let e=0;e<a;e++){const e=new Uint8Array(t);n.push(e);let a=-1;for(let r=0;r<t;r++){if(a<0){s=i.readNextChar();if(-1===s){s=0;o=!0}a=7}e[r]=s>>a&1;a--}}if(r&&!o){const e=5;for(let t=0;t<e&&-1!==i.readNextChar();t++);}return n}class Jbig2Image{parseChunks(e){return function parseJbig2Chunks(e){const t=new SimpleSegmentVisitor;for(let a=0,r=e.length;a<r;a++){const r=e[a];processSegments(readSegments({},r.data,r.start,r.end),t)}return t.buffer}(e)}parse(e){throw new Error("Not implemented: Jbig2Image.parse")}}class Jbig2Stream extends DecodeStream{constructor(e,t,a){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}get bytes(){return shadow(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}decodeImage(e){if(this.eof)return this.buffer;e||=this.bytes;const t=new Jbig2Image,a=[];if(this.params instanceof Dict){const e=this.params.get("JBIG2Globals");if(e instanceof BaseStream){const t=e.getBytes();a.push({data:t,start:0,end:t.length})}}a.push({data:e,start:0,end:e.length});const r=t.parseChunks(a),i=r.length;for(let e=0;e<i;e++)r[e]^=255;this.buffer=r;this.bufferLength=i;this.eof=!0;return this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class JpxStream extends DecodeStream{constructor(e,t,a){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}get bytes(){return shadow(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(e){unreachable("JpxStream.readBlock")}get isAsyncDecoder(){return!0}async decodeImage(e,t){if(this.eof)return this.buffer;e||=this.bytes;this.buffer=await JpxImage.decode(e,t);this.bufferLength=this.buffer.length;this.eof=!0;return this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class LZWStream extends DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;this.cachedData=0;this.bitsCached=0;const r=4096,i={earlyChange:a,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(r),dictionaryLengths:new Uint16Array(r),dictionaryPrevCodes:new Uint16Array(r),currentSequence:new Uint8Array(r),currentSequenceLength:0};for(let e=0;e<256;++e){i.dictionaryValues[e]=e;i.dictionaryLengths[e]=1}this.lzwState=i}readBits(e){let t=this.bitsCached,a=this.cachedData;for(;t<e;){const e=this.str.getByte();if(-1===e){this.eof=!0;return null}a=a<<8|e;t+=8}this.bitsCached=t-=e;this.cachedData=a;this.lastCode=null;return a>>>t&(1<<e)-1}readBlock(){let e,t,a,r=1024;const i=this.lzwState;if(!i)return;const n=i.earlyChange;let s=i.nextCode;const o=i.dictionaryValues,c=i.dictionaryLengths,l=i.dictionaryPrevCodes;let h=i.codeLength,u=i.prevCode;const d=i.currentSequence;let f=i.currentSequenceLength,g=0,p=this.bufferLength,m=this.ensureBuffer(this.bufferLength+r);for(e=0;e<512;e++){const e=this.readBits(h),i=f>0;if(e<256){d[0]=e;f=1}else{if(!(e>=258)){if(256===e){h=9;s=258;f=0;continue}this.eof=!0;delete this.lzwState;break}if(e<s){f=c[e];for(t=f-1,a=e;t>=0;t--){d[t]=o[a];a=l[a]}}else d[f++]=d[0]}if(i){l[s]=u;c[s]=c[u]+1;o[s]=d[0];s++;h=s+n&s+n-1?h:0|Math.min(Math.log(s+n)/.6931471805599453+1,12)}u=e;g+=f;if(r<g){do{r+=512}while(r<g);m=this.ensureBuffer(this.bufferLength+r)}for(t=0;t<f;t++)m[p++]=d[t]}i.nextCode=s;i.codeLength=h;i.prevCode=u;i.currentSequenceLength=f;this.bufferLength=p}}class PredictorStream extends DecodeStream{constructor(e,t,a){super(t);if(!(a instanceof Dict))return e;const r=this.predictor=a.get("Predictor")||1;if(r<=1)return e;if(2!==r&&(r<10||r>15))throw new FormatError(`Unsupported predictor: ${r}`);this.readBlock=2===r?this.readBlockTiff:this.readBlockPng;this.str=e;this.dict=e.dict;const i=this.colors=a.get("Colors")||1,n=this.bits=a.get("BPC","BitsPerComponent")||8,s=this.columns=a.get("Columns")||1;this.pixBytes=i*n+7>>3;this.rowBytes=s*i*n+7>>3;return this}readBlockTiff(){const e=this.rowBytes,t=this.bufferLength,a=this.ensureBuffer(t+e),r=this.bits,i=this.colors,n=this.str.getBytes(e);this.eof=!n.length;if(this.eof)return;let s,o=0,c=0,l=0,h=0,u=t;if(1===r&&1===i)for(s=0;s<e;++s){let e=n[s]^o;e^=e>>1;e^=e>>2;e^=e>>4;o=(1&e)<<7;a[u++]=e}else if(8===r){for(s=0;s<i;++s)a[u++]=n[s];for(;s<e;++s){a[u]=a[u-i]+n[s];u++}}else if(16===r){const t=2*i;for(s=0;s<t;++s)a[u++]=n[s];for(;s<e;s+=2){const e=((255&n[s])<<8)+(255&n[s+1])+((255&a[u-t])<<8)+(255&a[u-t+1]);a[u++]=e>>8&255;a[u++]=255&e}}else{const e=new Uint8Array(i+1),u=(1<<r)-1;let d=0,f=t;const g=this.columns;for(s=0;s<g;++s)for(let t=0;t<i;++t){if(l<r){o=o<<8|255&n[d++];l+=8}e[t]=e[t]+(o>>l-r)&u;l-=r;c=c<<r|e[t];h+=r;if(h>=8){a[f++]=c>>h-8&255;h-=8}}h>0&&(a[f++]=(c<<8-h)+(o&(1<<8-h)-1))}this.bufferLength+=e}readBlockPng(){const e=this.rowBytes,t=this.pixBytes,a=this.str.getByte(),r=this.str.getBytes(e);this.eof=!r.length;if(this.eof)return;const i=this.bufferLength,n=this.ensureBuffer(i+e);let s=n.subarray(i-e,i);0===s.length&&(s=new Uint8Array(e));let o,c,l,h=i;switch(a){case 0:for(o=0;o<e;++o)n[h++]=r[o];break;case 1:for(o=0;o<t;++o)n[h++]=r[o];for(;o<e;++o){n[h]=n[h-t]+r[o]&255;h++}break;case 2:for(o=0;o<e;++o)n[h++]=s[o]+r[o]&255;break;case 3:for(o=0;o<t;++o)n[h++]=(s[o]>>1)+r[o];for(;o<e;++o){n[h]=(s[o]+n[h-t]>>1)+r[o]&255;h++}break;case 4:for(o=0;o<t;++o){c=s[o];l=r[o];n[h++]=c+l}for(;o<e;++o){c=s[o];const e=s[o-t],a=n[h-t],i=a+c-e;let u=i-a;u<0&&(u=-u);let d=i-c;d<0&&(d=-d);let f=i-e;f<0&&(f=-f);l=r[o];n[h++]=u<=d&&u<=f?a+l:d<=f?c+l:e+l}break;default:throw new FormatError(`Unsupported predictor: ${a}`)}this.bufferLength+=e}}class RunLengthStream extends DecodeStream{constructor(e,t){super(t);this.str=e;this.dict=e.dict}readBlock(){const e=this.str.getBytes(2);if(!e||e.length<2||128===e[0]){this.eof=!0;return}let t,a=this.bufferLength,r=e[0];if(r<128){t=this.ensureBuffer(a+r+1);t[a++]=e[1];if(r>0){const e=this.str.getBytes(r);t.set(e,a);a+=r}}else{r=257-r;t=this.ensureBuffer(a+r+1);t.fill(e[1],a,a+r);a+=r}this.bufferLength=a}}class Parser{constructor({lexer:e,xref:t,allowStreams:a=!1,recoveryMode:r=!1}){this.lexer=e;this.xref=t;this.allowStreams=a;this.recoveryMode=r;this.imageCache=Object.create(null);this._imageId=0;this.refill()}refill(){this.buf1=this.lexer.getObj();this.buf2=this.lexer.getObj()}shift(){if(this.buf2 instanceof Cmd&&"ID"===this.buf2.cmd){this.buf1=this.buf2;this.buf2=null}else{this.buf1=this.buf2;this.buf2=this.lexer.getObj()}}tryShift(){try{this.shift();return!0}catch(e){if(e instanceof MissingDataException)throw e;return!1}}getObj(e=null){const t=this.buf1;this.shift();if(t instanceof Cmd)switch(t.cmd){case"BI":return this.makeInlineImage(e);case"[":const a=[];for(;!isCmd(this.buf1,"]")&&this.buf1!==wa;)a.push(this.getObj(e));if(this.buf1===wa){if(this.recoveryMode)return a;throw new ParserEOFException("End of file inside array.")}this.shift();return a;case"<<":const r=new Dict(this.xref);for(;!isCmd(this.buf1,">>")&&this.buf1!==wa;){if(!(this.buf1 instanceof Name)){info("Malformed dictionary: key must be a name object");this.shift();continue}const t=this.buf1.name;this.shift();if(this.buf1===wa)break;r.set(t,this.getObj(e))}if(this.buf1===wa){if(this.recoveryMode)return r;throw new ParserEOFException("End of file inside dictionary.")}if(isCmd(this.buf2,"stream"))return this.allowStreams?this.makeStream(r,e):r;this.shift();return r;default:return t}if(Number.isInteger(t)){if(Number.isInteger(this.buf1)&&isCmd(this.buf2,"R")){const e=Ref.get(t,this.buf1);this.shift();this.shift();return e}return t}return"string"==typeof t&&e?e.decryptString(t):t}findDefaultInlineStreamEnd(e){const{knownCommands:t}=this.lexer,a=e.pos;let r,i,n=0;for(;-1!==(r=e.getByte());)if(0===n)n=69===r?1:0;else if(1===n)n=73===r?2:0;else if(32===r||10===r||13===r){i=e.pos;const a=e.peekBytes(15),s=a.length;if(0===s)break;for(let e=0;e<s;e++){r=a[e];if((0!==r||0===a[e+1])&&(10!==r&&13!==r&&(r<32||r>127))){n=0;break}}if(2!==n)continue;if(!t){warn("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");continue}const o=new Lexer(new Stream(e.peekBytes(75)),t);o._hexStringWarn=()=>{};let c=0;for(;;){const e=o.getObj();if(e===wa){n=0;break}if(e instanceof Cmd){const a=t[e.cmd];if(!a){n=0;break}if(a.variableArgs?c<=a.numArgs:c===a.numArgs)break;c=0}else c++}if(2===n)break}else n=0;if(-1===r){warn("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker");if(i){warn(\'... trying to recover by using the last "EI" occurrence.\');e.skip(-(e.pos-i))}}let s=4;e.skip(-s);r=e.peekByte();e.skip(s);isWhiteSpace(r)||s--;return e.pos-s-a}findDCTDecodeInlineStreamEnd(e){const t=e.pos;let a,r,i=!1;for(;-1!==(a=e.getByte());)if(255===a){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:i=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:r=e.getUint16();r>2?e.skip(r-2):e.skip(-2)}if(i)break}const n=e.pos-t;if(-1===a){warn("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.");e.skip(-n);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return n}findASCII85DecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte());)if(126===a){const t=e.pos;a=e.peekByte();for(;isWhiteSpace(a);){e.skip();a=e.peekByte()}if(62===a){e.skip();break}if(e.pos>t){const t=e.peekBytes(2);if(69===t[0]&&73===t[1])break}}const r=e.pos-t;if(-1===a){warn("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-r);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return r}findASCIIHexDecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte())&&62!==a;);const r=e.pos-t;if(-1===a){warn("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-r);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return r}inlineStreamSkipEI(e){let t,a=0;for(;-1!==(t=e.getByte());)if(0===a)a=69===t?1:0;else if(1===a)a=73===t?2:0;else if(2===a)break}makeInlineImage(e){const t=this.lexer,a=t.stream,r=Object.create(null);let i;for(;!isCmd(this.buf1,"ID")&&this.buf1!==wa;){if(!(this.buf1 instanceof Name))throw new FormatError("Dictionary key must be a name object");const t=this.buf1.name;this.shift();if(this.buf1===wa)break;r[t]=this.getObj(e)}-1!==t.beginInlineImagePos&&(i=a.pos-t.beginInlineImagePos);const n=this.xref.fetchIfRef(r.F||r.Filter);let s;if(n instanceof Name)s=n.name;else if(Array.isArray(n)){const e=this.xref.fetchIfRef(n[0]);e instanceof Name&&(s=e.name)}const o=a.pos;let c,l;switch(s){case"DCT":case"DCTDecode":c=this.findDCTDecodeInlineStreamEnd(a);break;case"A85":case"ASCII85Decode":c=this.findASCII85DecodeInlineStreamEnd(a);break;case"AHx":case"ASCIIHexDecode":c=this.findASCIIHexDecodeInlineStreamEnd(a);break;default:c=this.findDefaultInlineStreamEnd(a)}if(c<1e3&&i>0){const e=a.pos;a.pos=t.beginInlineImagePos;l=function getInlineImageCacheKey(e){const t=[],a=e.length;let r=0;for(;r<a-1;)t.push(e[r++]<<8|e[r++]);r<a&&t.push(e[r]);return a+"_"+String.fromCharCode.apply(null,t)}(a.getBytes(i+c));a.pos=e;const r=this.imageCache[l];if(void 0!==r){this.buf2=Cmd.get("EI");this.shift();r.reset();return r}}const h=new Dict(this.xref);for(const e in r)h.set(e,r[e]);let u=a.makeSubStream(o,c,h);e&&(u=e.createStream(u,c));u=this.filter(u,h,c);u.dict=h;if(void 0!==l){u.cacheKey="inline_img_"+ ++this._imageId;this.imageCache[l]=u}this.buf2=Cmd.get("EI");this.shift();return u}#q(e){const{stream:t}=this.lexer;t.pos=e;const a=new Uint8Array([101,110,100]),r=a.length,i=[new Uint8Array([115,116,114,101,97,109]),new Uint8Array([115,116,101,97,109]),new Uint8Array([115,116,114,101,97])],n=9-r;for(;t.pos<t.end;){const s=t.peekBytes(2048),o=s.length-9;if(o<=0)break;let c=0;for(;c<o;){let o=0;for(;o<r&&s[c+o]===a[o];)o++;if(o>=r){let r=!1;for(const e of i){const t=e.length;let i=0;for(;i<t&&s[c+o+i]===e[i];)i++;if(i>=n){r=!0;break}if(i>=t){if(isWhiteSpace(s[c+o+i])){info(`Found "${bytesToString([...a,...e])}" when searching for endstream command.`);r=!0}break}}if(r){t.pos+=c;return t.pos-e}}c++}t.pos+=o}return-1}makeStream(e,t){const a=this.lexer;let r=a.stream;a.skipToNextLine();const i=r.pos-1;let n=e.get("Length");if(!Number.isInteger(n)){info(`Bad length "${n&&n.toString()}" in stream.`);n=0}r.pos=i+n;a.nextChar();if(this.tryShift()&&isCmd(this.buf2,"endstream"))this.shift();else{n=this.#q(i);if(n<0)throw new FormatError("Missing endstream command.");a.nextChar();this.shift();this.shift()}this.shift();r=r.makeSubStream(i,n,e);t&&(r=t.createStream(r,n));r=this.filter(r,e,n);r.dict=e;return r}filter(e,t,a){let r=t.get("F","Filter"),i=t.get("DP","DecodeParms");if(r instanceof Name){Array.isArray(i)&&warn("/DecodeParms should not be an Array, when /Filter is a Name.");return this.makeFilter(e,r.name,a,i)}let n=a;if(Array.isArray(r)){const t=r,a=i;for(let s=0,o=t.length;s<o;++s){r=this.xref.fetchIfRef(t[s]);if(!(r instanceof Name))throw new FormatError(`Bad filter name "${r}"`);i=null;Array.isArray(a)&&s in a&&(i=this.xref.fetchIfRef(a[s]));e=this.makeFilter(e,r.name,n,i);n=null}}return e}makeFilter(e,t,a,r){if(0===a){warn(`Empty "${t}" stream.`);return new NullStream}try{switch(t){case"Fl":case"FlateDecode":return r?new PredictorStream(new FlateStream(e,a),a,r):new FlateStream(e,a);case"LZW":case"LZWDecode":let t=1;if(r){r.has("EarlyChange")&&(t=r.get("EarlyChange"));return new PredictorStream(new LZWStream(e,a,t),a,r)}return new LZWStream(e,a,t);case"DCT":case"DCTDecode":return new JpegStream(e,a,r);case"JPX":case"JPXDecode":return new JpxStream(e,a,r);case"A85":case"ASCII85Decode":return new Ascii85Stream(e,a);case"AHx":case"ASCIIHexDecode":return new AsciiHexStream(e,a);case"CCF":case"CCITTFaxDecode":return new CCITTFaxStream(e,a,r);case"RL":case"RunLengthDecode":return new RunLengthStream(e,a);case"JBIG2Decode":return new Jbig2Stream(e,a,r)}warn(`Filter "${t}" is not supported.`);return e}catch(e){if(e instanceof MissingDataException)throw e;warn(`Invalid stream: "${e}"`);return new NullStream}}}const mr=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function toHexDigit(e){return e>=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}class Lexer{constructor(e,t=null){this.stream=e;this.nextChar();this.strBuf=[];this.knownCommands=t;this._hexStringNumWarn=0;this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let e=this.currentChar,t=!1,a=0,r=1;if(45===e){r=-1;e=this.nextChar();45===e&&(e=this.nextChar())}else 43===e&&(e=this.nextChar());if(10===e||13===e)do{e=this.nextChar()}while(10===e||13===e);if(46===e){a=10;e=this.nextChar()}if(e<48||e>57){const t=`Invalid number: ${String.fromCharCode(e)} (charCode ${e})`;if(isWhiteSpace(e)||40===e||60===e||-1===e){info(`Lexer.getNumber - "${t}".`);return 0}throw new FormatError(t)}let i=e-48,n=0,s=1;for(;(e=this.nextChar())>=0;)if(e>=48&&e<=57){const r=e-48;if(t)n=10*n+r;else{0!==a&&(a*=10);i=10*i+r}}else if(46===e){if(0!==a)break;a=1}else if(45===e)warn("Badly formatted number: minus sign in the middle");else{if(69!==e&&101!==e)break;e=this.peekChar();if(43===e||45===e){s=45===e?-1:1;this.nextChar()}else if(e<48||e>57)break;t=!0}0!==a&&(i/=a);t&&(i*=10**(s*n));return r*i}getString(){let e=1,t=!1;const a=this.strBuf;a.length=0;let r=this.nextChar();for(;;){let i=!1;switch(0|r){case-1:warn("Unterminated string");t=!0;break;case 40:++e;a.push("(");break;case 41:if(0==--e){this.nextChar();t=!0}else a.push(")");break;case 92:r=this.nextChar();switch(r){case-1:warn("Unterminated string");t=!0;break;case 110:a.push("\\n");break;case 114:a.push("\\r");break;case 116:a.push("\\t");break;case 98:a.push("\\b");break;case 102:a.push("\\f");break;case 92:case 40:case 41:a.push(String.fromCharCode(r));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let e=15&r;r=this.nextChar();i=!0;if(r>=48&&r<=55){e=(e<<3)+(15&r);r=this.nextChar();if(r>=48&&r<=55){i=!1;e=(e<<3)+(15&r)}}a.push(String.fromCharCode(e));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:a.push(String.fromCharCode(r))}break;default:a.push(String.fromCharCode(r))}if(t)break;i||(r=this.nextChar())}return a.join("")}getName(){let e,t;const a=this.strBuf;a.length=0;for(;(e=this.nextChar())>=0&&!mr[e];)if(35===e){e=this.nextChar();if(mr[e]){warn("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number.");a.push("#");break}const r=toHexDigit(e);if(-1!==r){t=e;e=this.nextChar();const i=toHexDigit(e);if(-1===i){warn(`Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`);a.push("#",String.fromCharCode(t));if(mr[e])break;a.push(String.fromCharCode(e));continue}a.push(String.fromCharCode(r<<4|i))}else a.push("#",String.fromCharCode(e))}else a.push(String.fromCharCode(e));a.length>127&&warn(`Name token is longer than allowed by the spec: ${a.length}`);return Name.get(a.join(""))}_hexStringWarn(e){5!=this._hexStringNumWarn++?this._hexStringNumWarn>5||warn(`getHexString - ignoring invalid character: ${e}`):warn("getHexString - ignoring additional invalid characters.")}getHexString(){const e=this.strBuf;e.length=0;let t=this.currentChar,a=-1,r=-1;this._hexStringNumWarn=0;for(;;){if(t<0){warn("Unterminated hex string");break}if(62===t){this.nextChar();break}if(1!==mr[t]){r=toHexDigit(t);if(-1===r)this._hexStringWarn(t);else if(-1===a)a=r;else{e.push(String.fromCharCode(a<<4|r));a=-1}t=this.nextChar()}else t=this.nextChar()}-1!==a&&e.push(String.fromCharCode(a<<4));return e.join("")}getObj(){let e=!1,t=this.currentChar;for(;;){if(t<0)return wa;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(1!==mr[t])break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:this.nextChar();return Cmd.get("[");case 93:this.nextChar();return Cmd.get("]");case 60:t=this.nextChar();if(60===t){this.nextChar();return Cmd.get("<<")}return this.getHexString();case 62:t=this.nextChar();if(62===t){this.nextChar();return Cmd.get(">>")}return Cmd.get(">");case 123:this.nextChar();return Cmd.get("{");case 125:this.nextChar();return Cmd.get("}");case 41:this.nextChar();throw new FormatError(`Illegal character: ${t}`)}let a=String.fromCharCode(t);if(t<32||t>127){const e=this.peekChar();if(e>=32&&e<=127){this.nextChar();return Cmd.get(a)}}const r=this.knownCommands;let i=void 0!==r?.[a];for(;(t=this.nextChar())>=0&&!mr[t];){const e=a+String.fromCharCode(t);if(i&&void 0===r[e])break;if(128===a.length)throw new FormatError(`Command token too long: ${a.length}`);a=e;i=void 0!==r?.[a]}if("true"===a)return!0;if("false"===a)return!1;if("null"===a)return null;"BI"===a&&(this.beginInlineImagePos=this.stream.pos);return Cmd.get(a)}skipToNextLine(){let e=this.currentChar;for(;e>=0;){if(13===e){e=this.nextChar();10===e&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}}}class Linearization{static create(e){function getInt(e,t,a=!1){const r=e.get(t);if(Number.isInteger(r)&&(a?r>=0:r>0))return r;throw new Error(`The "${t}" parameter in the linearization dictionary is invalid.`)}const t=new Parser({lexer:new Lexer(e),xref:null}),a=t.getObj(),r=t.getObj(),i=t.getObj(),n=t.getObj();let s,o;if(!(Number.isInteger(a)&&Number.isInteger(r)&&isCmd(i,"obj")&&n instanceof Dict&&"number"==typeof(s=n.get("Linearized"))&&s>0))return null;if((o=getInt(n,"L"))!==e.length)throw new Error(\'The "L" parameter in the linearization dictionary does not equal the stream length.\');return{length:o,hints:function getHints(e){const t=e.get("H");let a;if(Array.isArray(t)&&(2===(a=t.length)||4===a)){for(let e=0;e<a;e++){const a=t[e];if(!(Number.isInteger(a)&&a>0))throw new Error(`Hint (${e}) in the linearization dictionary is invalid.`)}return t}throw new Error("Hint array in the linearization dictionary is invalid.")}(n),objectNumberFirst:getInt(n,"O"),endFirst:getInt(n,"E"),numPages:getInt(n,"N"),mainXRefEntriesOffset:getInt(n,"T"),pageFirst:n.has("P")?getInt(n,"P",!0):0}}}const br=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"],yr=2**24-1;class CMap{constructor(e=!1){this.codespaceRanges=[[],[],[],[]];this.numCodespaceRanges=0;this._map=[];this.name="";this.vertical=!1;this.useCMap=null;this.builtInCMap=e}addCodespaceRange(e,t,a){this.codespaceRanges[e-1].push(t,a);this.numCodespaceRanges++}mapCidRange(e,t,a){if(t-e>yr)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;e<=t;)this._map[e++]=a++}mapBfRange(e,t,a){if(t-e>yr)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");const r=a.length-1;for(;e<=t;){this._map[e++]=a;const t=a.charCodeAt(r)+1;t>255?a=a.substring(0,r-1)+String.fromCharCode(a.charCodeAt(r-1)+1)+"\\0":a=a.substring(0,r)+String.fromCharCode(t)}}mapBfRangeToArray(e,t,a){if(t-e>yr)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");const r=a.length;let i=0;for(;e<=t&&i<r;){this._map[e]=a[i++];++e}}mapOne(e,t){this._map[e]=t}lookup(e){return this._map[e]}contains(e){return void 0!==this._map[e]}forEach(e){const t=this._map,a=t.length;if(a<=65536)for(let r=0;r<a;r++)void 0!==t[r]&&e(r,t[r]);else for(const a in t)e(a,t[a])}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const a in t)if(t[a]===e)return 0|a;return-1}getMap(){return this._map}readCharCode(e,t,a){let r=0;const i=this.codespaceRanges;for(let n=0,s=i.length;n<s;n++){r=(r<<8|e.charCodeAt(t+n))>>>0;const s=i[n];for(let e=0,t=s.length;e<t;){const t=s[e++],i=s[e++];if(r>=t&&r<=i){a.charcode=r;a.length=n+1;return}}}a.charcode=0;a.length=1}getCharCodeLength(e){const t=this.codespaceRanges;for(let a=0,r=t.length;a<r;a++){const r=t[a];for(let t=0,i=r.length;t<i;){const i=r[t++],n=r[t++];if(e>=i&&e<=n)return a+1}}return 1}get length(){return this._map.length}get isIdentityCMap(){if("Identity-H"!==this.name&&"Identity-V"!==this.name)return!1;if(65536!==this._map.length)return!1;for(let e=0;e<65536;e++)if(this._map[e]!==e)return!1;return!0}}class IdentityCMap extends CMap{constructor(e,t){super();this.vertical=e;this.addCodespaceRange(t,0,65535)}mapCidRange(e,t,a){unreachable("should not call mapCidRange")}mapBfRange(e,t,a){unreachable("should not call mapBfRange")}mapBfRangeToArray(e,t,a){unreachable("should not call mapBfRangeToArray")}mapOne(e,t){unreachable("should not call mapCidOne")}lookup(e){return Number.isInteger(e)&&e<=65535?e:void 0}contains(e){return Number.isInteger(e)&&e<=65535}forEach(e){for(let t=0;t<=65535;t++)e(t,t)}charCodeOf(e){return Number.isInteger(e)&&e<=65535?e:-1}getMap(){const e=new Array(65536);for(let t=0;t<=65535;t++)e[t]=t;return e}get length(){return 65536}get isIdentityCMap(){unreachable("should not access .isIdentityCMap")}}function strToInt(e){let t=0;for(let a=0;a<e.length;a++)t=t<<8|e.charCodeAt(a);return t>>>0}function expectString(e){if("string"!=typeof e)throw new FormatError("Malformed CMap: expected string.")}function expectInt(e){if(!Number.isInteger(e))throw new FormatError("Malformed CMap: expected int.")}function parseBfChar(e,t){for(;;){let a=t.getObj();if(a===wa)break;if(isCmd(a,"endbfchar"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=a;e.mapOne(r,i)}}function parseBfRange(e,t){for(;;){let a=t.getObj();if(a===wa)break;if(isCmd(a,"endbfrange"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=strToInt(a);a=t.getObj();if(Number.isInteger(a)||"string"==typeof a){const t=Number.isInteger(a)?String.fromCharCode(a):a;e.mapBfRange(r,i,t)}else{if(!isCmd(a,"["))break;{a=t.getObj();const n=[];for(;!isCmd(a,"]")&&a!==wa;){n.push(a);a=t.getObj()}e.mapBfRangeToArray(r,i,n)}}}throw new FormatError("Invalid bf range.")}function parseCidChar(e,t){for(;;){let a=t.getObj();if(a===wa)break;if(isCmd(a,"endcidchar"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectInt(a);const i=a;e.mapOne(r,i)}}function parseCidRange(e,t){for(;;){let a=t.getObj();if(a===wa)break;if(isCmd(a,"endcidrange"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=strToInt(a);a=t.getObj();expectInt(a);const n=a;e.mapCidRange(r,i,n)}}function parseCodespaceRange(e,t){for(;;){let a=t.getObj();if(a===wa)break;if(isCmd(a,"endcodespacerange"))return;if("string"!=typeof a)break;const r=strToInt(a);a=t.getObj();if("string"!=typeof a)break;const i=strToInt(a);e.addCodespaceRange(a.length,r,i)}throw new FormatError("Invalid codespace range.")}function parseWMode(e,t){const a=t.getObj();Number.isInteger(a)&&(e.vertical=!!a)}function parseCMapName(e,t){const a=t.getObj();a instanceof Name&&(e.name=a.name)}async function parseCMap(e,t,a,r){let i,n;e:for(;;)try{const a=t.getObj();if(a===wa)break;if(a instanceof Name){"WMode"===a.name?parseWMode(e,t):"CMapName"===a.name&&parseCMapName(e,t);i=a}else if(a instanceof Cmd)switch(a.cmd){case"endcmap":break e;case"usecmap":i instanceof Name&&(n=i.name);break;case"begincodespacerange":parseCodespaceRange(e,t);break;case"beginbfchar":parseBfChar(e,t);break;case"begincidchar":parseCidChar(e,t);break;case"beginbfrange":parseBfRange(e,t);break;case"begincidrange":parseCidRange(e,t)}}catch(e){if(e instanceof MissingDataException)throw e;warn("Invalid cMap data: "+e);continue}!r&&n&&(r=n);return r?extendCMap(e,a,r):e}async function extendCMap(e,t,a){e.useCMap=await createBuiltInCMap(a,t);if(0===e.numCodespaceRanges){const t=e.useCMap.codespaceRanges;for(let a=0;a<t.length;a++)e.codespaceRanges[a]=t[a].slice();e.numCodespaceRanges=e.useCMap.numCodespaceRanges}e.useCMap.forEach((function(t,a){e.contains(t)||e.mapOne(t,a)}));return e}async function createBuiltInCMap(e,t){if("Identity-H"===e)return new IdentityCMap(!1,2);if("Identity-V"===e)return new IdentityCMap(!0,2);if(!br.includes(e))throw new Error("Unknown CMap name: "+e);if(!t)throw new Error("Built-in CMap parameters are not provided.");const{cMapData:a,isCompressed:r}=await t(e),i=new CMap(!0);if(r)return(new BinaryCMapReader).process(a,i,(e=>extendCMap(i,t,e)));const n=new Lexer(new Stream(a));return parseCMap(i,n,t,null)}class CMapFactory{static async create({encoding:e,fetchBuiltInCMap:t,useCMap:a}){if(e instanceof Name)return createBuiltInCMap(e.name,t);if(e instanceof BaseStream){const r=await parseCMap(new CMap,new Lexer(e),t,a);return r.isIdentityCMap?createBuiltInCMap(r.name,t):r}throw new Error("Encoding required.")}}const wr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],xr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall","","","",""],Sr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"],Ar=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls","","","",""],kr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"],Cr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt",""],vr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191",""];function getEncoding(e){switch(e){case"WinAnsiEncoding":return kr;case"StandardEncoding":return Ar;case"MacRomanEncoding":return Sr;case"SymbolSetEncoding":return Cr;case"ZapfDingbatsEncoding":return vr;case"ExpertEncoding":return wr;case"MacExpertEncoding":return xr;default:return null}}const Fr=getLookupTableFactory((function(e){e.A=65;e.AE=198;e.AEacute=508;e.AEmacron=482;e.AEsmall=63462;e.Aacute=193;e.Aacutesmall=63457;e.Abreve=258;e.Abreveacute=7854;e.Abrevecyrillic=1232;e.Abrevedotbelow=7862;e.Abrevegrave=7856;e.Abrevehookabove=7858;e.Abrevetilde=7860;e.Acaron=461;e.Acircle=9398;e.Acircumflex=194;e.Acircumflexacute=7844;e.Acircumflexdotbelow=7852;e.Acircumflexgrave=7846;e.Acircumflexhookabove=7848;e.Acircumflexsmall=63458;e.Acircumflextilde=7850;e.Acute=63177;e.Acutesmall=63412;e.Acyrillic=1040;e.Adblgrave=512;e.Adieresis=196;e.Adieresiscyrillic=1234;e.Adieresismacron=478;e.Adieresissmall=63460;e.Adotbelow=7840;e.Adotmacron=480;e.Agrave=192;e.Agravesmall=63456;e.Ahookabove=7842;e.Aiecyrillic=1236;e.Ainvertedbreve=514;e.Alpha=913;e.Alphatonos=902;e.Amacron=256;e.Amonospace=65313;e.Aogonek=260;e.Aring=197;e.Aringacute=506;e.Aringbelow=7680;e.Aringsmall=63461;e.Asmall=63329;e.Atilde=195;e.Atildesmall=63459;e.Aybarmenian=1329;e.B=66;e.Bcircle=9399;e.Bdotaccent=7682;e.Bdotbelow=7684;e.Becyrillic=1041;e.Benarmenian=1330;e.Beta=914;e.Bhook=385;e.Blinebelow=7686;e.Bmonospace=65314;e.Brevesmall=63220;e.Bsmall=63330;e.Btopbar=386;e.C=67;e.Caarmenian=1342;e.Cacute=262;e.Caron=63178;e.Caronsmall=63221;e.Ccaron=268;e.Ccedilla=199;e.Ccedillaacute=7688;e.Ccedillasmall=63463;e.Ccircle=9400;e.Ccircumflex=264;e.Cdot=266;e.Cdotaccent=266;e.Cedillasmall=63416;e.Chaarmenian=1353;e.Cheabkhasiancyrillic=1212;e.Checyrillic=1063;e.Chedescenderabkhasiancyrillic=1214;e.Chedescendercyrillic=1206;e.Chedieresiscyrillic=1268;e.Cheharmenian=1347;e.Chekhakassiancyrillic=1227;e.Cheverticalstrokecyrillic=1208;e.Chi=935;e.Chook=391;e.Circumflexsmall=63222;e.Cmonospace=65315;e.Coarmenian=1361;e.Csmall=63331;e.D=68;e.DZ=497;e.DZcaron=452;e.Daarmenian=1332;e.Dafrican=393;e.Dcaron=270;e.Dcedilla=7696;e.Dcircle=9401;e.Dcircumflexbelow=7698;e.Dcroat=272;e.Ddotaccent=7690;e.Ddotbelow=7692;e.Decyrillic=1044;e.Deicoptic=1006;e.Delta=8710;e.Deltagreek=916;e.Dhook=394;e.Dieresis=63179;e.DieresisAcute=63180;e.DieresisGrave=63181;e.Dieresissmall=63400;e.Digammagreek=988;e.Djecyrillic=1026;e.Dlinebelow=7694;e.Dmonospace=65316;e.Dotaccentsmall=63223;e.Dslash=272;e.Dsmall=63332;e.Dtopbar=395;e.Dz=498;e.Dzcaron=453;e.Dzeabkhasiancyrillic=1248;e.Dzecyrillic=1029;e.Dzhecyrillic=1039;e.E=69;e.Eacute=201;e.Eacutesmall=63465;e.Ebreve=276;e.Ecaron=282;e.Ecedillabreve=7708;e.Echarmenian=1333;e.Ecircle=9402;e.Ecircumflex=202;e.Ecircumflexacute=7870;e.Ecircumflexbelow=7704;e.Ecircumflexdotbelow=7878;e.Ecircumflexgrave=7872;e.Ecircumflexhookabove=7874;e.Ecircumflexsmall=63466;e.Ecircumflextilde=7876;e.Ecyrillic=1028;e.Edblgrave=516;e.Edieresis=203;e.Edieresissmall=63467;e.Edot=278;e.Edotaccent=278;e.Edotbelow=7864;e.Efcyrillic=1060;e.Egrave=200;e.Egravesmall=63464;e.Eharmenian=1335;e.Ehookabove=7866;e.Eightroman=8551;e.Einvertedbreve=518;e.Eiotifiedcyrillic=1124;e.Elcyrillic=1051;e.Elevenroman=8554;e.Emacron=274;e.Emacronacute=7702;e.Emacrongrave=7700;e.Emcyrillic=1052;e.Emonospace=65317;e.Encyrillic=1053;e.Endescendercyrillic=1186;e.Eng=330;e.Enghecyrillic=1188;e.Enhookcyrillic=1223;e.Eogonek=280;e.Eopen=400;e.Epsilon=917;e.Epsilontonos=904;e.Ercyrillic=1056;e.Ereversed=398;e.Ereversedcyrillic=1069;e.Escyrillic=1057;e.Esdescendercyrillic=1194;e.Esh=425;e.Esmall=63333;e.Eta=919;e.Etarmenian=1336;e.Etatonos=905;e.Eth=208;e.Ethsmall=63472;e.Etilde=7868;e.Etildebelow=7706;e.Euro=8364;e.Ezh=439;e.Ezhcaron=494;e.Ezhreversed=440;e.F=70;e.Fcircle=9403;e.Fdotaccent=7710;e.Feharmenian=1366;e.Feicoptic=996;e.Fhook=401;e.Fitacyrillic=1138;e.Fiveroman=8548;e.Fmonospace=65318;e.Fourroman=8547;e.Fsmall=63334;e.G=71;e.GBsquare=13191;e.Gacute=500;e.Gamma=915;e.Gammaafrican=404;e.Gangiacoptic=1002;e.Gbreve=286;e.Gcaron=486;e.Gcedilla=290;e.Gcircle=9404;e.Gcircumflex=284;e.Gcommaaccent=290;e.Gdot=288;e.Gdotaccent=288;e.Gecyrillic=1043;e.Ghadarmenian=1346;e.Ghemiddlehookcyrillic=1172;e.Ghestrokecyrillic=1170;e.Gheupturncyrillic=1168;e.Ghook=403;e.Gimarmenian=1331;e.Gjecyrillic=1027;e.Gmacron=7712;e.Gmonospace=65319;e.Grave=63182;e.Gravesmall=63328;e.Gsmall=63335;e.Gsmallhook=667;e.Gstroke=484;e.H=72;e.H18533=9679;e.H18543=9642;e.H18551=9643;e.H22073=9633;e.HPsquare=13259;e.Haabkhasiancyrillic=1192;e.Hadescendercyrillic=1202;e.Hardsigncyrillic=1066;e.Hbar=294;e.Hbrevebelow=7722;e.Hcedilla=7720;e.Hcircle=9405;e.Hcircumflex=292;e.Hdieresis=7718;e.Hdotaccent=7714;e.Hdotbelow=7716;e.Hmonospace=65320;e.Hoarmenian=1344;e.Horicoptic=1e3;e.Hsmall=63336;e.Hungarumlaut=63183;e.Hungarumlautsmall=63224;e.Hzsquare=13200;e.I=73;e.IAcyrillic=1071;e.IJ=306;e.IUcyrillic=1070;e.Iacute=205;e.Iacutesmall=63469;e.Ibreve=300;e.Icaron=463;e.Icircle=9406;e.Icircumflex=206;e.Icircumflexsmall=63470;e.Icyrillic=1030;e.Idblgrave=520;e.Idieresis=207;e.Idieresisacute=7726;e.Idieresiscyrillic=1252;e.Idieresissmall=63471;e.Idot=304;e.Idotaccent=304;e.Idotbelow=7882;e.Iebrevecyrillic=1238;e.Iecyrillic=1045;e.Ifraktur=8465;e.Igrave=204;e.Igravesmall=63468;e.Ihookabove=7880;e.Iicyrillic=1048;e.Iinvertedbreve=522;e.Iishortcyrillic=1049;e.Imacron=298;e.Imacroncyrillic=1250;e.Imonospace=65321;e.Iniarmenian=1339;e.Iocyrillic=1025;e.Iogonek=302;e.Iota=921;e.Iotaafrican=406;e.Iotadieresis=938;e.Iotatonos=906;e.Ismall=63337;e.Istroke=407;e.Itilde=296;e.Itildebelow=7724;e.Izhitsacyrillic=1140;e.Izhitsadblgravecyrillic=1142;e.J=74;e.Jaarmenian=1345;e.Jcircle=9407;e.Jcircumflex=308;e.Jecyrillic=1032;e.Jheharmenian=1355;e.Jmonospace=65322;e.Jsmall=63338;e.K=75;e.KBsquare=13189;e.KKsquare=13261;e.Kabashkircyrillic=1184;e.Kacute=7728;e.Kacyrillic=1050;e.Kadescendercyrillic=1178;e.Kahookcyrillic=1219;e.Kappa=922;e.Kastrokecyrillic=1182;e.Kaverticalstrokecyrillic=1180;e.Kcaron=488;e.Kcedilla=310;e.Kcircle=9408;e.Kcommaaccent=310;e.Kdotbelow=7730;e.Keharmenian=1364;e.Kenarmenian=1343;e.Khacyrillic=1061;e.Kheicoptic=998;e.Khook=408;e.Kjecyrillic=1036;e.Klinebelow=7732;e.Kmonospace=65323;e.Koppacyrillic=1152;e.Koppagreek=990;e.Ksicyrillic=1134;e.Ksmall=63339;e.L=76;e.LJ=455;e.LL=63167;e.Lacute=313;e.Lambda=923;e.Lcaron=317;e.Lcedilla=315;e.Lcircle=9409;e.Lcircumflexbelow=7740;e.Lcommaaccent=315;e.Ldot=319;e.Ldotaccent=319;e.Ldotbelow=7734;e.Ldotbelowmacron=7736;e.Liwnarmenian=1340;e.Lj=456;e.Ljecyrillic=1033;e.Llinebelow=7738;e.Lmonospace=65324;e.Lslash=321;e.Lslashsmall=63225;e.Lsmall=63340;e.M=77;e.MBsquare=13190;e.Macron=63184;e.Macronsmall=63407;e.Macute=7742;e.Mcircle=9410;e.Mdotaccent=7744;e.Mdotbelow=7746;e.Menarmenian=1348;e.Mmonospace=65325;e.Msmall=63341;e.Mturned=412;e.Mu=924;e.N=78;e.NJ=458;e.Nacute=323;e.Ncaron=327;e.Ncedilla=325;e.Ncircle=9411;e.Ncircumflexbelow=7754;e.Ncommaaccent=325;e.Ndotaccent=7748;e.Ndotbelow=7750;e.Nhookleft=413;e.Nineroman=8552;e.Nj=459;e.Njecyrillic=1034;e.Nlinebelow=7752;e.Nmonospace=65326;e.Nowarmenian=1350;e.Nsmall=63342;e.Ntilde=209;e.Ntildesmall=63473;e.Nu=925;e.O=79;e.OE=338;e.OEsmall=63226;e.Oacute=211;e.Oacutesmall=63475;e.Obarredcyrillic=1256;e.Obarreddieresiscyrillic=1258;e.Obreve=334;e.Ocaron=465;e.Ocenteredtilde=415;e.Ocircle=9412;e.Ocircumflex=212;e.Ocircumflexacute=7888;e.Ocircumflexdotbelow=7896;e.Ocircumflexgrave=7890;e.Ocircumflexhookabove=7892;e.Ocircumflexsmall=63476;e.Ocircumflextilde=7894;e.Ocyrillic=1054;e.Odblacute=336;e.Odblgrave=524;e.Odieresis=214;e.Odieresiscyrillic=1254;e.Odieresissmall=63478;e.Odotbelow=7884;e.Ogoneksmall=63227;e.Ograve=210;e.Ogravesmall=63474;e.Oharmenian=1365;e.Ohm=8486;e.Ohookabove=7886;e.Ohorn=416;e.Ohornacute=7898;e.Ohorndotbelow=7906;e.Ohorngrave=7900;e.Ohornhookabove=7902;e.Ohorntilde=7904;e.Ohungarumlaut=336;e.Oi=418;e.Oinvertedbreve=526;e.Omacron=332;e.Omacronacute=7762;e.Omacrongrave=7760;e.Omega=8486;e.Omegacyrillic=1120;e.Omegagreek=937;e.Omegaroundcyrillic=1146;e.Omegatitlocyrillic=1148;e.Omegatonos=911;e.Omicron=927;e.Omicrontonos=908;e.Omonospace=65327;e.Oneroman=8544;e.Oogonek=490;e.Oogonekmacron=492;e.Oopen=390;e.Oslash=216;e.Oslashacute=510;e.Oslashsmall=63480;e.Osmall=63343;e.Ostrokeacute=510;e.Otcyrillic=1150;e.Otilde=213;e.Otildeacute=7756;e.Otildedieresis=7758;e.Otildesmall=63477;e.P=80;e.Pacute=7764;e.Pcircle=9413;e.Pdotaccent=7766;e.Pecyrillic=1055;e.Peharmenian=1354;e.Pemiddlehookcyrillic=1190;e.Phi=934;e.Phook=420;e.Pi=928;e.Piwrarmenian=1363;e.Pmonospace=65328;e.Psi=936;e.Psicyrillic=1136;e.Psmall=63344;e.Q=81;e.Qcircle=9414;e.Qmonospace=65329;e.Qsmall=63345;e.R=82;e.Raarmenian=1356;e.Racute=340;e.Rcaron=344;e.Rcedilla=342;e.Rcircle=9415;e.Rcommaaccent=342;e.Rdblgrave=528;e.Rdotaccent=7768;e.Rdotbelow=7770;e.Rdotbelowmacron=7772;e.Reharmenian=1360;e.Rfraktur=8476;e.Rho=929;e.Ringsmall=63228;e.Rinvertedbreve=530;e.Rlinebelow=7774;e.Rmonospace=65330;e.Rsmall=63346;e.Rsmallinverted=641;e.Rsmallinvertedsuperior=694;e.S=83;e.SF010000=9484;e.SF020000=9492;e.SF030000=9488;e.SF040000=9496;e.SF050000=9532;e.SF060000=9516;e.SF070000=9524;e.SF080000=9500;e.SF090000=9508;e.SF100000=9472;e.SF110000=9474;e.SF190000=9569;e.SF200000=9570;e.SF210000=9558;e.SF220000=9557;e.SF230000=9571;e.SF240000=9553;e.SF250000=9559;e.SF260000=9565;e.SF270000=9564;e.SF280000=9563;e.SF360000=9566;e.SF370000=9567;e.SF380000=9562;e.SF390000=9556;e.SF400000=9577;e.SF410000=9574;e.SF420000=9568;e.SF430000=9552;e.SF440000=9580;e.SF450000=9575;e.SF460000=9576;e.SF470000=9572;e.SF480000=9573;e.SF490000=9561;e.SF500000=9560;e.SF510000=9554;e.SF520000=9555;e.SF530000=9579;e.SF540000=9578;e.Sacute=346;e.Sacutedotaccent=7780;e.Sampigreek=992;e.Scaron=352;e.Scarondotaccent=7782;e.Scaronsmall=63229;e.Scedilla=350;e.Schwa=399;e.Schwacyrillic=1240;e.Schwadieresiscyrillic=1242;e.Scircle=9416;e.Scircumflex=348;e.Scommaaccent=536;e.Sdotaccent=7776;e.Sdotbelow=7778;e.Sdotbelowdotaccent=7784;e.Seharmenian=1357;e.Sevenroman=8550;e.Shaarmenian=1351;e.Shacyrillic=1064;e.Shchacyrillic=1065;e.Sheicoptic=994;e.Shhacyrillic=1210;e.Shimacoptic=1004;e.Sigma=931;e.Sixroman=8549;e.Smonospace=65331;e.Softsigncyrillic=1068;e.Ssmall=63347;e.Stigmagreek=986;e.T=84;e.Tau=932;e.Tbar=358;e.Tcaron=356;e.Tcedilla=354;e.Tcircle=9417;e.Tcircumflexbelow=7792;e.Tcommaaccent=354;e.Tdotaccent=7786;e.Tdotbelow=7788;e.Tecyrillic=1058;e.Tedescendercyrillic=1196;e.Tenroman=8553;e.Tetsecyrillic=1204;e.Theta=920;e.Thook=428;e.Thorn=222;e.Thornsmall=63486;e.Threeroman=8546;e.Tildesmall=63230;e.Tiwnarmenian=1359;e.Tlinebelow=7790;e.Tmonospace=65332;e.Toarmenian=1337;e.Tonefive=444;e.Tonesix=388;e.Tonetwo=423;e.Tretroflexhook=430;e.Tsecyrillic=1062;e.Tshecyrillic=1035;e.Tsmall=63348;e.Twelveroman=8555;e.Tworoman=8545;e.U=85;e.Uacute=218;e.Uacutesmall=63482;e.Ubreve=364;e.Ucaron=467;e.Ucircle=9418;e.Ucircumflex=219;e.Ucircumflexbelow=7798;e.Ucircumflexsmall=63483;e.Ucyrillic=1059;e.Udblacute=368;e.Udblgrave=532;e.Udieresis=220;e.Udieresisacute=471;e.Udieresisbelow=7794;e.Udieresiscaron=473;e.Udieresiscyrillic=1264;e.Udieresisgrave=475;e.Udieresismacron=469;e.Udieresissmall=63484;e.Udotbelow=7908;e.Ugrave=217;e.Ugravesmall=63481;e.Uhookabove=7910;e.Uhorn=431;e.Uhornacute=7912;e.Uhorndotbelow=7920;e.Uhorngrave=7914;e.Uhornhookabove=7916;e.Uhorntilde=7918;e.Uhungarumlaut=368;e.Uhungarumlautcyrillic=1266;e.Uinvertedbreve=534;e.Ukcyrillic=1144;e.Umacron=362;e.Umacroncyrillic=1262;e.Umacrondieresis=7802;e.Umonospace=65333;e.Uogonek=370;e.Upsilon=933;e.Upsilon1=978;e.Upsilonacutehooksymbolgreek=979;e.Upsilonafrican=433;e.Upsilondieresis=939;e.Upsilondieresishooksymbolgreek=980;e.Upsilonhooksymbol=978;e.Upsilontonos=910;e.Uring=366;e.Ushortcyrillic=1038;e.Usmall=63349;e.Ustraightcyrillic=1198;e.Ustraightstrokecyrillic=1200;e.Utilde=360;e.Utildeacute=7800;e.Utildebelow=7796;e.V=86;e.Vcircle=9419;e.Vdotbelow=7806;e.Vecyrillic=1042;e.Vewarmenian=1358;e.Vhook=434;e.Vmonospace=65334;e.Voarmenian=1352;e.Vsmall=63350;e.Vtilde=7804;e.W=87;e.Wacute=7810;e.Wcircle=9420;e.Wcircumflex=372;e.Wdieresis=7812;e.Wdotaccent=7814;e.Wdotbelow=7816;e.Wgrave=7808;e.Wmonospace=65335;e.Wsmall=63351;e.X=88;e.Xcircle=9421;e.Xdieresis=7820;e.Xdotaccent=7818;e.Xeharmenian=1341;e.Xi=926;e.Xmonospace=65336;e.Xsmall=63352;e.Y=89;e.Yacute=221;e.Yacutesmall=63485;e.Yatcyrillic=1122;e.Ycircle=9422;e.Ycircumflex=374;e.Ydieresis=376;e.Ydieresissmall=63487;e.Ydotaccent=7822;e.Ydotbelow=7924;e.Yericyrillic=1067;e.Yerudieresiscyrillic=1272;e.Ygrave=7922;e.Yhook=435;e.Yhookabove=7926;e.Yiarmenian=1349;e.Yicyrillic=1031;e.Yiwnarmenian=1362;e.Ymonospace=65337;e.Ysmall=63353;e.Ytilde=7928;e.Yusbigcyrillic=1130;e.Yusbigiotifiedcyrillic=1132;e.Yuslittlecyrillic=1126;e.Yuslittleiotifiedcyrillic=1128;e.Z=90;e.Zaarmenian=1334;e.Zacute=377;e.Zcaron=381;e.Zcaronsmall=63231;e.Zcircle=9423;e.Zcircumflex=7824;e.Zdot=379;e.Zdotaccent=379;e.Zdotbelow=7826;e.Zecyrillic=1047;e.Zedescendercyrillic=1176;e.Zedieresiscyrillic=1246;e.Zeta=918;e.Zhearmenian=1338;e.Zhebrevecyrillic=1217;e.Zhecyrillic=1046;e.Zhedescendercyrillic=1174;e.Zhedieresiscyrillic=1244;e.Zlinebelow=7828;e.Zmonospace=65338;e.Zsmall=63354;e.Zstroke=437;e.a=97;e.aabengali=2438;e.aacute=225;e.aadeva=2310;e.aagujarati=2694;e.aagurmukhi=2566;e.aamatragurmukhi=2622;e.aarusquare=13059;e.aavowelsignbengali=2494;e.aavowelsigndeva=2366;e.aavowelsigngujarati=2750;e.abbreviationmarkarmenian=1375;e.abbreviationsigndeva=2416;e.abengali=2437;e.abopomofo=12570;e.abreve=259;e.abreveacute=7855;e.abrevecyrillic=1233;e.abrevedotbelow=7863;e.abrevegrave=7857;e.abrevehookabove=7859;e.abrevetilde=7861;e.acaron=462;e.acircle=9424;e.acircumflex=226;e.acircumflexacute=7845;e.acircumflexdotbelow=7853;e.acircumflexgrave=7847;e.acircumflexhookabove=7849;e.acircumflextilde=7851;e.acute=180;e.acutebelowcmb=791;e.acutecmb=769;e.acutecomb=769;e.acutedeva=2388;e.acutelowmod=719;e.acutetonecmb=833;e.acyrillic=1072;e.adblgrave=513;e.addakgurmukhi=2673;e.adeva=2309;e.adieresis=228;e.adieresiscyrillic=1235;e.adieresismacron=479;e.adotbelow=7841;e.adotmacron=481;e.ae=230;e.aeacute=509;e.aekorean=12624;e.aemacron=483;e.afii00208=8213;e.afii08941=8356;e.afii10017=1040;e.afii10018=1041;e.afii10019=1042;e.afii10020=1043;e.afii10021=1044;e.afii10022=1045;e.afii10023=1025;e.afii10024=1046;e.afii10025=1047;e.afii10026=1048;e.afii10027=1049;e.afii10028=1050;e.afii10029=1051;e.afii10030=1052;e.afii10031=1053;e.afii10032=1054;e.afii10033=1055;e.afii10034=1056;e.afii10035=1057;e.afii10036=1058;e.afii10037=1059;e.afii10038=1060;e.afii10039=1061;e.afii10040=1062;e.afii10041=1063;e.afii10042=1064;e.afii10043=1065;e.afii10044=1066;e.afii10045=1067;e.afii10046=1068;e.afii10047=1069;e.afii10048=1070;e.afii10049=1071;e.afii10050=1168;e.afii10051=1026;e.afii10052=1027;e.afii10053=1028;e.afii10054=1029;e.afii10055=1030;e.afii10056=1031;e.afii10057=1032;e.afii10058=1033;e.afii10059=1034;e.afii10060=1035;e.afii10061=1036;e.afii10062=1038;e.afii10063=63172;e.afii10064=63173;e.afii10065=1072;e.afii10066=1073;e.afii10067=1074;e.afii10068=1075;e.afii10069=1076;e.afii10070=1077;e.afii10071=1105;e.afii10072=1078;e.afii10073=1079;e.afii10074=1080;e.afii10075=1081;e.afii10076=1082;e.afii10077=1083;e.afii10078=1084;e.afii10079=1085;e.afii10080=1086;e.afii10081=1087;e.afii10082=1088;e.afii10083=1089;e.afii10084=1090;e.afii10085=1091;e.afii10086=1092;e.afii10087=1093;e.afii10088=1094;e.afii10089=1095;e.afii10090=1096;e.afii10091=1097;e.afii10092=1098;e.afii10093=1099;e.afii10094=1100;e.afii10095=1101;e.afii10096=1102;e.afii10097=1103;e.afii10098=1169;e.afii10099=1106;e.afii10100=1107;e.afii10101=1108;e.afii10102=1109;e.afii10103=1110;e.afii10104=1111;e.afii10105=1112;e.afii10106=1113;e.afii10107=1114;e.afii10108=1115;e.afii10109=1116;e.afii10110=1118;e.afii10145=1039;e.afii10146=1122;e.afii10147=1138;e.afii10148=1140;e.afii10192=63174;e.afii10193=1119;e.afii10194=1123;e.afii10195=1139;e.afii10196=1141;e.afii10831=63175;e.afii10832=63176;e.afii10846=1241;e.afii299=8206;e.afii300=8207;e.afii301=8205;e.afii57381=1642;e.afii57388=1548;e.afii57392=1632;e.afii57393=1633;e.afii57394=1634;e.afii57395=1635;e.afii57396=1636;e.afii57397=1637;e.afii57398=1638;e.afii57399=1639;e.afii57400=1640;e.afii57401=1641;e.afii57403=1563;e.afii57407=1567;e.afii57409=1569;e.afii57410=1570;e.afii57411=1571;e.afii57412=1572;e.afii57413=1573;e.afii57414=1574;e.afii57415=1575;e.afii57416=1576;e.afii57417=1577;e.afii57418=1578;e.afii57419=1579;e.afii57420=1580;e.afii57421=1581;e.afii57422=1582;e.afii57423=1583;e.afii57424=1584;e.afii57425=1585;e.afii57426=1586;e.afii57427=1587;e.afii57428=1588;e.afii57429=1589;e.afii57430=1590;e.afii57431=1591;e.afii57432=1592;e.afii57433=1593;e.afii57434=1594;e.afii57440=1600;e.afii57441=1601;e.afii57442=1602;e.afii57443=1603;e.afii57444=1604;e.afii57445=1605;e.afii57446=1606;e.afii57448=1608;e.afii57449=1609;e.afii57450=1610;e.afii57451=1611;e.afii57452=1612;e.afii57453=1613;e.afii57454=1614;e.afii57455=1615;e.afii57456=1616;e.afii57457=1617;e.afii57458=1618;e.afii57470=1607;e.afii57505=1700;e.afii57506=1662;e.afii57507=1670;e.afii57508=1688;e.afii57509=1711;e.afii57511=1657;e.afii57512=1672;e.afii57513=1681;e.afii57514=1722;e.afii57519=1746;e.afii57534=1749;e.afii57636=8362;e.afii57645=1470;e.afii57658=1475;e.afii57664=1488;e.afii57665=1489;e.afii57666=1490;e.afii57667=1491;e.afii57668=1492;e.afii57669=1493;e.afii57670=1494;e.afii57671=1495;e.afii57672=1496;e.afii57673=1497;e.afii57674=1498;e.afii57675=1499;e.afii57676=1500;e.afii57677=1501;e.afii57678=1502;e.afii57679=1503;e.afii57680=1504;e.afii57681=1505;e.afii57682=1506;e.afii57683=1507;e.afii57684=1508;e.afii57685=1509;e.afii57686=1510;e.afii57687=1511;e.afii57688=1512;e.afii57689=1513;e.afii57690=1514;e.afii57694=64298;e.afii57695=64299;e.afii57700=64331;e.afii57705=64287;e.afii57716=1520;e.afii57717=1521;e.afii57718=1522;e.afii57723=64309;e.afii57793=1460;e.afii57794=1461;e.afii57795=1462;e.afii57796=1467;e.afii57797=1464;e.afii57798=1463;e.afii57799=1456;e.afii57800=1458;e.afii57801=1457;e.afii57802=1459;e.afii57803=1474;e.afii57804=1473;e.afii57806=1465;e.afii57807=1468;e.afii57839=1469;e.afii57841=1471;e.afii57842=1472;e.afii57929=700;e.afii61248=8453;e.afii61289=8467;e.afii61352=8470;e.afii61573=8236;e.afii61574=8237;e.afii61575=8238;e.afii61664=8204;e.afii63167=1645;e.afii64937=701;e.agrave=224;e.agujarati=2693;e.agurmukhi=2565;e.ahiragana=12354;e.ahookabove=7843;e.aibengali=2448;e.aibopomofo=12574;e.aideva=2320;e.aiecyrillic=1237;e.aigujarati=2704;e.aigurmukhi=2576;e.aimatragurmukhi=2632;e.ainarabic=1593;e.ainfinalarabic=65226;e.aininitialarabic=65227;e.ainmedialarabic=65228;e.ainvertedbreve=515;e.aivowelsignbengali=2504;e.aivowelsigndeva=2376;e.aivowelsigngujarati=2760;e.akatakana=12450;e.akatakanahalfwidth=65393;e.akorean=12623;e.alef=1488;e.alefarabic=1575;e.alefdageshhebrew=64304;e.aleffinalarabic=65166;e.alefhamzaabovearabic=1571;e.alefhamzaabovefinalarabic=65156;e.alefhamzabelowarabic=1573;e.alefhamzabelowfinalarabic=65160;e.alefhebrew=1488;e.aleflamedhebrew=64335;e.alefmaddaabovearabic=1570;e.alefmaddaabovefinalarabic=65154;e.alefmaksuraarabic=1609;e.alefmaksurafinalarabic=65264;e.alefmaksurainitialarabic=65267;e.alefmaksuramedialarabic=65268;e.alefpatahhebrew=64302;e.alefqamatshebrew=64303;e.aleph=8501;e.allequal=8780;e.alpha=945;e.alphatonos=940;e.amacron=257;e.amonospace=65345;e.ampersand=38;e.ampersandmonospace=65286;e.ampersandsmall=63270;e.amsquare=13250;e.anbopomofo=12578;e.angbopomofo=12580;e.angbracketleft=12296;e.angbracketright=12297;e.angkhankhuthai=3674;e.angle=8736;e.anglebracketleft=12296;e.anglebracketleftvertical=65087;e.anglebracketright=12297;e.anglebracketrightvertical=65088;e.angleleft=9001;e.angleright=9002;e.angstrom=8491;e.anoteleia=903;e.anudattadeva=2386;e.anusvarabengali=2434;e.anusvaradeva=2306;e.anusvaragujarati=2690;e.aogonek=261;e.apaatosquare=13056;e.aparen=9372;e.apostrophearmenian=1370;e.apostrophemod=700;e.apple=63743;e.approaches=8784;e.approxequal=8776;e.approxequalorimage=8786;e.approximatelyequal=8773;e.araeaekorean=12686;e.araeakorean=12685;e.arc=8978;e.arighthalfring=7834;e.aring=229;e.aringacute=507;e.aringbelow=7681;e.arrowboth=8596;e.arrowdashdown=8675;e.arrowdashleft=8672;e.arrowdashright=8674;e.arrowdashup=8673;e.arrowdblboth=8660;e.arrowdbldown=8659;e.arrowdblleft=8656;e.arrowdblright=8658;e.arrowdblup=8657;e.arrowdown=8595;e.arrowdownleft=8601;e.arrowdownright=8600;e.arrowdownwhite=8681;e.arrowheaddownmod=709;e.arrowheadleftmod=706;e.arrowheadrightmod=707;e.arrowheadupmod=708;e.arrowhorizex=63719;e.arrowleft=8592;e.arrowleftdbl=8656;e.arrowleftdblstroke=8653;e.arrowleftoverright=8646;e.arrowleftwhite=8678;e.arrowright=8594;e.arrowrightdblstroke=8655;e.arrowrightheavy=10142;e.arrowrightoverleft=8644;e.arrowrightwhite=8680;e.arrowtableft=8676;e.arrowtabright=8677;e.arrowup=8593;e.arrowupdn=8597;e.arrowupdnbse=8616;e.arrowupdownbase=8616;e.arrowupleft=8598;e.arrowupleftofdown=8645;e.arrowupright=8599;e.arrowupwhite=8679;e.arrowvertex=63718;e.asciicircum=94;e.asciicircummonospace=65342;e.asciitilde=126;e.asciitildemonospace=65374;e.ascript=593;e.ascriptturned=594;e.asmallhiragana=12353;e.asmallkatakana=12449;e.asmallkatakanahalfwidth=65383;e.asterisk=42;e.asteriskaltonearabic=1645;e.asteriskarabic=1645;e.asteriskmath=8727;e.asteriskmonospace=65290;e.asterisksmall=65121;e.asterism=8258;e.asuperior=63209;e.asymptoticallyequal=8771;e.at=64;e.atilde=227;e.atmonospace=65312;e.atsmall=65131;e.aturned=592;e.aubengali=2452;e.aubopomofo=12576;e.audeva=2324;e.augujarati=2708;e.augurmukhi=2580;e.aulengthmarkbengali=2519;e.aumatragurmukhi=2636;e.auvowelsignbengali=2508;e.auvowelsigndeva=2380;e.auvowelsigngujarati=2764;e.avagrahadeva=2365;e.aybarmenian=1377;e.ayin=1506;e.ayinaltonehebrew=64288;e.ayinhebrew=1506;e.b=98;e.babengali=2476;e.backslash=92;e.backslashmonospace=65340;e.badeva=2348;e.bagujarati=2732;e.bagurmukhi=2604;e.bahiragana=12400;e.bahtthai=3647;e.bakatakana=12496;e.bar=124;e.barmonospace=65372;e.bbopomofo=12549;e.bcircle=9425;e.bdotaccent=7683;e.bdotbelow=7685;e.beamedsixteenthnotes=9836;e.because=8757;e.becyrillic=1073;e.beharabic=1576;e.behfinalarabic=65168;e.behinitialarabic=65169;e.behiragana=12409;e.behmedialarabic=65170;e.behmeeminitialarabic=64671;e.behmeemisolatedarabic=64520;e.behnoonfinalarabic=64621;e.bekatakana=12505;e.benarmenian=1378;e.bet=1489;e.beta=946;e.betasymbolgreek=976;e.betdagesh=64305;e.betdageshhebrew=64305;e.bethebrew=1489;e.betrafehebrew=64332;e.bhabengali=2477;e.bhadeva=2349;e.bhagujarati=2733;e.bhagurmukhi=2605;e.bhook=595;e.bihiragana=12403;e.bikatakana=12499;e.bilabialclick=664;e.bindigurmukhi=2562;e.birusquare=13105;e.blackcircle=9679;e.blackdiamond=9670;e.blackdownpointingtriangle=9660;e.blackleftpointingpointer=9668;e.blackleftpointingtriangle=9664;e.blacklenticularbracketleft=12304;e.blacklenticularbracketleftvertical=65083;e.blacklenticularbracketright=12305;e.blacklenticularbracketrightvertical=65084;e.blacklowerlefttriangle=9699;e.blacklowerrighttriangle=9698;e.blackrectangle=9644;e.blackrightpointingpointer=9658;e.blackrightpointingtriangle=9654;e.blacksmallsquare=9642;e.blacksmilingface=9787;e.blacksquare=9632;e.blackstar=9733;e.blackupperlefttriangle=9700;e.blackupperrighttriangle=9701;e.blackuppointingsmalltriangle=9652;e.blackuppointingtriangle=9650;e.blank=9251;e.blinebelow=7687;e.block=9608;e.bmonospace=65346;e.bobaimaithai=3610;e.bohiragana=12412;e.bokatakana=12508;e.bparen=9373;e.bqsquare=13251;e.braceex=63732;e.braceleft=123;e.braceleftbt=63731;e.braceleftmid=63730;e.braceleftmonospace=65371;e.braceleftsmall=65115;e.bracelefttp=63729;e.braceleftvertical=65079;e.braceright=125;e.bracerightbt=63742;e.bracerightmid=63741;e.bracerightmonospace=65373;e.bracerightsmall=65116;e.bracerighttp=63740;e.bracerightvertical=65080;e.bracketleft=91;e.bracketleftbt=63728;e.bracketleftex=63727;e.bracketleftmonospace=65339;e.bracketlefttp=63726;e.bracketright=93;e.bracketrightbt=63739;e.bracketrightex=63738;e.bracketrightmonospace=65341;e.bracketrighttp=63737;e.breve=728;e.brevebelowcmb=814;e.brevecmb=774;e.breveinvertedbelowcmb=815;e.breveinvertedcmb=785;e.breveinverteddoublecmb=865;e.bridgebelowcmb=810;e.bridgeinvertedbelowcmb=826;e.brokenbar=166;e.bstroke=384;e.bsuperior=63210;e.btopbar=387;e.buhiragana=12406;e.bukatakana=12502;e.bullet=8226;e.bulletinverse=9688;e.bulletoperator=8729;e.bullseye=9678;e.c=99;e.caarmenian=1390;e.cabengali=2458;e.cacute=263;e.cadeva=2330;e.cagujarati=2714;e.cagurmukhi=2586;e.calsquare=13192;e.candrabindubengali=2433;e.candrabinducmb=784;e.candrabindudeva=2305;e.candrabindugujarati=2689;e.capslock=8682;e.careof=8453;e.caron=711;e.caronbelowcmb=812;e.caroncmb=780;e.carriagereturn=8629;e.cbopomofo=12568;e.ccaron=269;e.ccedilla=231;e.ccedillaacute=7689;e.ccircle=9426;e.ccircumflex=265;e.ccurl=597;e.cdot=267;e.cdotaccent=267;e.cdsquare=13253;e.cedilla=184;e.cedillacmb=807;e.cent=162;e.centigrade=8451;e.centinferior=63199;e.centmonospace=65504;e.centoldstyle=63394;e.centsuperior=63200;e.chaarmenian=1401;e.chabengali=2459;e.chadeva=2331;e.chagujarati=2715;e.chagurmukhi=2587;e.chbopomofo=12564;e.cheabkhasiancyrillic=1213;e.checkmark=10003;e.checyrillic=1095;e.chedescenderabkhasiancyrillic=1215;e.chedescendercyrillic=1207;e.chedieresiscyrillic=1269;e.cheharmenian=1395;e.chekhakassiancyrillic=1228;e.cheverticalstrokecyrillic=1209;e.chi=967;e.chieuchacirclekorean=12919;e.chieuchaparenkorean=12823;e.chieuchcirclekorean=12905;e.chieuchkorean=12618;e.chieuchparenkorean=12809;e.chochangthai=3594;e.chochanthai=3592;e.chochingthai=3593;e.chochoethai=3596;e.chook=392;e.cieucacirclekorean=12918;e.cieucaparenkorean=12822;e.cieuccirclekorean=12904;e.cieuckorean=12616;e.cieucparenkorean=12808;e.cieucuparenkorean=12828;e.circle=9675;e.circlecopyrt=169;e.circlemultiply=8855;e.circleot=8857;e.circleplus=8853;e.circlepostalmark=12342;e.circlewithlefthalfblack=9680;e.circlewithrighthalfblack=9681;e.circumflex=710;e.circumflexbelowcmb=813;e.circumflexcmb=770;e.clear=8999;e.clickalveolar=450;e.clickdental=448;e.clicklateral=449;e.clickretroflex=451;e.club=9827;e.clubsuitblack=9827;e.clubsuitwhite=9831;e.cmcubedsquare=13220;e.cmonospace=65347;e.cmsquaredsquare=13216;e.coarmenian=1409;e.colon=58;e.colonmonetary=8353;e.colonmonospace=65306;e.colonsign=8353;e.colonsmall=65109;e.colontriangularhalfmod=721;e.colontriangularmod=720;e.comma=44;e.commaabovecmb=787;e.commaaboverightcmb=789;e.commaaccent=63171;e.commaarabic=1548;e.commaarmenian=1373;e.commainferior=63201;e.commamonospace=65292;e.commareversedabovecmb=788;e.commareversedmod=701;e.commasmall=65104;e.commasuperior=63202;e.commaturnedabovecmb=786;e.commaturnedmod=699;e.compass=9788;e.congruent=8773;e.contourintegral=8750;e.control=8963;e.controlACK=6;e.controlBEL=7;e.controlBS=8;e.controlCAN=24;e.controlCR=13;e.controlDC1=17;e.controlDC2=18;e.controlDC3=19;e.controlDC4=20;e.controlDEL=127;e.controlDLE=16;e.controlEM=25;e.controlENQ=5;e.controlEOT=4;e.controlESC=27;e.controlETB=23;e.controlETX=3;e.controlFF=12;e.controlFS=28;e.controlGS=29;e.controlHT=9;e.controlLF=10;e.controlNAK=21;e.controlNULL=0;e.controlRS=30;e.controlSI=15;e.controlSO=14;e.controlSOT=2;e.controlSTX=1;e.controlSUB=26;e.controlSYN=22;e.controlUS=31;e.controlVT=11;e.copyright=169;e.copyrightsans=63721;e.copyrightserif=63193;e.cornerbracketleft=12300;e.cornerbracketlefthalfwidth=65378;e.cornerbracketleftvertical=65089;e.cornerbracketright=12301;e.cornerbracketrighthalfwidth=65379;e.cornerbracketrightvertical=65090;e.corporationsquare=13183;e.cosquare=13255;e.coverkgsquare=13254;e.cparen=9374;e.cruzeiro=8354;e.cstretched=663;e.curlyand=8911;e.curlyor=8910;e.currency=164;e.cyrBreve=63185;e.cyrFlex=63186;e.cyrbreve=63188;e.cyrflex=63189;e.d=100;e.daarmenian=1380;e.dabengali=2470;e.dadarabic=1590;e.dadeva=2342;e.dadfinalarabic=65214;e.dadinitialarabic=65215;e.dadmedialarabic=65216;e.dagesh=1468;e.dageshhebrew=1468;e.dagger=8224;e.daggerdbl=8225;e.dagujarati=2726;e.dagurmukhi=2598;e.dahiragana=12384;e.dakatakana=12480;e.dalarabic=1583;e.dalet=1491;e.daletdagesh=64307;e.daletdageshhebrew=64307;e.dalethebrew=1491;e.dalfinalarabic=65194;e.dammaarabic=1615;e.dammalowarabic=1615;e.dammatanaltonearabic=1612;e.dammatanarabic=1612;e.danda=2404;e.dargahebrew=1447;e.dargalefthebrew=1447;e.dasiapneumatacyrilliccmb=1157;e.dblGrave=63187;e.dblanglebracketleft=12298;e.dblanglebracketleftvertical=65085;e.dblanglebracketright=12299;e.dblanglebracketrightvertical=65086;e.dblarchinvertedbelowcmb=811;e.dblarrowleft=8660;e.dblarrowright=8658;e.dbldanda=2405;e.dblgrave=63190;e.dblgravecmb=783;e.dblintegral=8748;e.dbllowline=8215;e.dbllowlinecmb=819;e.dbloverlinecmb=831;e.dblprimemod=698;e.dblverticalbar=8214;e.dblverticallineabovecmb=782;e.dbopomofo=12553;e.dbsquare=13256;e.dcaron=271;e.dcedilla=7697;e.dcircle=9427;e.dcircumflexbelow=7699;e.dcroat=273;e.ddabengali=2465;e.ddadeva=2337;e.ddagujarati=2721;e.ddagurmukhi=2593;e.ddalarabic=1672;e.ddalfinalarabic=64393;e.dddhadeva=2396;e.ddhabengali=2466;e.ddhadeva=2338;e.ddhagujarati=2722;e.ddhagurmukhi=2594;e.ddotaccent=7691;e.ddotbelow=7693;e.decimalseparatorarabic=1643;e.decimalseparatorpersian=1643;e.decyrillic=1076;e.degree=176;e.dehihebrew=1453;e.dehiragana=12391;e.deicoptic=1007;e.dekatakana=12487;e.deleteleft=9003;e.deleteright=8998;e.delta=948;e.deltaturned=397;e.denominatorminusonenumeratorbengali=2552;e.dezh=676;e.dhabengali=2471;e.dhadeva=2343;e.dhagujarati=2727;e.dhagurmukhi=2599;e.dhook=599;e.dialytikatonos=901;e.dialytikatonoscmb=836;e.diamond=9830;e.diamondsuitwhite=9826;e.dieresis=168;e.dieresisacute=63191;e.dieresisbelowcmb=804;e.dieresiscmb=776;e.dieresisgrave=63192;e.dieresistonos=901;e.dihiragana=12386;e.dikatakana=12482;e.dittomark=12291;e.divide=247;e.divides=8739;e.divisionslash=8725;e.djecyrillic=1106;e.dkshade=9619;e.dlinebelow=7695;e.dlsquare=13207;e.dmacron=273;e.dmonospace=65348;e.dnblock=9604;e.dochadathai=3598;e.dodekthai=3604;e.dohiragana=12393;e.dokatakana=12489;e.dollar=36;e.dollarinferior=63203;e.dollarmonospace=65284;e.dollaroldstyle=63268;e.dollarsmall=65129;e.dollarsuperior=63204;e.dong=8363;e.dorusquare=13094;e.dotaccent=729;e.dotaccentcmb=775;e.dotbelowcmb=803;e.dotbelowcomb=803;e.dotkatakana=12539;e.dotlessi=305;e.dotlessj=63166;e.dotlessjstrokehook=644;e.dotmath=8901;e.dottedcircle=9676;e.doubleyodpatah=64287;e.doubleyodpatahhebrew=64287;e.downtackbelowcmb=798;e.downtackmod=725;e.dparen=9375;e.dsuperior=63211;e.dtail=598;e.dtopbar=396;e.duhiragana=12389;e.dukatakana=12485;e.dz=499;e.dzaltone=675;e.dzcaron=454;e.dzcurl=677;e.dzeabkhasiancyrillic=1249;e.dzecyrillic=1109;e.dzhecyrillic=1119;e.e=101;e.eacute=233;e.earth=9793;e.ebengali=2447;e.ebopomofo=12572;e.ebreve=277;e.ecandradeva=2317;e.ecandragujarati=2701;e.ecandravowelsigndeva=2373;e.ecandravowelsigngujarati=2757;e.ecaron=283;e.ecedillabreve=7709;e.echarmenian=1381;e.echyiwnarmenian=1415;e.ecircle=9428;e.ecircumflex=234;e.ecircumflexacute=7871;e.ecircumflexbelow=7705;e.ecircumflexdotbelow=7879;e.ecircumflexgrave=7873;e.ecircumflexhookabove=7875;e.ecircumflextilde=7877;e.ecyrillic=1108;e.edblgrave=517;e.edeva=2319;e.edieresis=235;e.edot=279;e.edotaccent=279;e.edotbelow=7865;e.eegurmukhi=2575;e.eematragurmukhi=2631;e.efcyrillic=1092;e.egrave=232;e.egujarati=2703;e.eharmenian=1383;e.ehbopomofo=12573;e.ehiragana=12360;e.ehookabove=7867;e.eibopomofo=12575;e.eight=56;e.eightarabic=1640;e.eightbengali=2542;e.eightcircle=9319;e.eightcircleinversesansserif=10129;e.eightdeva=2414;e.eighteencircle=9329;e.eighteenparen=9349;e.eighteenperiod=9369;e.eightgujarati=2798;e.eightgurmukhi=2670;e.eighthackarabic=1640;e.eighthangzhou=12328;e.eighthnotebeamed=9835;e.eightideographicparen=12839;e.eightinferior=8328;e.eightmonospace=65304;e.eightoldstyle=63288;e.eightparen=9339;e.eightperiod=9359;e.eightpersian=1784;e.eightroman=8567;e.eightsuperior=8312;e.eightthai=3672;e.einvertedbreve=519;e.eiotifiedcyrillic=1125;e.ekatakana=12456;e.ekatakanahalfwidth=65396;e.ekonkargurmukhi=2676;e.ekorean=12628;e.elcyrillic=1083;e.element=8712;e.elevencircle=9322;e.elevenparen=9342;e.elevenperiod=9362;e.elevenroman=8570;e.ellipsis=8230;e.ellipsisvertical=8942;e.emacron=275;e.emacronacute=7703;e.emacrongrave=7701;e.emcyrillic=1084;e.emdash=8212;e.emdashvertical=65073;e.emonospace=65349;e.emphasismarkarmenian=1371;e.emptyset=8709;e.enbopomofo=12579;e.encyrillic=1085;e.endash=8211;e.endashvertical=65074;e.endescendercyrillic=1187;e.eng=331;e.engbopomofo=12581;e.enghecyrillic=1189;e.enhookcyrillic=1224;e.enspace=8194;e.eogonek=281;e.eokorean=12627;e.eopen=603;e.eopenclosed=666;e.eopenreversed=604;e.eopenreversedclosed=606;e.eopenreversedhook=605;e.eparen=9376;e.epsilon=949;e.epsilontonos=941;e.equal=61;e.equalmonospace=65309;e.equalsmall=65126;e.equalsuperior=8316;e.equivalence=8801;e.erbopomofo=12582;e.ercyrillic=1088;e.ereversed=600;e.ereversedcyrillic=1101;e.escyrillic=1089;e.esdescendercyrillic=1195;e.esh=643;e.eshcurl=646;e.eshortdeva=2318;e.eshortvowelsigndeva=2374;e.eshreversedloop=426;e.eshsquatreversed=645;e.esmallhiragana=12359;e.esmallkatakana=12455;e.esmallkatakanahalfwidth=65386;e.estimated=8494;e.esuperior=63212;e.eta=951;e.etarmenian=1384;e.etatonos=942;e.eth=240;e.etilde=7869;e.etildebelow=7707;e.etnahtafoukhhebrew=1425;e.etnahtafoukhlefthebrew=1425;e.etnahtahebrew=1425;e.etnahtalefthebrew=1425;e.eturned=477;e.eukorean=12641;e.euro=8364;e.evowelsignbengali=2503;e.evowelsigndeva=2375;e.evowelsigngujarati=2759;e.exclam=33;e.exclamarmenian=1372;e.exclamdbl=8252;e.exclamdown=161;e.exclamdownsmall=63393;e.exclammonospace=65281;e.exclamsmall=63265;e.existential=8707;e.ezh=658;e.ezhcaron=495;e.ezhcurl=659;e.ezhreversed=441;e.ezhtail=442;e.f=102;e.fadeva=2398;e.fagurmukhi=2654;e.fahrenheit=8457;e.fathaarabic=1614;e.fathalowarabic=1614;e.fathatanarabic=1611;e.fbopomofo=12552;e.fcircle=9429;e.fdotaccent=7711;e.feharabic=1601;e.feharmenian=1414;e.fehfinalarabic=65234;e.fehinitialarabic=65235;e.fehmedialarabic=65236;e.feicoptic=997;e.female=9792;e.ff=64256;e.f_f=64256;e.ffi=64259;e.f_f_i=64259;e.ffl=64260;e.f_f_l=64260;e.fi=64257;e.f_i=64257;e.fifteencircle=9326;e.fifteenparen=9346;e.fifteenperiod=9366;e.figuredash=8210;e.filledbox=9632;e.filledrect=9644;e.finalkaf=1498;e.finalkafdagesh=64314;e.finalkafdageshhebrew=64314;e.finalkafhebrew=1498;e.finalmem=1501;e.finalmemhebrew=1501;e.finalnun=1503;e.finalnunhebrew=1503;e.finalpe=1507;e.finalpehebrew=1507;e.finaltsadi=1509;e.finaltsadihebrew=1509;e.firsttonechinese=713;e.fisheye=9673;e.fitacyrillic=1139;e.five=53;e.fivearabic=1637;e.fivebengali=2539;e.fivecircle=9316;e.fivecircleinversesansserif=10126;e.fivedeva=2411;e.fiveeighths=8541;e.fivegujarati=2795;e.fivegurmukhi=2667;e.fivehackarabic=1637;e.fivehangzhou=12325;e.fiveideographicparen=12836;e.fiveinferior=8325;e.fivemonospace=65301;e.fiveoldstyle=63285;e.fiveparen=9336;e.fiveperiod=9356;e.fivepersian=1781;e.fiveroman=8564;e.fivesuperior=8309;e.fivethai=3669;e.fl=64258;e.f_l=64258;e.florin=402;e.fmonospace=65350;e.fmsquare=13209;e.fofanthai=3615;e.fofathai=3613;e.fongmanthai=3663;e.forall=8704;e.four=52;e.fourarabic=1636;e.fourbengali=2538;e.fourcircle=9315;e.fourcircleinversesansserif=10125;e.fourdeva=2410;e.fourgujarati=2794;e.fourgurmukhi=2666;e.fourhackarabic=1636;e.fourhangzhou=12324;e.fourideographicparen=12835;e.fourinferior=8324;e.fourmonospace=65300;e.fournumeratorbengali=2551;e.fouroldstyle=63284;e.fourparen=9335;e.fourperiod=9355;e.fourpersian=1780;e.fourroman=8563;e.foursuperior=8308;e.fourteencircle=9325;e.fourteenparen=9345;e.fourteenperiod=9365;e.fourthai=3668;e.fourthtonechinese=715;e.fparen=9377;e.fraction=8260;e.franc=8355;e.g=103;e.gabengali=2455;e.gacute=501;e.gadeva=2327;e.gafarabic=1711;e.gaffinalarabic=64403;e.gafinitialarabic=64404;e.gafmedialarabic=64405;e.gagujarati=2711;e.gagurmukhi=2583;e.gahiragana=12364;e.gakatakana=12460;e.gamma=947;e.gammalatinsmall=611;e.gammasuperior=736;e.gangiacoptic=1003;e.gbopomofo=12557;e.gbreve=287;e.gcaron=487;e.gcedilla=291;e.gcircle=9430;e.gcircumflex=285;e.gcommaaccent=291;e.gdot=289;e.gdotaccent=289;e.gecyrillic=1075;e.gehiragana=12370;e.gekatakana=12466;e.geometricallyequal=8785;e.gereshaccenthebrew=1436;e.gereshhebrew=1523;e.gereshmuqdamhebrew=1437;e.germandbls=223;e.gershayimaccenthebrew=1438;e.gershayimhebrew=1524;e.getamark=12307;e.ghabengali=2456;e.ghadarmenian=1394;e.ghadeva=2328;e.ghagujarati=2712;e.ghagurmukhi=2584;e.ghainarabic=1594;e.ghainfinalarabic=65230;e.ghaininitialarabic=65231;e.ghainmedialarabic=65232;e.ghemiddlehookcyrillic=1173;e.ghestrokecyrillic=1171;e.gheupturncyrillic=1169;e.ghhadeva=2394;e.ghhagurmukhi=2650;e.ghook=608;e.ghzsquare=13203;e.gihiragana=12366;e.gikatakana=12462;e.gimarmenian=1379;e.gimel=1490;e.gimeldagesh=64306;e.gimeldageshhebrew=64306;e.gimelhebrew=1490;e.gjecyrillic=1107;e.glottalinvertedstroke=446;e.glottalstop=660;e.glottalstopinverted=662;e.glottalstopmod=704;e.glottalstopreversed=661;e.glottalstopreversedmod=705;e.glottalstopreversedsuperior=740;e.glottalstopstroke=673;e.glottalstopstrokereversed=674;e.gmacron=7713;e.gmonospace=65351;e.gohiragana=12372;e.gokatakana=12468;e.gparen=9378;e.gpasquare=13228;e.gradient=8711;e.grave=96;e.gravebelowcmb=790;e.gravecmb=768;e.gravecomb=768;e.gravedeva=2387;e.gravelowmod=718;e.gravemonospace=65344;e.gravetonecmb=832;e.greater=62;e.greaterequal=8805;e.greaterequalorless=8923;e.greatermonospace=65310;e.greaterorequivalent=8819;e.greaterorless=8823;e.greateroverequal=8807;e.greatersmall=65125;e.gscript=609;e.gstroke=485;e.guhiragana=12368;e.guillemotleft=171;e.guillemotright=187;e.guilsinglleft=8249;e.guilsinglright=8250;e.gukatakana=12464;e.guramusquare=13080;e.gysquare=13257;e.h=104;e.haabkhasiancyrillic=1193;e.haaltonearabic=1729;e.habengali=2489;e.hadescendercyrillic=1203;e.hadeva=2361;e.hagujarati=2745;e.hagurmukhi=2617;e.haharabic=1581;e.hahfinalarabic=65186;e.hahinitialarabic=65187;e.hahiragana=12399;e.hahmedialarabic=65188;e.haitusquare=13098;e.hakatakana=12495;e.hakatakanahalfwidth=65418;e.halantgurmukhi=2637;e.hamzaarabic=1569;e.hamzalowarabic=1569;e.hangulfiller=12644;e.hardsigncyrillic=1098;e.harpoonleftbarbup=8636;e.harpoonrightbarbup=8640;e.hasquare=13258;e.hatafpatah=1458;e.hatafpatah16=1458;e.hatafpatah23=1458;e.hatafpatah2f=1458;e.hatafpatahhebrew=1458;e.hatafpatahnarrowhebrew=1458;e.hatafpatahquarterhebrew=1458;e.hatafpatahwidehebrew=1458;e.hatafqamats=1459;e.hatafqamats1b=1459;e.hatafqamats28=1459;e.hatafqamats34=1459;e.hatafqamatshebrew=1459;e.hatafqamatsnarrowhebrew=1459;e.hatafqamatsquarterhebrew=1459;e.hatafqamatswidehebrew=1459;e.hatafsegol=1457;e.hatafsegol17=1457;e.hatafsegol24=1457;e.hatafsegol30=1457;e.hatafsegolhebrew=1457;e.hatafsegolnarrowhebrew=1457;e.hatafsegolquarterhebrew=1457;e.hatafsegolwidehebrew=1457;e.hbar=295;e.hbopomofo=12559;e.hbrevebelow=7723;e.hcedilla=7721;e.hcircle=9431;e.hcircumflex=293;e.hdieresis=7719;e.hdotaccent=7715;e.hdotbelow=7717;e.he=1492;e.heart=9829;e.heartsuitblack=9829;e.heartsuitwhite=9825;e.hedagesh=64308;e.hedageshhebrew=64308;e.hehaltonearabic=1729;e.heharabic=1607;e.hehebrew=1492;e.hehfinalaltonearabic=64423;e.hehfinalalttwoarabic=65258;e.hehfinalarabic=65258;e.hehhamzaabovefinalarabic=64421;e.hehhamzaaboveisolatedarabic=64420;e.hehinitialaltonearabic=64424;e.hehinitialarabic=65259;e.hehiragana=12408;e.hehmedialaltonearabic=64425;e.hehmedialarabic=65260;e.heiseierasquare=13179;e.hekatakana=12504;e.hekatakanahalfwidth=65421;e.hekutaarusquare=13110;e.henghook=615;e.herutusquare=13113;e.het=1495;e.hethebrew=1495;e.hhook=614;e.hhooksuperior=689;e.hieuhacirclekorean=12923;e.hieuhaparenkorean=12827;e.hieuhcirclekorean=12909;e.hieuhkorean=12622;e.hieuhparenkorean=12813;e.hihiragana=12402;e.hikatakana=12498;e.hikatakanahalfwidth=65419;e.hiriq=1460;e.hiriq14=1460;e.hiriq21=1460;e.hiriq2d=1460;e.hiriqhebrew=1460;e.hiriqnarrowhebrew=1460;e.hiriqquarterhebrew=1460;e.hiriqwidehebrew=1460;e.hlinebelow=7830;e.hmonospace=65352;e.hoarmenian=1392;e.hohipthai=3627;e.hohiragana=12411;e.hokatakana=12507;e.hokatakanahalfwidth=65422;e.holam=1465;e.holam19=1465;e.holam26=1465;e.holam32=1465;e.holamhebrew=1465;e.holamnarrowhebrew=1465;e.holamquarterhebrew=1465;e.holamwidehebrew=1465;e.honokhukthai=3630;e.hookabovecomb=777;e.hookcmb=777;e.hookpalatalizedbelowcmb=801;e.hookretroflexbelowcmb=802;e.hoonsquare=13122;e.horicoptic=1001;e.horizontalbar=8213;e.horncmb=795;e.hotsprings=9832;e.house=8962;e.hparen=9379;e.hsuperior=688;e.hturned=613;e.huhiragana=12405;e.huiitosquare=13107;e.hukatakana=12501;e.hukatakanahalfwidth=65420;e.hungarumlaut=733;e.hungarumlautcmb=779;e.hv=405;e.hyphen=45;e.hypheninferior=63205;e.hyphenmonospace=65293;e.hyphensmall=65123;e.hyphensuperior=63206;e.hyphentwo=8208;e.i=105;e.iacute=237;e.iacyrillic=1103;e.ibengali=2439;e.ibopomofo=12583;e.ibreve=301;e.icaron=464;e.icircle=9432;e.icircumflex=238;e.icyrillic=1110;e.idblgrave=521;e.ideographearthcircle=12943;e.ideographfirecircle=12939;e.ideographicallianceparen=12863;e.ideographiccallparen=12858;e.ideographiccentrecircle=12965;e.ideographicclose=12294;e.ideographiccomma=12289;e.ideographiccommaleft=65380;e.ideographiccongratulationparen=12855;e.ideographiccorrectcircle=12963;e.ideographicearthparen=12847;e.ideographicenterpriseparen=12861;e.ideographicexcellentcircle=12957;e.ideographicfestivalparen=12864;e.ideographicfinancialcircle=12950;e.ideographicfinancialparen=12854;e.ideographicfireparen=12843;e.ideographichaveparen=12850;e.ideographichighcircle=12964;e.ideographiciterationmark=12293;e.ideographiclaborcircle=12952;e.ideographiclaborparen=12856;e.ideographicleftcircle=12967;e.ideographiclowcircle=12966;e.ideographicmedicinecircle=12969;e.ideographicmetalparen=12846;e.ideographicmoonparen=12842;e.ideographicnameparen=12852;e.ideographicperiod=12290;e.ideographicprintcircle=12958;e.ideographicreachparen=12867;e.ideographicrepresentparen=12857;e.ideographicresourceparen=12862;e.ideographicrightcircle=12968;e.ideographicsecretcircle=12953;e.ideographicselfparen=12866;e.ideographicsocietyparen=12851;e.ideographicspace=12288;e.ideographicspecialparen=12853;e.ideographicstockparen=12849;e.ideographicstudyparen=12859;e.ideographicsunparen=12848;e.ideographicsuperviseparen=12860;e.ideographicwaterparen=12844;e.ideographicwoodparen=12845;e.ideographiczero=12295;e.ideographmetalcircle=12942;e.ideographmooncircle=12938;e.ideographnamecircle=12948;e.ideographsuncircle=12944;e.ideographwatercircle=12940;e.ideographwoodcircle=12941;e.ideva=2311;e.idieresis=239;e.idieresisacute=7727;e.idieresiscyrillic=1253;e.idotbelow=7883;e.iebrevecyrillic=1239;e.iecyrillic=1077;e.ieungacirclekorean=12917;e.ieungaparenkorean=12821;e.ieungcirclekorean=12903;e.ieungkorean=12615;e.ieungparenkorean=12807;e.igrave=236;e.igujarati=2695;e.igurmukhi=2567;e.ihiragana=12356;e.ihookabove=7881;e.iibengali=2440;e.iicyrillic=1080;e.iideva=2312;e.iigujarati=2696;e.iigurmukhi=2568;e.iimatragurmukhi=2624;e.iinvertedbreve=523;e.iishortcyrillic=1081;e.iivowelsignbengali=2496;e.iivowelsigndeva=2368;e.iivowelsigngujarati=2752;e.ij=307;e.ikatakana=12452;e.ikatakanahalfwidth=65394;e.ikorean=12643;e.ilde=732;e.iluyhebrew=1452;e.imacron=299;e.imacroncyrillic=1251;e.imageorapproximatelyequal=8787;e.imatragurmukhi=2623;e.imonospace=65353;e.increment=8710;e.infinity=8734;e.iniarmenian=1387;e.integral=8747;e.integralbottom=8993;e.integralbt=8993;e.integralex=63733;e.integraltop=8992;e.integraltp=8992;e.intersection=8745;e.intisquare=13061;e.invbullet=9688;e.invcircle=9689;e.invsmileface=9787;e.iocyrillic=1105;e.iogonek=303;e.iota=953;e.iotadieresis=970;e.iotadieresistonos=912;e.iotalatin=617;e.iotatonos=943;e.iparen=9380;e.irigurmukhi=2674;e.ismallhiragana=12355;e.ismallkatakana=12451;e.ismallkatakanahalfwidth=65384;e.issharbengali=2554;e.istroke=616;e.isuperior=63213;e.iterationhiragana=12445;e.iterationkatakana=12541;e.itilde=297;e.itildebelow=7725;e.iubopomofo=12585;e.iucyrillic=1102;e.ivowelsignbengali=2495;e.ivowelsigndeva=2367;e.ivowelsigngujarati=2751;e.izhitsacyrillic=1141;e.izhitsadblgravecyrillic=1143;e.j=106;e.jaarmenian=1393;e.jabengali=2460;e.jadeva=2332;e.jagujarati=2716;e.jagurmukhi=2588;e.jbopomofo=12560;e.jcaron=496;e.jcircle=9433;e.jcircumflex=309;e.jcrossedtail=669;e.jdotlessstroke=607;e.jecyrillic=1112;e.jeemarabic=1580;e.jeemfinalarabic=65182;e.jeeminitialarabic=65183;e.jeemmedialarabic=65184;e.jeharabic=1688;e.jehfinalarabic=64395;e.jhabengali=2461;e.jhadeva=2333;e.jhagujarati=2717;e.jhagurmukhi=2589;e.jheharmenian=1403;e.jis=12292;e.jmonospace=65354;e.jparen=9381;e.jsuperior=690;e.k=107;e.kabashkircyrillic=1185;e.kabengali=2453;e.kacute=7729;e.kacyrillic=1082;e.kadescendercyrillic=1179;e.kadeva=2325;e.kaf=1499;e.kafarabic=1603;e.kafdagesh=64315;e.kafdageshhebrew=64315;e.kaffinalarabic=65242;e.kafhebrew=1499;e.kafinitialarabic=65243;e.kafmedialarabic=65244;e.kafrafehebrew=64333;e.kagujarati=2709;e.kagurmukhi=2581;e.kahiragana=12363;e.kahookcyrillic=1220;e.kakatakana=12459;e.kakatakanahalfwidth=65398;e.kappa=954;e.kappasymbolgreek=1008;e.kapyeounmieumkorean=12657;e.kapyeounphieuphkorean=12676;e.kapyeounpieupkorean=12664;e.kapyeounssangpieupkorean=12665;e.karoriisquare=13069;e.kashidaautoarabic=1600;e.kashidaautonosidebearingarabic=1600;e.kasmallkatakana=12533;e.kasquare=13188;e.kasraarabic=1616;e.kasratanarabic=1613;e.kastrokecyrillic=1183;e.katahiraprolongmarkhalfwidth=65392;e.kaverticalstrokecyrillic=1181;e.kbopomofo=12558;e.kcalsquare=13193;e.kcaron=489;e.kcedilla=311;e.kcircle=9434;e.kcommaaccent=311;e.kdotbelow=7731;e.keharmenian=1412;e.kehiragana=12369;e.kekatakana=12465;e.kekatakanahalfwidth=65401;e.kenarmenian=1391;e.kesmallkatakana=12534;e.kgreenlandic=312;e.khabengali=2454;e.khacyrillic=1093;e.khadeva=2326;e.khagujarati=2710;e.khagurmukhi=2582;e.khaharabic=1582;e.khahfinalarabic=65190;e.khahinitialarabic=65191;e.khahmedialarabic=65192;e.kheicoptic=999;e.khhadeva=2393;e.khhagurmukhi=2649;e.khieukhacirclekorean=12920;e.khieukhaparenkorean=12824;e.khieukhcirclekorean=12906;e.khieukhkorean=12619;e.khieukhparenkorean=12810;e.khokhaithai=3586;e.khokhonthai=3589;e.khokhuatthai=3587;e.khokhwaithai=3588;e.khomutthai=3675;e.khook=409;e.khorakhangthai=3590;e.khzsquare=13201;e.kihiragana=12365;e.kikatakana=12461;e.kikatakanahalfwidth=65399;e.kiroguramusquare=13077;e.kiromeetorusquare=13078;e.kirosquare=13076;e.kiyeokacirclekorean=12910;e.kiyeokaparenkorean=12814;e.kiyeokcirclekorean=12896;e.kiyeokkorean=12593;e.kiyeokparenkorean=12800;e.kiyeoksioskorean=12595;e.kjecyrillic=1116;e.klinebelow=7733;e.klsquare=13208;e.kmcubedsquare=13222;e.kmonospace=65355;e.kmsquaredsquare=13218;e.kohiragana=12371;e.kohmsquare=13248;e.kokaithai=3585;e.kokatakana=12467;e.kokatakanahalfwidth=65402;e.kooposquare=13086;e.koppacyrillic=1153;e.koreanstandardsymbol=12927;e.koroniscmb=835;e.kparen=9382;e.kpasquare=13226;e.ksicyrillic=1135;e.ktsquare=13263;e.kturned=670;e.kuhiragana=12367;e.kukatakana=12463;e.kukatakanahalfwidth=65400;e.kvsquare=13240;e.kwsquare=13246;e.l=108;e.labengali=2482;e.lacute=314;e.ladeva=2354;e.lagujarati=2738;e.lagurmukhi=2610;e.lakkhangyaothai=3653;e.lamaleffinalarabic=65276;e.lamalefhamzaabovefinalarabic=65272;e.lamalefhamzaaboveisolatedarabic=65271;e.lamalefhamzabelowfinalarabic=65274;e.lamalefhamzabelowisolatedarabic=65273;e.lamalefisolatedarabic=65275;e.lamalefmaddaabovefinalarabic=65270;e.lamalefmaddaaboveisolatedarabic=65269;e.lamarabic=1604;e.lambda=955;e.lambdastroke=411;e.lamed=1500;e.lameddagesh=64316;e.lameddageshhebrew=64316;e.lamedhebrew=1500;e.lamfinalarabic=65246;e.lamhahinitialarabic=64714;e.laminitialarabic=65247;e.lamjeeminitialarabic=64713;e.lamkhahinitialarabic=64715;e.lamlamhehisolatedarabic=65010;e.lammedialarabic=65248;e.lammeemhahinitialarabic=64904;e.lammeeminitialarabic=64716;e.largecircle=9711;e.lbar=410;e.lbelt=620;e.lbopomofo=12556;e.lcaron=318;e.lcedilla=316;e.lcircle=9435;e.lcircumflexbelow=7741;e.lcommaaccent=316;e.ldot=320;e.ldotaccent=320;e.ldotbelow=7735;e.ldotbelowmacron=7737;e.leftangleabovecmb=794;e.lefttackbelowcmb=792;e.less=60;e.lessequal=8804;e.lessequalorgreater=8922;e.lessmonospace=65308;e.lessorequivalent=8818;e.lessorgreater=8822;e.lessoverequal=8806;e.lesssmall=65124;e.lezh=622;e.lfblock=9612;e.lhookretroflex=621;e.lira=8356;e.liwnarmenian=1388;e.lj=457;e.ljecyrillic=1113;e.ll=63168;e.lladeva=2355;e.llagujarati=2739;e.llinebelow=7739;e.llladeva=2356;e.llvocalicbengali=2529;e.llvocalicdeva=2401;e.llvocalicvowelsignbengali=2531;e.llvocalicvowelsigndeva=2403;e.lmiddletilde=619;e.lmonospace=65356;e.lmsquare=13264;e.lochulathai=3628;e.logicaland=8743;e.logicalnot=172;e.logicalnotreversed=8976;e.logicalor=8744;e.lolingthai=3621;e.longs=383;e.lowlinecenterline=65102;e.lowlinecmb=818;e.lowlinedashed=65101;e.lozenge=9674;e.lparen=9383;e.lslash=322;e.lsquare=8467;e.lsuperior=63214;e.ltshade=9617;e.luthai=3622;e.lvocalicbengali=2444;e.lvocalicdeva=2316;e.lvocalicvowelsignbengali=2530;e.lvocalicvowelsigndeva=2402;e.lxsquare=13267;e.m=109;e.mabengali=2478;e.macron=175;e.macronbelowcmb=817;e.macroncmb=772;e.macronlowmod=717;e.macronmonospace=65507;e.macute=7743;e.madeva=2350;e.magujarati=2734;e.magurmukhi=2606;e.mahapakhhebrew=1444;e.mahapakhlefthebrew=1444;e.mahiragana=12414;e.maichattawalowleftthai=63637;e.maichattawalowrightthai=63636;e.maichattawathai=3659;e.maichattawaupperleftthai=63635;e.maieklowleftthai=63628;e.maieklowrightthai=63627;e.maiekthai=3656;e.maiekupperleftthai=63626;e.maihanakatleftthai=63620;e.maihanakatthai=3633;e.maitaikhuleftthai=63625;e.maitaikhuthai=3655;e.maitholowleftthai=63631;e.maitholowrightthai=63630;e.maithothai=3657;e.maithoupperleftthai=63629;e.maitrilowleftthai=63634;e.maitrilowrightthai=63633;e.maitrithai=3658;e.maitriupperleftthai=63632;e.maiyamokthai=3654;e.makatakana=12510;e.makatakanahalfwidth=65423;e.male=9794;e.mansyonsquare=13127;e.maqafhebrew=1470;e.mars=9794;e.masoracirclehebrew=1455;e.masquare=13187;e.mbopomofo=12551;e.mbsquare=13268;e.mcircle=9436;e.mcubedsquare=13221;e.mdotaccent=7745;e.mdotbelow=7747;e.meemarabic=1605;e.meemfinalarabic=65250;e.meeminitialarabic=65251;e.meemmedialarabic=65252;e.meemmeeminitialarabic=64721;e.meemmeemisolatedarabic=64584;e.meetorusquare=13133;e.mehiragana=12417;e.meizierasquare=13182;e.mekatakana=12513;e.mekatakanahalfwidth=65426;e.mem=1502;e.memdagesh=64318;e.memdageshhebrew=64318;e.memhebrew=1502;e.menarmenian=1396;e.merkhahebrew=1445;e.merkhakefulahebrew=1446;e.merkhakefulalefthebrew=1446;e.merkhalefthebrew=1445;e.mhook=625;e.mhzsquare=13202;e.middledotkatakanahalfwidth=65381;e.middot=183;e.mieumacirclekorean=12914;e.mieumaparenkorean=12818;e.mieumcirclekorean=12900;e.mieumkorean=12609;e.mieumpansioskorean=12656;e.mieumparenkorean=12804;e.mieumpieupkorean=12654;e.mieumsioskorean=12655;e.mihiragana=12415;e.mikatakana=12511;e.mikatakanahalfwidth=65424;e.minus=8722;e.minusbelowcmb=800;e.minuscircle=8854;e.minusmod=727;e.minusplus=8723;e.minute=8242;e.miribaarusquare=13130;e.mirisquare=13129;e.mlonglegturned=624;e.mlsquare=13206;e.mmcubedsquare=13219;e.mmonospace=65357;e.mmsquaredsquare=13215;e.mohiragana=12418;e.mohmsquare=13249;e.mokatakana=12514;e.mokatakanahalfwidth=65427;e.molsquare=13270;e.momathai=3617;e.moverssquare=13223;e.moverssquaredsquare=13224;e.mparen=9384;e.mpasquare=13227;e.mssquare=13235;e.msuperior=63215;e.mturned=623;e.mu=181;e.mu1=181;e.muasquare=13186;e.muchgreater=8811;e.muchless=8810;e.mufsquare=13196;e.mugreek=956;e.mugsquare=13197;e.muhiragana=12416;e.mukatakana=12512;e.mukatakanahalfwidth=65425;e.mulsquare=13205;e.multiply=215;e.mumsquare=13211;e.munahhebrew=1443;e.munahlefthebrew=1443;e.musicalnote=9834;e.musicalnotedbl=9835;e.musicflatsign=9837;e.musicsharpsign=9839;e.mussquare=13234;e.muvsquare=13238;e.muwsquare=13244;e.mvmegasquare=13241;e.mvsquare=13239;e.mwmegasquare=13247;e.mwsquare=13245;e.n=110;e.nabengali=2472;e.nabla=8711;e.nacute=324;e.nadeva=2344;e.nagujarati=2728;e.nagurmukhi=2600;e.nahiragana=12394;e.nakatakana=12490;e.nakatakanahalfwidth=65413;e.napostrophe=329;e.nasquare=13185;e.nbopomofo=12555;e.nbspace=160;e.ncaron=328;e.ncedilla=326;e.ncircle=9437;e.ncircumflexbelow=7755;e.ncommaaccent=326;e.ndotaccent=7749;e.ndotbelow=7751;e.nehiragana=12397;e.nekatakana=12493;e.nekatakanahalfwidth=65416;e.newsheqelsign=8362;e.nfsquare=13195;e.ngabengali=2457;e.ngadeva=2329;e.ngagujarati=2713;e.ngagurmukhi=2585;e.ngonguthai=3591;e.nhiragana=12435;e.nhookleft=626;e.nhookretroflex=627;e.nieunacirclekorean=12911;e.nieunaparenkorean=12815;e.nieuncieuckorean=12597;e.nieuncirclekorean=12897;e.nieunhieuhkorean=12598;e.nieunkorean=12596;e.nieunpansioskorean=12648;e.nieunparenkorean=12801;e.nieunsioskorean=12647;e.nieuntikeutkorean=12646;e.nihiragana=12395;e.nikatakana=12491;e.nikatakanahalfwidth=65414;e.nikhahitleftthai=63641;e.nikhahitthai=3661;e.nine=57;e.ninearabic=1641;e.ninebengali=2543;e.ninecircle=9320;e.ninecircleinversesansserif=10130;e.ninedeva=2415;e.ninegujarati=2799;e.ninegurmukhi=2671;e.ninehackarabic=1641;e.ninehangzhou=12329;e.nineideographicparen=12840;e.nineinferior=8329;e.ninemonospace=65305;e.nineoldstyle=63289;e.nineparen=9340;e.nineperiod=9360;e.ninepersian=1785;e.nineroman=8568;e.ninesuperior=8313;e.nineteencircle=9330;e.nineteenparen=9350;e.nineteenperiod=9370;e.ninethai=3673;e.nj=460;e.njecyrillic=1114;e.nkatakana=12531;e.nkatakanahalfwidth=65437;e.nlegrightlong=414;e.nlinebelow=7753;e.nmonospace=65358;e.nmsquare=13210;e.nnabengali=2467;e.nnadeva=2339;e.nnagujarati=2723;e.nnagurmukhi=2595;e.nnnadeva=2345;e.nohiragana=12398;e.nokatakana=12494;e.nokatakanahalfwidth=65417;e.nonbreakingspace=160;e.nonenthai=3603;e.nonuthai=3609;e.noonarabic=1606;e.noonfinalarabic=65254;e.noonghunnaarabic=1722;e.noonghunnafinalarabic=64415;e.nooninitialarabic=65255;e.noonjeeminitialarabic=64722;e.noonjeemisolatedarabic=64587;e.noonmedialarabic=65256;e.noonmeeminitialarabic=64725;e.noonmeemisolatedarabic=64590;e.noonnoonfinalarabic=64653;e.notcontains=8716;e.notelement=8713;e.notelementof=8713;e.notequal=8800;e.notgreater=8815;e.notgreaternorequal=8817;e.notgreaternorless=8825;e.notidentical=8802;e.notless=8814;e.notlessnorequal=8816;e.notparallel=8742;e.notprecedes=8832;e.notsubset=8836;e.notsucceeds=8833;e.notsuperset=8837;e.nowarmenian=1398;e.nparen=9385;e.nssquare=13233;e.nsuperior=8319;e.ntilde=241;e.nu=957;e.nuhiragana=12396;e.nukatakana=12492;e.nukatakanahalfwidth=65415;e.nuktabengali=2492;e.nuktadeva=2364;e.nuktagujarati=2748;e.nuktagurmukhi=2620;e.numbersign=35;e.numbersignmonospace=65283;e.numbersignsmall=65119;e.numeralsigngreek=884;e.numeralsignlowergreek=885;e.numero=8470;e.nun=1504;e.nundagesh=64320;e.nundageshhebrew=64320;e.nunhebrew=1504;e.nvsquare=13237;e.nwsquare=13243;e.nyabengali=2462;e.nyadeva=2334;e.nyagujarati=2718;e.nyagurmukhi=2590;e.o=111;e.oacute=243;e.oangthai=3629;e.obarred=629;e.obarredcyrillic=1257;e.obarreddieresiscyrillic=1259;e.obengali=2451;e.obopomofo=12571;e.obreve=335;e.ocandradeva=2321;e.ocandragujarati=2705;e.ocandravowelsigndeva=2377;e.ocandravowelsigngujarati=2761;e.ocaron=466;e.ocircle=9438;e.ocircumflex=244;e.ocircumflexacute=7889;e.ocircumflexdotbelow=7897;e.ocircumflexgrave=7891;e.ocircumflexhookabove=7893;e.ocircumflextilde=7895;e.ocyrillic=1086;e.odblacute=337;e.odblgrave=525;e.odeva=2323;e.odieresis=246;e.odieresiscyrillic=1255;e.odotbelow=7885;e.oe=339;e.oekorean=12634;e.ogonek=731;e.ogonekcmb=808;e.ograve=242;e.ogujarati=2707;e.oharmenian=1413;e.ohiragana=12362;e.ohookabove=7887;e.ohorn=417;e.ohornacute=7899;e.ohorndotbelow=7907;e.ohorngrave=7901;e.ohornhookabove=7903;e.ohorntilde=7905;e.ohungarumlaut=337;e.oi=419;e.oinvertedbreve=527;e.okatakana=12458;e.okatakanahalfwidth=65397;e.okorean=12631;e.olehebrew=1451;e.omacron=333;e.omacronacute=7763;e.omacrongrave=7761;e.omdeva=2384;e.omega=969;e.omega1=982;e.omegacyrillic=1121;e.omegalatinclosed=631;e.omegaroundcyrillic=1147;e.omegatitlocyrillic=1149;e.omegatonos=974;e.omgujarati=2768;e.omicron=959;e.omicrontonos=972;e.omonospace=65359;e.one=49;e.onearabic=1633;e.onebengali=2535;e.onecircle=9312;e.onecircleinversesansserif=10122;e.onedeva=2407;e.onedotenleader=8228;e.oneeighth=8539;e.onefitted=63196;e.onegujarati=2791;e.onegurmukhi=2663;e.onehackarabic=1633;e.onehalf=189;e.onehangzhou=12321;e.oneideographicparen=12832;e.oneinferior=8321;e.onemonospace=65297;e.onenumeratorbengali=2548;e.oneoldstyle=63281;e.oneparen=9332;e.oneperiod=9352;e.onepersian=1777;e.onequarter=188;e.oneroman=8560;e.onesuperior=185;e.onethai=3665;e.onethird=8531;e.oogonek=491;e.oogonekmacron=493;e.oogurmukhi=2579;e.oomatragurmukhi=2635;e.oopen=596;e.oparen=9386;e.openbullet=9702;e.option=8997;e.ordfeminine=170;e.ordmasculine=186;e.orthogonal=8735;e.oshortdeva=2322;e.oshortvowelsigndeva=2378;e.oslash=248;e.oslashacute=511;e.osmallhiragana=12361;e.osmallkatakana=12457;e.osmallkatakanahalfwidth=65387;e.ostrokeacute=511;e.osuperior=63216;e.otcyrillic=1151;e.otilde=245;e.otildeacute=7757;e.otildedieresis=7759;e.oubopomofo=12577;e.overline=8254;e.overlinecenterline=65098;e.overlinecmb=773;e.overlinedashed=65097;e.overlinedblwavy=65100;e.overlinewavy=65099;e.overscore=175;e.ovowelsignbengali=2507;e.ovowelsigndeva=2379;e.ovowelsigngujarati=2763;e.p=112;e.paampssquare=13184;e.paasentosquare=13099;e.pabengali=2474;e.pacute=7765;e.padeva=2346;e.pagedown=8671;e.pageup=8670;e.pagujarati=2730;e.pagurmukhi=2602;e.pahiragana=12401;e.paiyannoithai=3631;e.pakatakana=12497;e.palatalizationcyrilliccmb=1156;e.palochkacyrillic=1216;e.pansioskorean=12671;e.paragraph=182;e.parallel=8741;e.parenleft=40;e.parenleftaltonearabic=64830;e.parenleftbt=63725;e.parenleftex=63724;e.parenleftinferior=8333;e.parenleftmonospace=65288;e.parenleftsmall=65113;e.parenleftsuperior=8317;e.parenlefttp=63723;e.parenleftvertical=65077;e.parenright=41;e.parenrightaltonearabic=64831;e.parenrightbt=63736;e.parenrightex=63735;e.parenrightinferior=8334;e.parenrightmonospace=65289;e.parenrightsmall=65114;e.parenrightsuperior=8318;e.parenrighttp=63734;e.parenrightvertical=65078;e.partialdiff=8706;e.paseqhebrew=1472;e.pashtahebrew=1433;e.pasquare=13225;e.patah=1463;e.patah11=1463;e.patah1d=1463;e.patah2a=1463;e.patahhebrew=1463;e.patahnarrowhebrew=1463;e.patahquarterhebrew=1463;e.patahwidehebrew=1463;e.pazerhebrew=1441;e.pbopomofo=12550;e.pcircle=9439;e.pdotaccent=7767;e.pe=1508;e.pecyrillic=1087;e.pedagesh=64324;e.pedageshhebrew=64324;e.peezisquare=13115;e.pefinaldageshhebrew=64323;e.peharabic=1662;e.peharmenian=1402;e.pehebrew=1508;e.pehfinalarabic=64343;e.pehinitialarabic=64344;e.pehiragana=12410;e.pehmedialarabic=64345;e.pekatakana=12506;e.pemiddlehookcyrillic=1191;e.perafehebrew=64334;e.percent=37;e.percentarabic=1642;e.percentmonospace=65285;e.percentsmall=65130;e.period=46;e.periodarmenian=1417;e.periodcentered=183;e.periodhalfwidth=65377;e.periodinferior=63207;e.periodmonospace=65294;e.periodsmall=65106;e.periodsuperior=63208;e.perispomenigreekcmb=834;e.perpendicular=8869;e.perthousand=8240;e.peseta=8359;e.pfsquare=13194;e.phabengali=2475;e.phadeva=2347;e.phagujarati=2731;e.phagurmukhi=2603;e.phi=966;e.phi1=981;e.phieuphacirclekorean=12922;e.phieuphaparenkorean=12826;e.phieuphcirclekorean=12908;e.phieuphkorean=12621;e.phieuphparenkorean=12812;e.philatin=632;e.phinthuthai=3642;e.phisymbolgreek=981;e.phook=421;e.phophanthai=3614;e.phophungthai=3612;e.phosamphaothai=3616;e.pi=960;e.pieupacirclekorean=12915;e.pieupaparenkorean=12819;e.pieupcieuckorean=12662;e.pieupcirclekorean=12901;e.pieupkiyeokkorean=12658;e.pieupkorean=12610;e.pieupparenkorean=12805;e.pieupsioskiyeokkorean=12660;e.pieupsioskorean=12612;e.pieupsiostikeutkorean=12661;e.pieupthieuthkorean=12663;e.pieuptikeutkorean=12659;e.pihiragana=12404;e.pikatakana=12500;e.pisymbolgreek=982;e.piwrarmenian=1411;e.planckover2pi=8463;e.planckover2pi1=8463;e.plus=43;e.plusbelowcmb=799;e.pluscircle=8853;e.plusminus=177;e.plusmod=726;e.plusmonospace=65291;e.plussmall=65122;e.plussuperior=8314;e.pmonospace=65360;e.pmsquare=13272;e.pohiragana=12413;e.pointingindexdownwhite=9759;e.pointingindexleftwhite=9756;e.pointingindexrightwhite=9758;e.pointingindexupwhite=9757;e.pokatakana=12509;e.poplathai=3611;e.postalmark=12306;e.postalmarkface=12320;e.pparen=9387;e.precedes=8826;e.prescription=8478;e.primemod=697;e.primereversed=8245;e.product=8719;e.projective=8965;e.prolongedkana=12540;e.propellor=8984;e.propersubset=8834;e.propersuperset=8835;e.proportion=8759;e.proportional=8733;e.psi=968;e.psicyrillic=1137;e.psilipneumatacyrilliccmb=1158;e.pssquare=13232;e.puhiragana=12407;e.pukatakana=12503;e.pvsquare=13236;e.pwsquare=13242;e.q=113;e.qadeva=2392;e.qadmahebrew=1448;e.qafarabic=1602;e.qaffinalarabic=65238;e.qafinitialarabic=65239;e.qafmedialarabic=65240;e.qamats=1464;e.qamats10=1464;e.qamats1a=1464;e.qamats1c=1464;e.qamats27=1464;e.qamats29=1464;e.qamats33=1464;e.qamatsde=1464;e.qamatshebrew=1464;e.qamatsnarrowhebrew=1464;e.qamatsqatanhebrew=1464;e.qamatsqatannarrowhebrew=1464;e.qamatsqatanquarterhebrew=1464;e.qamatsqatanwidehebrew=1464;e.qamatsquarterhebrew=1464;e.qamatswidehebrew=1464;e.qarneyparahebrew=1439;e.qbopomofo=12561;e.qcircle=9440;e.qhook=672;e.qmonospace=65361;e.qof=1511;e.qofdagesh=64327;e.qofdageshhebrew=64327;e.qofhebrew=1511;e.qparen=9388;e.quarternote=9833;e.qubuts=1467;e.qubuts18=1467;e.qubuts25=1467;e.qubuts31=1467;e.qubutshebrew=1467;e.qubutsnarrowhebrew=1467;e.qubutsquarterhebrew=1467;e.qubutswidehebrew=1467;e.question=63;e.questionarabic=1567;e.questionarmenian=1374;e.questiondown=191;e.questiondownsmall=63423;e.questiongreek=894;e.questionmonospace=65311;e.questionsmall=63295;e.quotedbl=34;e.quotedblbase=8222;e.quotedblleft=8220;e.quotedblmonospace=65282;e.quotedblprime=12318;e.quotedblprimereversed=12317;e.quotedblright=8221;e.quoteleft=8216;e.quoteleftreversed=8219;e.quotereversed=8219;e.quoteright=8217;e.quoterightn=329;e.quotesinglbase=8218;e.quotesingle=39;e.quotesinglemonospace=65287;e.r=114;e.raarmenian=1404;e.rabengali=2480;e.racute=341;e.radeva=2352;e.radical=8730;e.radicalex=63717;e.radoverssquare=13230;e.radoverssquaredsquare=13231;e.radsquare=13229;e.rafe=1471;e.rafehebrew=1471;e.ragujarati=2736;e.ragurmukhi=2608;e.rahiragana=12425;e.rakatakana=12521;e.rakatakanahalfwidth=65431;e.ralowerdiagonalbengali=2545;e.ramiddlediagonalbengali=2544;e.ramshorn=612;e.ratio=8758;e.rbopomofo=12566;e.rcaron=345;e.rcedilla=343;e.rcircle=9441;e.rcommaaccent=343;e.rdblgrave=529;e.rdotaccent=7769;e.rdotbelow=7771;e.rdotbelowmacron=7773;e.referencemark=8251;e.reflexsubset=8838;e.reflexsuperset=8839;e.registered=174;e.registersans=63720;e.registerserif=63194;e.reharabic=1585;e.reharmenian=1408;e.rehfinalarabic=65198;e.rehiragana=12428;e.rekatakana=12524;e.rekatakanahalfwidth=65434;e.resh=1512;e.reshdageshhebrew=64328;e.reshhebrew=1512;e.reversedtilde=8765;e.reviahebrew=1431;e.reviamugrashhebrew=1431;e.revlogicalnot=8976;e.rfishhook=638;e.rfishhookreversed=639;e.rhabengali=2525;e.rhadeva=2397;e.rho=961;e.rhook=637;e.rhookturned=635;e.rhookturnedsuperior=693;e.rhosymbolgreek=1009;e.rhotichookmod=734;e.rieulacirclekorean=12913;e.rieulaparenkorean=12817;e.rieulcirclekorean=12899;e.rieulhieuhkorean=12608;e.rieulkiyeokkorean=12602;e.rieulkiyeoksioskorean=12649;e.rieulkorean=12601;e.rieulmieumkorean=12603;e.rieulpansioskorean=12652;e.rieulparenkorean=12803;e.rieulphieuphkorean=12607;e.rieulpieupkorean=12604;e.rieulpieupsioskorean=12651;e.rieulsioskorean=12605;e.rieulthieuthkorean=12606;e.rieultikeutkorean=12650;e.rieulyeorinhieuhkorean=12653;e.rightangle=8735;e.righttackbelowcmb=793;e.righttriangle=8895;e.rihiragana=12426;e.rikatakana=12522;e.rikatakanahalfwidth=65432;e.ring=730;e.ringbelowcmb=805;e.ringcmb=778;e.ringhalfleft=703;e.ringhalfleftarmenian=1369;e.ringhalfleftbelowcmb=796;e.ringhalfleftcentered=723;e.ringhalfright=702;e.ringhalfrightbelowcmb=825;e.ringhalfrightcentered=722;e.rinvertedbreve=531;e.rittorusquare=13137;e.rlinebelow=7775;e.rlongleg=636;e.rlonglegturned=634;e.rmonospace=65362;e.rohiragana=12429;e.rokatakana=12525;e.rokatakanahalfwidth=65435;e.roruathai=3619;e.rparen=9389;e.rrabengali=2524;e.rradeva=2353;e.rragurmukhi=2652;e.rreharabic=1681;e.rrehfinalarabic=64397;e.rrvocalicbengali=2528;e.rrvocalicdeva=2400;e.rrvocalicgujarati=2784;e.rrvocalicvowelsignbengali=2500;e.rrvocalicvowelsigndeva=2372;e.rrvocalicvowelsigngujarati=2756;e.rsuperior=63217;e.rtblock=9616;e.rturned=633;e.rturnedsuperior=692;e.ruhiragana=12427;e.rukatakana=12523;e.rukatakanahalfwidth=65433;e.rupeemarkbengali=2546;e.rupeesignbengali=2547;e.rupiah=63197;e.ruthai=3620;e.rvocalicbengali=2443;e.rvocalicdeva=2315;e.rvocalicgujarati=2699;e.rvocalicvowelsignbengali=2499;e.rvocalicvowelsigndeva=2371;e.rvocalicvowelsigngujarati=2755;e.s=115;e.sabengali=2488;e.sacute=347;e.sacutedotaccent=7781;e.sadarabic=1589;e.sadeva=2360;e.sadfinalarabic=65210;e.sadinitialarabic=65211;e.sadmedialarabic=65212;e.sagujarati=2744;e.sagurmukhi=2616;e.sahiragana=12373;e.sakatakana=12469;e.sakatakanahalfwidth=65403;e.sallallahoualayhewasallamarabic=65018;e.samekh=1505;e.samekhdagesh=64321;e.samekhdageshhebrew=64321;e.samekhhebrew=1505;e.saraaathai=3634;e.saraaethai=3649;e.saraaimaimalaithai=3652;e.saraaimaimuanthai=3651;e.saraamthai=3635;e.saraathai=3632;e.saraethai=3648;e.saraiileftthai=63622;e.saraiithai=3637;e.saraileftthai=63621;e.saraithai=3636;e.saraothai=3650;e.saraueeleftthai=63624;e.saraueethai=3639;e.saraueleftthai=63623;e.sarauethai=3638;e.sarauthai=3640;e.sarauuthai=3641;e.sbopomofo=12569;e.scaron=353;e.scarondotaccent=7783;e.scedilla=351;e.schwa=601;e.schwacyrillic=1241;e.schwadieresiscyrillic=1243;e.schwahook=602;e.scircle=9442;e.scircumflex=349;e.scommaaccent=537;e.sdotaccent=7777;e.sdotbelow=7779;e.sdotbelowdotaccent=7785;e.seagullbelowcmb=828;e.second=8243;e.secondtonechinese=714;e.section=167;e.seenarabic=1587;e.seenfinalarabic=65202;e.seeninitialarabic=65203;e.seenmedialarabic=65204;e.segol=1462;e.segol13=1462;e.segol1f=1462;e.segol2c=1462;e.segolhebrew=1462;e.segolnarrowhebrew=1462;e.segolquarterhebrew=1462;e.segoltahebrew=1426;e.segolwidehebrew=1462;e.seharmenian=1405;e.sehiragana=12379;e.sekatakana=12475;e.sekatakanahalfwidth=65406;e.semicolon=59;e.semicolonarabic=1563;e.semicolonmonospace=65307;e.semicolonsmall=65108;e.semivoicedmarkkana=12444;e.semivoicedmarkkanahalfwidth=65439;e.sentisquare=13090;e.sentosquare=13091;e.seven=55;e.sevenarabic=1639;e.sevenbengali=2541;e.sevencircle=9318;e.sevencircleinversesansserif=10128;e.sevendeva=2413;e.seveneighths=8542;e.sevengujarati=2797;e.sevengurmukhi=2669;e.sevenhackarabic=1639;e.sevenhangzhou=12327;e.sevenideographicparen=12838;e.seveninferior=8327;e.sevenmonospace=65303;e.sevenoldstyle=63287;e.sevenparen=9338;e.sevenperiod=9358;e.sevenpersian=1783;e.sevenroman=8566;e.sevensuperior=8311;e.seventeencircle=9328;e.seventeenparen=9348;e.seventeenperiod=9368;e.seventhai=3671;e.sfthyphen=173;e.shaarmenian=1399;e.shabengali=2486;e.shacyrillic=1096;e.shaddaarabic=1617;e.shaddadammaarabic=64609;e.shaddadammatanarabic=64606;e.shaddafathaarabic=64608;e.shaddakasraarabic=64610;e.shaddakasratanarabic=64607;e.shade=9618;e.shadedark=9619;e.shadelight=9617;e.shademedium=9618;e.shadeva=2358;e.shagujarati=2742;e.shagurmukhi=2614;e.shalshelethebrew=1427;e.shbopomofo=12565;e.shchacyrillic=1097;e.sheenarabic=1588;e.sheenfinalarabic=65206;e.sheeninitialarabic=65207;e.sheenmedialarabic=65208;e.sheicoptic=995;e.sheqel=8362;e.sheqelhebrew=8362;e.sheva=1456;e.sheva115=1456;e.sheva15=1456;e.sheva22=1456;e.sheva2e=1456;e.shevahebrew=1456;e.shevanarrowhebrew=1456;e.shevaquarterhebrew=1456;e.shevawidehebrew=1456;e.shhacyrillic=1211;e.shimacoptic=1005;e.shin=1513;e.shindagesh=64329;e.shindageshhebrew=64329;e.shindageshshindot=64300;e.shindageshshindothebrew=64300;e.shindageshsindot=64301;e.shindageshsindothebrew=64301;e.shindothebrew=1473;e.shinhebrew=1513;e.shinshindot=64298;e.shinshindothebrew=64298;e.shinsindot=64299;e.shinsindothebrew=64299;e.shook=642;e.sigma=963;e.sigma1=962;e.sigmafinal=962;e.sigmalunatesymbolgreek=1010;e.sihiragana=12375;e.sikatakana=12471;e.sikatakanahalfwidth=65404;e.siluqhebrew=1469;e.siluqlefthebrew=1469;e.similar=8764;e.sindothebrew=1474;e.siosacirclekorean=12916;e.siosaparenkorean=12820;e.sioscieuckorean=12670;e.sioscirclekorean=12902;e.sioskiyeokkorean=12666;e.sioskorean=12613;e.siosnieunkorean=12667;e.siosparenkorean=12806;e.siospieupkorean=12669;e.siostikeutkorean=12668;e.six=54;e.sixarabic=1638;e.sixbengali=2540;e.sixcircle=9317;e.sixcircleinversesansserif=10127;e.sixdeva=2412;e.sixgujarati=2796;e.sixgurmukhi=2668;e.sixhackarabic=1638;e.sixhangzhou=12326;e.sixideographicparen=12837;e.sixinferior=8326;e.sixmonospace=65302;e.sixoldstyle=63286;e.sixparen=9337;e.sixperiod=9357;e.sixpersian=1782;e.sixroman=8565;e.sixsuperior=8310;e.sixteencircle=9327;e.sixteencurrencydenominatorbengali=2553;e.sixteenparen=9347;e.sixteenperiod=9367;e.sixthai=3670;e.slash=47;e.slashmonospace=65295;e.slong=383;e.slongdotaccent=7835;e.smileface=9786;e.smonospace=65363;e.sofpasuqhebrew=1475;e.softhyphen=173;e.softsigncyrillic=1100;e.sohiragana=12381;e.sokatakana=12477;e.sokatakanahalfwidth=65407;e.soliduslongoverlaycmb=824;e.solidusshortoverlaycmb=823;e.sorusithai=3625;e.sosalathai=3624;e.sosothai=3595;e.sosuathai=3626;e.space=32;e.spacehackarabic=32;e.spade=9824;e.spadesuitblack=9824;e.spadesuitwhite=9828;e.sparen=9390;e.squarebelowcmb=827;e.squarecc=13252;e.squarecm=13213;e.squarediagonalcrosshatchfill=9641;e.squarehorizontalfill=9636;e.squarekg=13199;e.squarekm=13214;e.squarekmcapital=13262;e.squareln=13265;e.squarelog=13266;e.squaremg=13198;e.squaremil=13269;e.squaremm=13212;e.squaremsquared=13217;e.squareorthogonalcrosshatchfill=9638;e.squareupperlefttolowerrightfill=9639;e.squareupperrighttolowerleftfill=9640;e.squareverticalfill=9637;e.squarewhitewithsmallblack=9635;e.srsquare=13275;e.ssabengali=2487;e.ssadeva=2359;e.ssagujarati=2743;e.ssangcieuckorean=12617;e.ssanghieuhkorean=12677;e.ssangieungkorean=12672;e.ssangkiyeokkorean=12594;e.ssangnieunkorean=12645;e.ssangpieupkorean=12611;e.ssangsioskorean=12614;e.ssangtikeutkorean=12600;e.ssuperior=63218;e.sterling=163;e.sterlingmonospace=65505;e.strokelongoverlaycmb=822;e.strokeshortoverlaycmb=821;e.subset=8834;e.subsetnotequal=8842;e.subsetorequal=8838;e.succeeds=8827;e.suchthat=8715;e.suhiragana=12377;e.sukatakana=12473;e.sukatakanahalfwidth=65405;e.sukunarabic=1618;e.summation=8721;e.sun=9788;e.superset=8835;e.supersetnotequal=8843;e.supersetorequal=8839;e.svsquare=13276;e.syouwaerasquare=13180;e.t=116;e.tabengali=2468;e.tackdown=8868;e.tackleft=8867;e.tadeva=2340;e.tagujarati=2724;e.tagurmukhi=2596;e.taharabic=1591;e.tahfinalarabic=65218;e.tahinitialarabic=65219;e.tahiragana=12383;e.tahmedialarabic=65220;e.taisyouerasquare=13181;e.takatakana=12479;e.takatakanahalfwidth=65408;e.tatweelarabic=1600;e.tau=964;e.tav=1514;e.tavdages=64330;e.tavdagesh=64330;e.tavdageshhebrew=64330;e.tavhebrew=1514;e.tbar=359;e.tbopomofo=12554;e.tcaron=357;e.tccurl=680;e.tcedilla=355;e.tcheharabic=1670;e.tchehfinalarabic=64379;e.tchehinitialarabic=64380;e.tchehmedialarabic=64381;e.tcircle=9443;e.tcircumflexbelow=7793;e.tcommaaccent=355;e.tdieresis=7831;e.tdotaccent=7787;e.tdotbelow=7789;e.tecyrillic=1090;e.tedescendercyrillic=1197;e.teharabic=1578;e.tehfinalarabic=65174;e.tehhahinitialarabic=64674;e.tehhahisolatedarabic=64524;e.tehinitialarabic=65175;e.tehiragana=12390;e.tehjeeminitialarabic=64673;e.tehjeemisolatedarabic=64523;e.tehmarbutaarabic=1577;e.tehmarbutafinalarabic=65172;e.tehmedialarabic=65176;e.tehmeeminitialarabic=64676;e.tehmeemisolatedarabic=64526;e.tehnoonfinalarabic=64627;e.tekatakana=12486;e.tekatakanahalfwidth=65411;e.telephone=8481;e.telephoneblack=9742;e.telishagedolahebrew=1440;e.telishaqetanahebrew=1449;e.tencircle=9321;e.tenideographicparen=12841;e.tenparen=9341;e.tenperiod=9361;e.tenroman=8569;e.tesh=679;e.tet=1496;e.tetdagesh=64312;e.tetdageshhebrew=64312;e.tethebrew=1496;e.tetsecyrillic=1205;e.tevirhebrew=1435;e.tevirlefthebrew=1435;e.thabengali=2469;e.thadeva=2341;e.thagujarati=2725;e.thagurmukhi=2597;e.thalarabic=1584;e.thalfinalarabic=65196;e.thanthakhatlowleftthai=63640;e.thanthakhatlowrightthai=63639;e.thanthakhatthai=3660;e.thanthakhatupperleftthai=63638;e.theharabic=1579;e.thehfinalarabic=65178;e.thehinitialarabic=65179;e.thehmedialarabic=65180;e.thereexists=8707;e.therefore=8756;e.theta=952;e.theta1=977;e.thetasymbolgreek=977;e.thieuthacirclekorean=12921;e.thieuthaparenkorean=12825;e.thieuthcirclekorean=12907;e.thieuthkorean=12620;e.thieuthparenkorean=12811;e.thirteencircle=9324;e.thirteenparen=9344;e.thirteenperiod=9364;e.thonangmonthothai=3601;e.thook=429;e.thophuthaothai=3602;e.thorn=254;e.thothahanthai=3607;e.thothanthai=3600;e.thothongthai=3608;e.thothungthai=3606;e.thousandcyrillic=1154;e.thousandsseparatorarabic=1644;e.thousandsseparatorpersian=1644;e.three=51;e.threearabic=1635;e.threebengali=2537;e.threecircle=9314;e.threecircleinversesansserif=10124;e.threedeva=2409;e.threeeighths=8540;e.threegujarati=2793;e.threegurmukhi=2665;e.threehackarabic=1635;e.threehangzhou=12323;e.threeideographicparen=12834;e.threeinferior=8323;e.threemonospace=65299;e.threenumeratorbengali=2550;e.threeoldstyle=63283;e.threeparen=9334;e.threeperiod=9354;e.threepersian=1779;e.threequarters=190;e.threequartersemdash=63198;e.threeroman=8562;e.threesuperior=179;e.threethai=3667;e.thzsquare=13204;e.tihiragana=12385;e.tikatakana=12481;e.tikatakanahalfwidth=65409;e.tikeutacirclekorean=12912;e.tikeutaparenkorean=12816;e.tikeutcirclekorean=12898;e.tikeutkorean=12599;e.tikeutparenkorean=12802;e.tilde=732;e.tildebelowcmb=816;e.tildecmb=771;e.tildecomb=771;e.tildedoublecmb=864;e.tildeoperator=8764;e.tildeoverlaycmb=820;e.tildeverticalcmb=830;e.timescircle=8855;e.tipehahebrew=1430;e.tipehalefthebrew=1430;e.tippigurmukhi=2672;e.titlocyrilliccmb=1155;e.tiwnarmenian=1407;e.tlinebelow=7791;e.tmonospace=65364;e.toarmenian=1385;e.tohiragana=12392;e.tokatakana=12488;e.tokatakanahalfwidth=65412;e.tonebarextrahighmod=741;e.tonebarextralowmod=745;e.tonebarhighmod=742;e.tonebarlowmod=744;e.tonebarmidmod=743;e.tonefive=445;e.tonesix=389;e.tonetwo=424;e.tonos=900;e.tonsquare=13095;e.topatakthai=3599;e.tortoiseshellbracketleft=12308;e.tortoiseshellbracketleftsmall=65117;e.tortoiseshellbracketleftvertical=65081;e.tortoiseshellbracketright=12309;e.tortoiseshellbracketrightsmall=65118;e.tortoiseshellbracketrightvertical=65082;e.totaothai=3605;e.tpalatalhook=427;e.tparen=9391;e.trademark=8482;e.trademarksans=63722;e.trademarkserif=63195;e.tretroflexhook=648;e.triagdn=9660;e.triaglf=9668;e.triagrt=9658;e.triagup=9650;e.ts=678;e.tsadi=1510;e.tsadidagesh=64326;e.tsadidageshhebrew=64326;e.tsadihebrew=1510;e.tsecyrillic=1094;e.tsere=1461;e.tsere12=1461;e.tsere1e=1461;e.tsere2b=1461;e.tserehebrew=1461;e.tserenarrowhebrew=1461;e.tserequarterhebrew=1461;e.tserewidehebrew=1461;e.tshecyrillic=1115;e.tsuperior=63219;e.ttabengali=2463;e.ttadeva=2335;e.ttagujarati=2719;e.ttagurmukhi=2591;e.tteharabic=1657;e.ttehfinalarabic=64359;e.ttehinitialarabic=64360;e.ttehmedialarabic=64361;e.tthabengali=2464;e.tthadeva=2336;e.tthagujarati=2720;e.tthagurmukhi=2592;e.tturned=647;e.tuhiragana=12388;e.tukatakana=12484;e.tukatakanahalfwidth=65410;e.tusmallhiragana=12387;e.tusmallkatakana=12483;e.tusmallkatakanahalfwidth=65391;e.twelvecircle=9323;e.twelveparen=9343;e.twelveperiod=9363;e.twelveroman=8571;e.twentycircle=9331;e.twentyhangzhou=21316;e.twentyparen=9351;e.twentyperiod=9371;e.two=50;e.twoarabic=1634;e.twobengali=2536;e.twocircle=9313;e.twocircleinversesansserif=10123;e.twodeva=2408;e.twodotenleader=8229;e.twodotleader=8229;e.twodotleadervertical=65072;e.twogujarati=2792;e.twogurmukhi=2664;e.twohackarabic=1634;e.twohangzhou=12322;e.twoideographicparen=12833;e.twoinferior=8322;e.twomonospace=65298;e.twonumeratorbengali=2549;e.twooldstyle=63282;e.twoparen=9333;e.twoperiod=9353;e.twopersian=1778;e.tworoman=8561;e.twostroke=443;e.twosuperior=178;e.twothai=3666;e.twothirds=8532;e.u=117;e.uacute=250;e.ubar=649;e.ubengali=2441;e.ubopomofo=12584;e.ubreve=365;e.ucaron=468;e.ucircle=9444;e.ucircumflex=251;e.ucircumflexbelow=7799;e.ucyrillic=1091;e.udattadeva=2385;e.udblacute=369;e.udblgrave=533;e.udeva=2313;e.udieresis=252;e.udieresisacute=472;e.udieresisbelow=7795;e.udieresiscaron=474;e.udieresiscyrillic=1265;e.udieresisgrave=476;e.udieresismacron=470;e.udotbelow=7909;e.ugrave=249;e.ugujarati=2697;e.ugurmukhi=2569;e.uhiragana=12358;e.uhookabove=7911;e.uhorn=432;e.uhornacute=7913;e.uhorndotbelow=7921;e.uhorngrave=7915;e.uhornhookabove=7917;e.uhorntilde=7919;e.uhungarumlaut=369;e.uhungarumlautcyrillic=1267;e.uinvertedbreve=535;e.ukatakana=12454;e.ukatakanahalfwidth=65395;e.ukcyrillic=1145;e.ukorean=12636;e.umacron=363;e.umacroncyrillic=1263;e.umacrondieresis=7803;e.umatragurmukhi=2625;e.umonospace=65365;e.underscore=95;e.underscoredbl=8215;e.underscoremonospace=65343;e.underscorevertical=65075;e.underscorewavy=65103;e.union=8746;e.universal=8704;e.uogonek=371;e.uparen=9392;e.upblock=9600;e.upperdothebrew=1476;e.upsilon=965;e.upsilondieresis=971;e.upsilondieresistonos=944;e.upsilonlatin=650;e.upsilontonos=973;e.uptackbelowcmb=797;e.uptackmod=724;e.uragurmukhi=2675;e.uring=367;e.ushortcyrillic=1118;e.usmallhiragana=12357;e.usmallkatakana=12453;e.usmallkatakanahalfwidth=65385;e.ustraightcyrillic=1199;e.ustraightstrokecyrillic=1201;e.utilde=361;e.utildeacute=7801;e.utildebelow=7797;e.uubengali=2442;e.uudeva=2314;e.uugujarati=2698;e.uugurmukhi=2570;e.uumatragurmukhi=2626;e.uuvowelsignbengali=2498;e.uuvowelsigndeva=2370;e.uuvowelsigngujarati=2754;e.uvowelsignbengali=2497;e.uvowelsigndeva=2369;e.uvowelsigngujarati=2753;e.v=118;e.vadeva=2357;e.vagujarati=2741;e.vagurmukhi=2613;e.vakatakana=12535;e.vav=1493;e.vavdagesh=64309;e.vavdagesh65=64309;e.vavdageshhebrew=64309;e.vavhebrew=1493;e.vavholam=64331;e.vavholamhebrew=64331;e.vavvavhebrew=1520;e.vavyodhebrew=1521;e.vcircle=9445;e.vdotbelow=7807;e.vecyrillic=1074;e.veharabic=1700;e.vehfinalarabic=64363;e.vehinitialarabic=64364;e.vehmedialarabic=64365;e.vekatakana=12537;e.venus=9792;e.verticalbar=124;e.verticallineabovecmb=781;e.verticallinebelowcmb=809;e.verticallinelowmod=716;e.verticallinemod=712;e.vewarmenian=1406;e.vhook=651;e.vikatakana=12536;e.viramabengali=2509;e.viramadeva=2381;e.viramagujarati=2765;e.visargabengali=2435;e.visargadeva=2307;e.visargagujarati=2691;e.vmonospace=65366;e.voarmenian=1400;e.voicediterationhiragana=12446;e.voicediterationkatakana=12542;e.voicedmarkkana=12443;e.voicedmarkkanahalfwidth=65438;e.vokatakana=12538;e.vparen=9393;e.vtilde=7805;e.vturned=652;e.vuhiragana=12436;e.vukatakana=12532;e.w=119;e.wacute=7811;e.waekorean=12633;e.wahiragana=12431;e.wakatakana=12527;e.wakatakanahalfwidth=65436;e.wakorean=12632;e.wasmallhiragana=12430;e.wasmallkatakana=12526;e.wattosquare=13143;e.wavedash=12316;e.wavyunderscorevertical=65076;e.wawarabic=1608;e.wawfinalarabic=65262;e.wawhamzaabovearabic=1572;e.wawhamzaabovefinalarabic=65158;e.wbsquare=13277;e.wcircle=9446;e.wcircumflex=373;e.wdieresis=7813;e.wdotaccent=7815;e.wdotbelow=7817;e.wehiragana=12433;e.weierstrass=8472;e.wekatakana=12529;e.wekorean=12638;e.weokorean=12637;e.wgrave=7809;e.whitebullet=9702;e.whitecircle=9675;e.whitecircleinverse=9689;e.whitecornerbracketleft=12302;e.whitecornerbracketleftvertical=65091;e.whitecornerbracketright=12303;e.whitecornerbracketrightvertical=65092;e.whitediamond=9671;e.whitediamondcontainingblacksmalldiamond=9672;e.whitedownpointingsmalltriangle=9663;e.whitedownpointingtriangle=9661;e.whiteleftpointingsmalltriangle=9667;e.whiteleftpointingtriangle=9665;e.whitelenticularbracketleft=12310;e.whitelenticularbracketright=12311;e.whiterightpointingsmalltriangle=9657;e.whiterightpointingtriangle=9655;e.whitesmallsquare=9643;e.whitesmilingface=9786;e.whitesquare=9633;e.whitestar=9734;e.whitetelephone=9743;e.whitetortoiseshellbracketleft=12312;e.whitetortoiseshellbracketright=12313;e.whiteuppointingsmalltriangle=9653;e.whiteuppointingtriangle=9651;e.wihiragana=12432;e.wikatakana=12528;e.wikorean=12639;e.wmonospace=65367;e.wohiragana=12434;e.wokatakana=12530;e.wokatakanahalfwidth=65382;e.won=8361;e.wonmonospace=65510;e.wowaenthai=3623;e.wparen=9394;e.wring=7832;e.wsuperior=695;e.wturned=653;e.wynn=447;e.x=120;e.xabovecmb=829;e.xbopomofo=12562;e.xcircle=9447;e.xdieresis=7821;e.xdotaccent=7819;e.xeharmenian=1389;e.xi=958;e.xmonospace=65368;e.xparen=9395;e.xsuperior=739;e.y=121;e.yaadosquare=13134;e.yabengali=2479;e.yacute=253;e.yadeva=2351;e.yaekorean=12626;e.yagujarati=2735;e.yagurmukhi=2607;e.yahiragana=12420;e.yakatakana=12516;e.yakatakanahalfwidth=65428;e.yakorean=12625;e.yamakkanthai=3662;e.yasmallhiragana=12419;e.yasmallkatakana=12515;e.yasmallkatakanahalfwidth=65388;e.yatcyrillic=1123;e.ycircle=9448;e.ycircumflex=375;e.ydieresis=255;e.ydotaccent=7823;e.ydotbelow=7925;e.yeharabic=1610;e.yehbarreearabic=1746;e.yehbarreefinalarabic=64431;e.yehfinalarabic=65266;e.yehhamzaabovearabic=1574;e.yehhamzaabovefinalarabic=65162;e.yehhamzaaboveinitialarabic=65163;e.yehhamzaabovemedialarabic=65164;e.yehinitialarabic=65267;e.yehmedialarabic=65268;e.yehmeeminitialarabic=64733;e.yehmeemisolatedarabic=64600;e.yehnoonfinalarabic=64660;e.yehthreedotsbelowarabic=1745;e.yekorean=12630;e.yen=165;e.yenmonospace=65509;e.yeokorean=12629;e.yeorinhieuhkorean=12678;e.yerahbenyomohebrew=1450;e.yerahbenyomolefthebrew=1450;e.yericyrillic=1099;e.yerudieresiscyrillic=1273;e.yesieungkorean=12673;e.yesieungpansioskorean=12675;e.yesieungsioskorean=12674;e.yetivhebrew=1434;e.ygrave=7923;e.yhook=436;e.yhookabove=7927;e.yiarmenian=1397;e.yicyrillic=1111;e.yikorean=12642;e.yinyang=9775;e.yiwnarmenian=1410;e.ymonospace=65369;e.yod=1497;e.yoddagesh=64313;e.yoddageshhebrew=64313;e.yodhebrew=1497;e.yodyodhebrew=1522;e.yodyodpatahhebrew=64287;e.yohiragana=12424;e.yoikorean=12681;e.yokatakana=12520;e.yokatakanahalfwidth=65430;e.yokorean=12635;e.yosmallhiragana=12423;e.yosmallkatakana=12519;e.yosmallkatakanahalfwidth=65390;e.yotgreek=1011;e.yoyaekorean=12680;e.yoyakorean=12679;e.yoyakthai=3618;e.yoyingthai=3597;e.yparen=9396;e.ypogegrammeni=890;e.ypogegrammenigreekcmb=837;e.yr=422;e.yring=7833;e.ysuperior=696;e.ytilde=7929;e.yturned=654;e.yuhiragana=12422;e.yuikorean=12684;e.yukatakana=12518;e.yukatakanahalfwidth=65429;e.yukorean=12640;e.yusbigcyrillic=1131;e.yusbigiotifiedcyrillic=1133;e.yuslittlecyrillic=1127;e.yuslittleiotifiedcyrillic=1129;e.yusmallhiragana=12421;e.yusmallkatakana=12517;e.yusmallkatakanahalfwidth=65389;e.yuyekorean=12683;e.yuyeokorean=12682;e.yyabengali=2527;e.yyadeva=2399;e.z=122;e.zaarmenian=1382;e.zacute=378;e.zadeva=2395;e.zagurmukhi=2651;e.zaharabic=1592;e.zahfinalarabic=65222;e.zahinitialarabic=65223;e.zahiragana=12374;e.zahmedialarabic=65224;e.zainarabic=1586;e.zainfinalarabic=65200;e.zakatakana=12470;e.zaqefgadolhebrew=1429;e.zaqefqatanhebrew=1428;e.zarqahebrew=1432;e.zayin=1494;e.zayindagesh=64310;e.zayindageshhebrew=64310;e.zayinhebrew=1494;e.zbopomofo=12567;e.zcaron=382;e.zcircle=9449;e.zcircumflex=7825;e.zcurl=657;e.zdot=380;e.zdotaccent=380;e.zdotbelow=7827;e.zecyrillic=1079;e.zedescendercyrillic=1177;e.zedieresiscyrillic=1247;e.zehiragana=12380;e.zekatakana=12476;e.zero=48;e.zeroarabic=1632;e.zerobengali=2534;e.zerodeva=2406;e.zerogujarati=2790;e.zerogurmukhi=2662;e.zerohackarabic=1632;e.zeroinferior=8320;e.zeromonospace=65296;e.zerooldstyle=63280;e.zeropersian=1776;e.zerosuperior=8304;e.zerothai=3664;e.zerowidthjoiner=65279;e.zerowidthnonjoiner=8204;e.zerowidthspace=8203;e.zeta=950;e.zhbopomofo=12563;e.zhearmenian=1386;e.zhebrevecyrillic=1218;e.zhecyrillic=1078;e.zhedescendercyrillic=1175;e.zhedieresiscyrillic=1245;e.zihiragana=12376;e.zikatakana=12472;e.zinorhebrew=1454;e.zlinebelow=7829;e.zmonospace=65370;e.zohiragana=12382;e.zokatakana=12478;e.zparen=9397;e.zretroflexhook=656;e.zstroke=438;e.zuhiragana=12378;e.zukatakana=12474;e[".notdef"]=0;e.angbracketleftbig=9001;e.angbracketleftBig=9001;e.angbracketleftbigg=9001;e.angbracketleftBigg=9001;e.angbracketrightBig=9002;e.angbracketrightbig=9002;e.angbracketrightBigg=9002;e.angbracketrightbigg=9002;e.arrowhookleft=8618;e.arrowhookright=8617;e.arrowlefttophalf=8636;e.arrowleftbothalf=8637;e.arrownortheast=8599;e.arrownorthwest=8598;e.arrowrighttophalf=8640;e.arrowrightbothalf=8641;e.arrowsoutheast=8600;e.arrowsouthwest=8601;e.backslashbig=8726;e.backslashBig=8726;e.backslashBigg=8726;e.backslashbigg=8726;e.bardbl=8214;e.bracehtipdownleft=65079;e.bracehtipdownright=65079;e.bracehtipupleft=65080;e.bracehtipupright=65080;e.braceleftBig=123;e.braceleftbig=123;e.braceleftbigg=123;e.braceleftBigg=123;e.bracerightBig=125;e.bracerightbig=125;e.bracerightbigg=125;e.bracerightBigg=125;e.bracketleftbig=91;e.bracketleftBig=91;e.bracketleftbigg=91;e.bracketleftBigg=91;e.bracketrightBig=93;e.bracketrightbig=93;e.bracketrightbigg=93;e.bracketrightBigg=93;e.ceilingleftbig=8968;e.ceilingleftBig=8968;e.ceilingleftBigg=8968;e.ceilingleftbigg=8968;e.ceilingrightbig=8969;e.ceilingrightBig=8969;e.ceilingrightbigg=8969;e.ceilingrightBigg=8969;e.circledotdisplay=8857;e.circledottext=8857;e.circlemultiplydisplay=8855;e.circlemultiplytext=8855;e.circleplusdisplay=8853;e.circleplustext=8853;e.contintegraldisplay=8750;e.contintegraltext=8750;e.coproductdisplay=8720;e.coproducttext=8720;e.floorleftBig=8970;e.floorleftbig=8970;e.floorleftbigg=8970;e.floorleftBigg=8970;e.floorrightbig=8971;e.floorrightBig=8971;e.floorrightBigg=8971;e.floorrightbigg=8971;e.hatwide=770;e.hatwider=770;e.hatwidest=770;e.intercal=7488;e.integraldisplay=8747;e.integraltext=8747;e.intersectiondisplay=8898;e.intersectiontext=8898;e.logicalanddisplay=8743;e.logicalandtext=8743;e.logicalordisplay=8744;e.logicalortext=8744;e.parenleftBig=40;e.parenleftbig=40;e.parenleftBigg=40;e.parenleftbigg=40;e.parenrightBig=41;e.parenrightbig=41;e.parenrightBigg=41;e.parenrightbigg=41;e.prime=8242;e.productdisplay=8719;e.producttext=8719;e.radicalbig=8730;e.radicalBig=8730;e.radicalBigg=8730;e.radicalbigg=8730;e.radicalbt=8730;e.radicaltp=8730;e.radicalvertex=8730;e.slashbig=47;e.slashBig=47;e.slashBigg=47;e.slashbigg=47;e.summationdisplay=8721;e.summationtext=8721;e.tildewide=732;e.tildewider=732;e.tildewidest=732;e.uniondisplay=8899;e.unionmultidisplay=8846;e.unionmultitext=8846;e.unionsqdisplay=8852;e.unionsqtext=8852;e.uniontext=8899;e.vextenddouble=8741;e.vextendsingle=8739})),Ir=getLookupTableFactory((function(e){e.space=32;e.a1=9985;e.a2=9986;e.a202=9987;e.a3=9988;e.a4=9742;e.a5=9990;e.a119=9991;e.a118=9992;e.a117=9993;e.a11=9755;e.a12=9758;e.a13=9996;e.a14=9997;e.a15=9998;e.a16=9999;e.a105=1e4;e.a17=10001;e.a18=10002;e.a19=10003;e.a20=10004;e.a21=10005;e.a22=10006;e.a23=10007;e.a24=10008;e.a25=10009;e.a26=10010;e.a27=10011;e.a28=10012;e.a6=10013;e.a7=10014;e.a8=10015;e.a9=10016;e.a10=10017;e.a29=10018;e.a30=10019;e.a31=10020;e.a32=10021;e.a33=10022;e.a34=10023;e.a35=9733;e.a36=10025;e.a37=10026;e.a38=10027;e.a39=10028;e.a40=10029;e.a41=10030;e.a42=10031;e.a43=10032;e.a44=10033;e.a45=10034;e.a46=10035;e.a47=10036;e.a48=10037;e.a49=10038;e.a50=10039;e.a51=10040;e.a52=10041;e.a53=10042;e.a54=10043;e.a55=10044;e.a56=10045;e.a57=10046;e.a58=10047;e.a59=10048;e.a60=10049;e.a61=10050;e.a62=10051;e.a63=10052;e.a64=10053;e.a65=10054;e.a66=10055;e.a67=10056;e.a68=10057;e.a69=10058;e.a70=10059;e.a71=9679;e.a72=10061;e.a73=9632;e.a74=10063;e.a203=10064;e.a75=10065;e.a204=10066;e.a76=9650;e.a77=9660;e.a78=9670;e.a79=10070;e.a81=9687;e.a82=10072;e.a83=10073;e.a84=10074;e.a97=10075;e.a98=10076;e.a99=10077;e.a100=10078;e.a101=10081;e.a102=10082;e.a103=10083;e.a104=10084;e.a106=10085;e.a107=10086;e.a108=10087;e.a112=9827;e.a111=9830;e.a110=9829;e.a109=9824;e.a120=9312;e.a121=9313;e.a122=9314;e.a123=9315;e.a124=9316;e.a125=9317;e.a126=9318;e.a127=9319;e.a128=9320;e.a129=9321;e.a130=10102;e.a131=10103;e.a132=10104;e.a133=10105;e.a134=10106;e.a135=10107;e.a136=10108;e.a137=10109;e.a138=10110;e.a139=10111;e.a140=10112;e.a141=10113;e.a142=10114;e.a143=10115;e.a144=10116;e.a145=10117;e.a146=10118;e.a147=10119;e.a148=10120;e.a149=10121;e.a150=10122;e.a151=10123;e.a152=10124;e.a153=10125;e.a154=10126;e.a155=10127;e.a156=10128;e.a157=10129;e.a158=10130;e.a159=10131;e.a160=10132;e.a161=8594;e.a163=8596;e.a164=8597;e.a196=10136;e.a165=10137;e.a192=10138;e.a166=10139;e.a167=10140;e.a168=10141;e.a169=10142;e.a170=10143;e.a171=10144;e.a172=10145;e.a173=10146;e.a162=10147;e.a174=10148;e.a175=10149;e.a176=10150;e.a177=10151;e.a178=10152;e.a179=10153;e.a193=10154;e.a180=10155;e.a199=10156;e.a181=10157;e.a200=10158;e.a182=10159;e.a201=10161;e.a183=10162;e.a184=10163;e.a197=10164;e.a185=10165;e.a194=10166;e.a198=10167;e.a186=10168;e.a195=10169;e.a187=10170;e.a188=10171;e.a189=10172;e.a190=10173;e.a191=10174;e.a89=10088;e.a90=10089;e.a93=10090;e.a94=10091;e.a91=10092;e.a92=10093;e.a205=10094;e.a85=10095;e.a206=10096;e.a86=10097;e.a87=10098;e.a88=10099;e.a95=10100;e.a96=10101;e[".notdef"]=0})),Tr=getLookupTableFactory((function(e){e[63721]=169;e[63193]=169;e[63720]=174;e[63194]=174;e[63722]=8482;e[63195]=8482;e[63729]=9127;e[63730]=9128;e[63731]=9129;e[63740]=9131;e[63741]=9132;e[63742]=9133;e[63726]=9121;e[63727]=9122;e[63728]=9123;e[63737]=9124;e[63738]=9125;e[63739]=9126;e[63723]=9115;e[63724]=9116;e[63725]=9117;e[63734]=9118;e[63735]=9119;e[63736]=9120}));function getUnicodeForGlyph(e,t){let a=t[e];if(void 0!==a)return a;if(!e)return-1;if("u"===e[0]){const t=e.length;let r;if(7===t&&"n"===e[1]&&"i"===e[2])r=e.substring(3);else{if(!(t>=5&&t<=7))return-1;r=e.substring(1)}if(r===r.toUpperCase()){a=parseInt(r,16);if(a>=0)return a}}return-1}const Or=[[0,127],[128,255],[256,383],[384,591],[592,687,7424,7551,7552,7615],[688,767,42752,42783],[768,879,7616,7679],[880,1023],[11392,11519],[1024,1279,1280,1327,11744,11775,42560,42655],[1328,1423],[1424,1535],[42240,42559],[1536,1791,1872,1919],[1984,2047],[2304,2431],[2432,2559],[2560,2687],[2688,2815],[2816,2943],[2944,3071],[3072,3199],[3200,3327],[3328,3455],[3584,3711],[3712,3839],[4256,4351,11520,11567],[6912,7039],[4352,4607],[7680,7935,11360,11391,42784,43007],[7936,8191],[8192,8303,11776,11903],[8304,8351],[8352,8399],[8400,8447],[8448,8527],[8528,8591],[8592,8703,10224,10239,10496,10623,11008,11263],[8704,8959,10752,11007,10176,10223,10624,10751],[8960,9215],[9216,9279],[9280,9311],[9312,9471],[9472,9599],[9600,9631],[9632,9727],[9728,9983],[9984,10175],[12288,12351],[12352,12447],[12448,12543,12784,12799],[12544,12591,12704,12735],[12592,12687],[43072,43135],[12800,13055],[13056,13311],[44032,55215],[55296,57343],[67840,67871],[19968,40959,11904,12031,12032,12255,12272,12287,13312,19903,131072,173791,12688,12703],[57344,63743],[12736,12783,63744,64255,194560,195103],[64256,64335],[64336,65023],[65056,65071],[65040,65055],[65104,65135],[65136,65279],[65280,65519],[65520,65535],[3840,4095],[1792,1871],[1920,1983],[3456,3583],[4096,4255],[4608,4991,4992,5023,11648,11743],[5024,5119],[5120,5759],[5760,5791],[5792,5887],[6016,6143],[6144,6319],[10240,10495],[40960,42127],[5888,5919,5920,5951,5952,5983,5984,6015],[66304,66351],[66352,66383],[66560,66639],[118784,119039,119040,119295,119296,119375],[119808,120831],[1044480,1048573],[65024,65039,917760,917999],[917504,917631],[6400,6479],[6480,6527],[6528,6623],[6656,6687],[11264,11359],[11568,11647],[19904,19967],[43008,43055],[65536,65663,65664,65791,65792,65855],[65856,65935],[66432,66463],[66464,66527],[66640,66687],[66688,66735],[67584,67647],[68096,68191],[119552,119647],[73728,74751,74752,74879],[119648,119679],[7040,7103],[7168,7247],[7248,7295],[43136,43231],[43264,43311],[43312,43359],[43520,43615],[65936,65999],[66e3,66047],[66208,66271,66176,66207,67872,67903],[127024,127135,126976,127023]];function getUnicodeRangeFor(e,t=-1){if(-1!==t){const a=Or[t];for(let r=0,i=a.length;r<i;r+=2)if(e>=a[r]&&e<=a[r+1])return t}for(let t=0,a=Or.length;t<a;t++){const a=Or[t];for(let r=0,i=a.length;r<i;r+=2)if(e>=a[r]&&e<=a[r+1])return t}return-1}const Mr=new RegExp("^(\\\\s)|(\\\\p{Mn})|(\\\\p{Cf})$","u"),Dr=new Map;const Rr=!0,Nr=1,Er=2,Pr=4,Lr=32,jr=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function recoverGlyphName(e,t){if(void 0!==t[e])return e;const a=getUnicodeForGlyph(e,t);if(-1!==a)for(const e in t)if(t[e]===a)return e;info("Unable to recover a standard glyph name for: "+e);return e}function type1FontGlyphMapping(e,t,a){const r=Object.create(null);let i,n,s;const o=!!(e.flags&Pr);if(e.isInternalFont){s=t;for(n=0;n<s.length;n++){i=a.indexOf(s[n]);r[n]=i>=0?i:0}}else if(e.baseEncodingName){s=getEncoding(e.baseEncodingName);for(n=0;n<s.length;n++){i=a.indexOf(s[n]);r[n]=i>=0?i:0}}else if(o)for(n in t)r[n]=t[n];else{s=Ar;for(n=0;n<s.length;n++){i=a.indexOf(s[n]);r[n]=i>=0?i:0}}const c=e.differences;let l;if(c)for(n in c){const e=c[n];i=a.indexOf(e);if(-1===i){l||(l=Fr());const t=recoverGlyphName(e,l);t!==e&&(i=a.indexOf(t))}r[n]=i>=0?i:0}return r}function normalizeFontName(e){return e.replaceAll(/[,_]/g,"-").replaceAll(/\\s/g,"")}const _r=getLookupTableFactory((e=>{e[8211]=65074;e[8212]=65073;e[8229]=65072;e[8230]=65049;e[12289]=65041;e[12290]=65042;e[12296]=65087;e[12297]=65088;e[12298]=65085;e[12299]=65086;e[12300]=65089;e[12301]=65090;e[12302]=65091;e[12303]=65092;e[12304]=65083;e[12305]=65084;e[12308]=65081;e[12309]=65082;e[12310]=65047;e[12311]=65048;e[65103]=65076;e[65281]=65045;e[65288]=65077;e[65289]=65078;e[65292]=65040;e[65306]=65043;e[65307]=65044;e[65311]=65046;e[65339]=65095;e[65341]=65096;e[65343]=65075;e[65371]=65079;e[65373]=65080}));const Ur=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],Xr=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],qr=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"],Hr=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Wr=391,zr=[null,{id:"hstem",min:2,stackClearing:!0,stem:!0},null,{id:"vstem",min:2,stackClearing:!0,stem:!0},{id:"vmoveto",min:1,stackClearing:!0},{id:"rlineto",min:2,resetStack:!0},{id:"hlineto",min:1,resetStack:!0},{id:"vlineto",min:1,resetStack:!0},{id:"rrcurveto",min:6,resetStack:!0},null,{id:"callsubr",min:1,undefStack:!0},{id:"return",min:0,undefStack:!0},null,null,{id:"endchar",min:0,stackClearing:!0},null,null,null,{id:"hstemhm",min:2,stackClearing:!0,stem:!0},{id:"hintmask",min:0,stackClearing:!0},{id:"cntrmask",min:0,stackClearing:!0},{id:"rmoveto",min:2,stackClearing:!0},{id:"hmoveto",min:1,stackClearing:!0},{id:"vstemhm",min:2,stackClearing:!0,stem:!0},{id:"rcurveline",min:8,resetStack:!0},{id:"rlinecurve",min:8,resetStack:!0},{id:"vvcurveto",min:4,resetStack:!0},{id:"hhcurveto",min:4,resetStack:!0},null,{id:"callgsubr",min:1,undefStack:!0},{id:"vhcurveto",min:4,resetStack:!0},{id:"hvcurveto",min:4,resetStack:!0}],$r=[null,null,null,{id:"and",min:2,stackDelta:-1},{id:"or",min:2,stackDelta:-1},{id:"not",min:1,stackDelta:0},null,null,null,{id:"abs",min:1,stackDelta:0},{id:"add",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]+e[t-1]}},{id:"sub",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]-e[t-1]}},{id:"div",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]/e[t-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn(e,t){e[t-1]=-e[t-1]}},{id:"eq",min:2,stackDelta:-1},null,null,{id:"drop",min:1,stackDelta:-1},null,{id:"put",min:2,stackDelta:-2},{id:"get",min:1,stackDelta:0},{id:"ifelse",min:4,stackDelta:-3},{id:"random",min:0,stackDelta:1},{id:"mul",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]*e[t-1]}},null,{id:"sqrt",min:1,stackDelta:0},{id:"dup",min:1,stackDelta:1},{id:"exch",min:2,stackDelta:0},{id:"index",min:2,stackDelta:0},{id:"roll",min:3,stackDelta:-2},null,null,null,{id:"hflex",min:7,resetStack:!0},{id:"flex",min:13,resetStack:!0},{id:"hflex1",min:9,resetStack:!0},{id:"flex1",min:11,resetStack:!0}];class CFFParser{constructor(e,t,a){this.bytes=e.getBytes();this.properties=t;this.seacAnalysisEnabled=!!a}parse(){const e=this.properties,t=new CFF;this.cff=t;const a=this.parseHeader(),r=this.parseIndex(a.endPos),i=this.parseIndex(r.endPos),n=this.parseIndex(i.endPos),s=this.parseIndex(n.endPos),o=this.parseDict(i.obj.get(0)),c=this.createDict(CFFTopDict,o,t.strings);t.header=a.obj;t.names=this.parseNameIndex(r.obj);t.strings=this.parseStringIndex(n.obj);t.topDict=c;t.globalSubrIndex=s.obj;this.parsePrivateDict(t.topDict);t.isCIDFont=c.hasName("ROS");const l=c.getByName("CharStrings"),h=this.parseIndex(l).obj,u=c.getByName("FontMatrix");u&&(e.fontMatrix=u);const d=c.getByName("FontBBox");if(d){e.ascent=Math.max(d[3],d[1]);e.descent=Math.min(d[1],d[3]);e.ascentScaled=!0}let f,g;if(t.isCIDFont){const e=this.parseIndex(c.getByName("FDArray")).obj;for(let a=0,r=e.count;a<r;++a){const r=e.get(a),i=this.createDict(CFFTopDict,this.parseDict(r),t.strings);this.parsePrivateDict(i);t.fdArray.push(i)}g=null;f=this.parseCharsets(c.getByName("charset"),h.count,t.strings,!0);t.fdSelect=this.parseFDSelect(c.getByName("FDSelect"),h.count)}else{f=this.parseCharsets(c.getByName("charset"),h.count,t.strings,!1);g=this.parseEncoding(c.getByName("Encoding"),e,t.strings,f.charset)}t.charset=f;t.encoding=g;const p=this.parseCharStrings({charStrings:h,localSubrIndex:c.privateDict.subrsIndex,globalSubrIndex:s.obj,fdSelect:t.fdSelect,fdArray:t.fdArray,privateDict:c.privateDict});t.charStrings=p.charStrings;t.seacs=p.seacs;t.widths=p.widths;return t}parseHeader(){let e=this.bytes;const t=e.length;let a=0;for(;a<t&&1!==e[a];)++a;if(a>=t)throw new FormatError("Invalid CFF header");if(0!==a){info("cff data is shifted");e=e.subarray(a);this.bytes=e}const r=e[0],i=e[1],n=e[2],s=e[3];return{obj:new CFFHeader(r,i,n,s),endPos:n}}parseDict(e){let t=0;function parseOperand(){let a=e[t++];if(30===a)return function parseFloatOperand(){let a="";const r=15,i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],n=e.length;for(;t<n;){const n=e[t++],s=n>>4,o=15&n;if(s===r)break;a+=i[s];if(o===r)break;a+=i[o]}return parseFloat(a)}();if(28===a){a=readInt16(e,t);t+=2;return a}if(29===a){a=e[t++];a=a<<8|e[t++];a=a<<8|e[t++];a=a<<8|e[t++];return a}if(a>=32&&a<=246)return a-139;if(a>=247&&a<=250)return 256*(a-247)+e[t++]+108;if(a>=251&&a<=254)return-256*(a-251)-e[t++]-108;warn(\'CFFParser_parseDict: "\'+a+\'" is a reserved command.\');return NaN}let a=[];const r=[];t=0;const i=e.length;for(;t<i;){let i=e[t];if(i<=21){12===i&&(i=i<<8|e[++t]);r.push([i,a]);a=[];++t}else a.push(parseOperand())}return r}parseIndex(e){const t=new CFFIndex,a=this.bytes,r=a[e++]<<8|a[e++],i=[];let n,s,o=e;if(0!==r){const t=a[e++],c=e+(r+1)*t-1;for(n=0,s=r+1;n<s;++n){let r=0;for(let i=0;i<t;++i){r<<=8;r+=a[e++]}i.push(c+r)}o=i[r]}for(n=0,s=i.length-1;n<s;++n){const e=i[n],r=i[n+1];t.add(a.subarray(e,r))}return{obj:t,endPos:o}}parseNameIndex(e){const t=[];for(let a=0,r=e.count;a<r;++a){const r=e.get(a);t.push(bytesToString(r))}return t}parseStringIndex(e){const t=new CFFStrings;for(let a=0,r=e.count;a<r;++a){const r=e.get(a);t.add(bytesToString(r))}return t}createDict(e,t,a){const r=new e(a);for(const[e,a]of t)r.setByKey(e,a);return r}parseCharString(e,t,a,r){if(!t||e.callDepth>10)return!1;let i=e.stackSize;const n=e.stack;let s=t.length;for(let o=0;o<s;){const c=t[o++];let l=null;if(12===c){const e=t[o++];if(0===e){t[o-2]=139;t[o-1]=22;i=0}else l=$r[e]}else if(28===c){n[i]=readInt16(t,o);o+=2;i++}else if(14===c){if(i>=4){i-=4;if(this.seacAnalysisEnabled){e.seac=n.slice(i,i+4);return!1}}l=zr[c]}else if(c>=32&&c<=246){n[i]=c-139;i++}else if(c>=247&&c<=254){n[i]=c<251?(c-247<<8)+t[o]+108:-(c-251<<8)-t[o]-108;o++;i++}else if(255===c){n[i]=(t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3])/65536;o+=4;i++}else if(19===c||20===c){e.hints+=i>>1;if(0===e.hints){t.copyWithin(o-1,o,-1);o-=1;s-=1;continue}o+=e.hints+7>>3;i%=2;l=zr[c]}else{if(10===c||29===c){const t=10===c?a:r;if(!t){l=zr[c];warn("Missing subrsIndex for "+l.id);return!1}let s=32768;t.count<1240?s=107:t.count<33900&&(s=1131);const o=n[--i]+s;if(o<0||o>=t.count||isNaN(o)){l=zr[c];warn("Out of bounds subrIndex for "+l.id);return!1}e.stackSize=i;e.callDepth++;if(!this.parseCharString(e,t.get(o),a,r))return!1;e.callDepth--;i=e.stackSize;continue}if(11===c){e.stackSize=i;return!0}if(0===c&&o===t.length){t[o-1]=14;l=zr[14]}else{if(9===c){t.copyWithin(o-1,o,-1);o-=1;s-=1;continue}l=zr[c]}}if(l){if(l.stem){e.hints+=i>>1;if(3===c||23===c)e.hasVStems=!0;else if(e.hasVStems&&(1===c||18===c)){warn("CFF stem hints are in wrong order");t[o-1]=1===c?3:23}}if("min"in l&&!e.undefStack&&i<l.min){warn("Not enough parameters for "+l.id+"; actual: "+i+", expected: "+l.min);if(0===i){t[o-1]=14;return!0}return!1}if(e.firstStackClearing&&l.stackClearing){e.firstStackClearing=!1;i-=l.min;i>=2&&l.stem?i%=2:i>1&&warn("Found too many parameters for stack-clearing command");i>0&&(e.width=n[i-1])}if("stackDelta"in l){"stackFn"in l&&l.stackFn(n,i);i+=l.stackDelta}else if(l.stackClearing)i=0;else if(l.resetStack){i=0;e.undefStack=!1}else if(l.undefStack){i=0;e.undefStack=!0;e.firstStackClearing=!1}}}s<t.length&&t.fill(14,s);e.stackSize=i;return!0}parseCharStrings({charStrings:e,localSubrIndex:t,globalSubrIndex:a,fdSelect:r,fdArray:i,privateDict:n}){const s=[],o=[],c=e.count;for(let l=0;l<c;l++){const c=e.get(l),h={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1};let u=!0,d=null,f=n;if(r&&i.length){const e=r.getFDIndex(l);if(-1===e){warn("Glyph index is not in fd select.");u=!1}if(e>=i.length){warn("Invalid fd index for glyph index.");u=!1}if(u){f=i[e].privateDict;d=f.subrsIndex}}else t&&(d=t);u&&(u=this.parseCharString(h,c,d,a));if(null!==h.width){const e=f.getByName("nominalWidthX");o[l]=e+h.width}else{const e=f.getByName("defaultWidthX");o[l]=e}null!==h.seac&&(s[l]=h.seac);u||e.set(l,new Uint8Array([14]))}return{charStrings:e,seacs:s,widths:o}}emptyPrivateDictionary(e){const t=this.createDict(CFFPrivateDict,[],e.strings);e.setByKey(18,[0,0]);e.privateDict=t}parsePrivateDict(e){if(!e.hasName("Private")){this.emptyPrivateDictionary(e);return}const t=e.getByName("Private");if(!Array.isArray(t)||2!==t.length){e.removeByName("Private");return}const a=t[0],r=t[1];if(0===a||r>=this.bytes.length){this.emptyPrivateDictionary(e);return}const i=r+a,n=this.bytes.subarray(r,i),s=this.parseDict(n),o=this.createDict(CFFPrivateDict,s,e.strings);e.privateDict=o;0===o.getByName("ExpansionFactor")&&o.setByName("ExpansionFactor",.06);if(!o.getByName("Subrs"))return;const c=o.getByName("Subrs"),l=r+c;if(0===c||l>=this.bytes.length){this.emptyPrivateDictionary(e);return}const h=this.parseIndex(l);o.subrsIndex=h.obj}parseCharsets(e,t,a,r){if(0===e)return new CFFCharset(!0,Kr.ISO_ADOBE,Ur);if(1===e)return new CFFCharset(!0,Kr.EXPERT,Xr);if(2===e)return new CFFCharset(!0,Kr.EXPERT_SUBSET,qr);const i=this.bytes,n=e,s=i[e++],o=[r?0:".notdef"];let c,l,h;t-=1;switch(s){case 0:for(h=0;h<t;h++){c=i[e++]<<8|i[e++];o.push(r?c:a.get(c))}break;case 1:for(;o.length<=t;){c=i[e++]<<8|i[e++];l=i[e++];for(h=0;h<=l;h++)o.push(r?c++:a.get(c++))}break;case 2:for(;o.length<=t;){c=i[e++]<<8|i[e++];l=i[e++]<<8|i[e++];for(h=0;h<=l;h++)o.push(r?c++:a.get(c++))}break;default:throw new FormatError("Unknown charset format")}const u=e,d=i.subarray(n,u);return new CFFCharset(!1,s,o,d)}parseEncoding(e,t,a,r){const i=Object.create(null),n=this.bytes;let s,o,c,l=!1,h=null;if(0===e||1===e){l=!0;s=e;const t=e?wr:Ar;for(o=0,c=r.length;o<c;o++){const e=t.indexOf(r[o]);-1!==e&&(i[e]=o)}}else{const t=e;s=n[e++];switch(127&s){case 0:const t=n[e++];for(o=1;o<=t;o++)i[n[e++]]=o;break;case 1:const a=n[e++];let r=1;for(o=0;o<a;o++){const t=n[e++],a=n[e++];for(let e=t;e<=t+a;e++)i[e]=r++}break;default:throw new FormatError(`Unknown encoding format: ${s} in CFF`)}const c=e;if(128&s){n[t]&=127;!function readSupplement(){const t=n[e++];for(o=0;o<t;o++){const t=n[e++],s=(n[e++]<<8)+(255&n[e++]);i[t]=r.indexOf(a.get(s))}}()}h=n.subarray(t,c)}s&=127;return new CFFEncoding(l,s,i,h)}parseFDSelect(e,t){const a=this.bytes,r=a[e++],i=[];let n;switch(r){case 0:for(n=0;n<t;++n){const t=a[e++];i.push(t)}break;case 3:const s=a[e++]<<8|a[e++];for(n=0;n<s;++n){let t=a[e++]<<8|a[e++];if(0===n&&0!==t){warn("parseFDSelect: The first range must have a first GID of 0 -- trying to recover.");t=0}const r=a[e++],s=a[e]<<8|a[e+1];for(let e=t;e<s;++e)i.push(r)}e+=2;break;default:throw new FormatError(`parseFDSelect: Unknown format "${r}".`)}if(i.length!==t)throw new FormatError("parseFDSelect: Invalid font data.");return new CFFFDSelect(r,i)}}class CFF{constructor(){this.header=null;this.names=[];this.topDict=null;this.strings=new CFFStrings;this.globalSubrIndex=null;this.encoding=null;this.charset=null;this.charStrings=null;this.fdArray=[];this.fdSelect=null;this.isCIDFont=!1}duplicateFirstGlyph(){if(this.charStrings.count>=65535){warn("Not enough space in charstrings to duplicate first glyph.");return}const e=this.charStrings.get(0);this.charStrings.add(e);this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}hasGlyphId(e){if(e<0||e>=this.charStrings.count)return!1;return this.charStrings.get(e).length>0}}class CFFHeader{constructor(e,t,a,r){this.major=e;this.minor=t;this.hdrSize=a;this.offSize=r}}class CFFStrings{constructor(){this.strings=[]}get(e){return e>=0&&e<=390?Hr[e]:e-Wr<=this.strings.length?this.strings[e-Wr]:Hr[0]}getSID(e){let t=Hr.indexOf(e);if(-1!==t)return t;t=this.strings.indexOf(e);return-1!==t?t+Wr:-1}add(e){this.strings.push(e)}get count(){return this.strings.length}}class CFFIndex{constructor(){this.objects=[];this.length=0}add(e){this.length+=e.length;this.objects.push(e)}set(e,t){this.length+=t.length-this.objects[e].length;this.objects[e]=t}get(e){return this.objects[e]}get count(){return this.objects.length}}class CFFDict{constructor(e,t){this.keyToNameMap=e.keyToNameMap;this.nameToKeyMap=e.nameToKeyMap;this.defaults=e.defaults;this.types=e.types;this.opcodes=e.opcodes;this.order=e.order;this.strings=t;this.values=Object.create(null)}setByKey(e,t){if(!(e in this.keyToNameMap))return!1;if(0===t.length)return!0;for(const a of t)if(isNaN(a)){warn(`Invalid CFFDict value: "${t}" for key "${e}".`);return!0}const a=this.types[e];"num"!==a&&"sid"!==a&&"offset"!==a||(t=t[0]);this.values[e]=t;return!0}setByName(e,t){if(!(e in this.nameToKeyMap))throw new FormatError(`Invalid dictionary name "${e}"`);this.values[this.nameToKeyMap[e]]=t}hasName(e){return this.nameToKeyMap[e]in this.values}getByName(e){if(!(e in this.nameToKeyMap))throw new FormatError(`Invalid dictionary name ${e}"`);const t=this.nameToKeyMap[e];return t in this.values?this.values[t]:this.defaults[t]}removeByName(e){delete this.values[this.nameToKeyMap[e]]}static createTables(e){const t={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(const a of e){const e=Array.isArray(a[0])?(a[0][0]<<8)+a[0][1]:a[0];t.keyToNameMap[e]=a[1];t.nameToKeyMap[a[1]]=e;t.types[e]=a[2];t.defaults[e]=a[3];t.opcodes[e]=Array.isArray(a[0])?a[0]:[a[0]];t.order.push(e)}return t}}const Gr=[[[12,30],"ROS",["sid","sid","num"],null],[[12,20],"SyntheticBase","num",null],[0,"version","sid",null],[1,"Notice","sid",null],[[12,0],"Copyright","sid",null],[2,"FullName","sid",null],[3,"FamilyName","sid",null],[4,"Weight","sid",null],[[12,1],"isFixedPitch","num",0],[[12,2],"ItalicAngle","num",0],[[12,3],"UnderlinePosition","num",-100],[[12,4],"UnderlineThickness","num",50],[[12,5],"PaintType","num",0],[[12,6],"CharstringType","num",2],[[12,7],"FontMatrix",["num","num","num","num","num","num"],[.001,0,0,.001,0,0]],[13,"UniqueID","num",null],[5,"FontBBox",["num","num","num","num"],[0,0,0,0]],[[12,8],"StrokeWidth","num",0],[14,"XUID","array",null],[15,"charset","offset",0],[16,"Encoding","offset",0],[17,"CharStrings","offset",0],[18,"Private",["offset","offset"],null],[[12,21],"PostScript","sid",null],[[12,22],"BaseFontName","sid",null],[[12,23],"BaseFontBlend","delta",null],[[12,31],"CIDFontVersion","num",0],[[12,32],"CIDFontRevision","num",0],[[12,33],"CIDFontType","num",0],[[12,34],"CIDCount","num",8720],[[12,35],"UIDBase","num",null],[[12,37],"FDSelect","offset",null],[[12,36],"FDArray","offset",null],[[12,38],"FontName","sid",null]];class CFFTopDict extends CFFDict{static get tables(){return shadow(this,"tables",this.createTables(Gr))}constructor(e){super(CFFTopDict.tables,e);this.privateDict=null}}const Vr=[[6,"BlueValues","delta",null],[7,"OtherBlues","delta",null],[8,"FamilyBlues","delta",null],[9,"FamilyOtherBlues","delta",null],[[12,9],"BlueScale","num",.039625],[[12,10],"BlueShift","num",7],[[12,11],"BlueFuzz","num",1],[10,"StdHW","num",null],[11,"StdVW","num",null],[[12,12],"StemSnapH","delta",null],[[12,13],"StemSnapV","delta",null],[[12,14],"ForceBold","num",0],[[12,17],"LanguageGroup","num",0],[[12,18],"ExpansionFactor","num",.06],[[12,19],"initialRandomSeed","num",0],[20,"defaultWidthX","num",0],[21,"nominalWidthX","num",0],[19,"Subrs","offset",null]];class CFFPrivateDict extends CFFDict{static get tables(){return shadow(this,"tables",this.createTables(Vr))}constructor(e){super(CFFPrivateDict.tables,e);this.subrsIndex=null}}const Kr={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2};class CFFCharset{constructor(e,t,a,r){this.predefined=e;this.format=t;this.charset=a;this.raw=r}}class CFFEncoding{constructor(e,t,a,r){this.predefined=e;this.format=t;this.encoding=a;this.raw=r}}class CFFFDSelect{constructor(e,t){this.format=e;this.fdSelect=t}getFDIndex(e){return e<0||e>=this.fdSelect.length?-1:this.fdSelect[e]}}class CFFOffsetTracker{constructor(){this.offsets=Object.create(null)}isTracking(e){return e in this.offsets}track(e,t){if(e in this.offsets)throw new FormatError(`Already tracking location of ${e}`);this.offsets[e]=t}offset(e){for(const t in this.offsets)this.offsets[t]+=e}setEntryLocation(e,t,a){if(!(e in this.offsets))throw new FormatError(`Not tracking location of ${e}`);const r=a.data,i=this.offsets[e];for(let e=0,a=t.length;e<a;++e){const a=5*e+i,n=a+1,s=a+2,o=a+3,c=a+4;if(29!==r[a]||0!==r[n]||0!==r[s]||0!==r[o]||0!==r[c])throw new FormatError("writing to an offset that is not empty");const l=t[e];r[a]=29;r[n]=l>>24&255;r[s]=l>>16&255;r[o]=l>>8&255;r[c]=255&l}}}class CFFCompiler{constructor(e){this.cff=e}compile(){const e=this.cff,t={data:[],length:0,add(e){try{this.data.push(...e)}catch{this.data=this.data.concat(e)}this.length=this.data.length}},a=this.compileHeader(e.header);t.add(a);const r=this.compileNameIndex(e.names);t.add(r);if(e.isCIDFont&&e.topDict.hasName("FontMatrix")){const t=e.topDict.getByName("FontMatrix");e.topDict.removeByName("FontMatrix");for(const a of e.fdArray){let e=t.slice(0);a.hasName("FontMatrix")&&(e=Util.transform(e,a.getByName("FontMatrix")));a.setByName("FontMatrix",e)}}const i=e.topDict.getByName("XUID");i?.length>16&&e.topDict.removeByName("XUID");e.topDict.setByName("charset",0);let n=this.compileTopDicts([e.topDict],t.length,e.isCIDFont);t.add(n.output);const s=n.trackers[0],o=this.compileStringIndex(e.strings.strings);t.add(o);const c=this.compileIndex(e.globalSubrIndex);t.add(c);if(e.encoding&&e.topDict.hasName("Encoding"))if(e.encoding.predefined)s.setEntryLocation("Encoding",[e.encoding.format],t);else{const a=this.compileEncoding(e.encoding);s.setEntryLocation("Encoding",[t.length],t);t.add(a)}const l=this.compileCharset(e.charset,e.charStrings.count,e.strings,e.isCIDFont);s.setEntryLocation("charset",[t.length],t);t.add(l);const h=this.compileCharStrings(e.charStrings);s.setEntryLocation("CharStrings",[t.length],t);t.add(h);if(e.isCIDFont){s.setEntryLocation("FDSelect",[t.length],t);const a=this.compileFDSelect(e.fdSelect);t.add(a);n=this.compileTopDicts(e.fdArray,t.length,!0);s.setEntryLocation("FDArray",[t.length],t);t.add(n.output);const r=n.trackers;this.compilePrivateDicts(e.fdArray,r,t)}this.compilePrivateDicts([e.topDict],[s],t);t.add([0]);return t.data}encodeNumber(e){return Number.isInteger(e)?this.encodeInteger(e):this.encodeFloat(e)}static get EncodeFloatRegExp(){return shadow(this,"EncodeFloatRegExp",/\\.(\\d*?)(?:9{5,20}|0{5,20})\\d{0,2}(?:e(.+)|$)/)}encodeFloat(e){let t=e.toString();const a=CFFCompiler.EncodeFloatRegExp.exec(t);if(a){const r=parseFloat("1e"+((a[2]?+a[2]:0)+a[1].length));t=(Math.round(e*r)/r).toString()}let r,i,n="";for(r=0,i=t.length;r<i;++r){const e=t[r];n+="e"===e?"-"===t[++r]?"c":"b":"."===e?"a":"-"===e?"e":e}n+=1&n.length?"f":"ff";const s=[30];for(r=0,i=n.length;r<i;r+=2)s.push(parseInt(n.substring(r,r+2),16));return s}encodeInteger(e){let t;t=e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e];return t}compileHeader(e){return[e.major,e.minor,4,e.offSize]}compileNameIndex(e){const t=new CFFIndex;for(const a of e){const e=Math.min(a.length,127);let r=new Array(e);for(let t=0;t<e;t++){let e=a[t];(e<"!"||e>"~"||"["===e||"]"===e||"("===e||")"===e||"{"===e||"}"===e||"<"===e||">"===e||"/"===e||"%"===e)&&(e="_");r[t]=e}r=r.join("");""===r&&(r="Bad_Font_Name");t.add(stringToBytes(r))}return this.compileIndex(t)}compileTopDicts(e,t,a){const r=[];let i=new CFFIndex;for(const n of e){if(a){n.removeByName("CIDFontVersion");n.removeByName("CIDFontRevision");n.removeByName("CIDFontType");n.removeByName("CIDCount");n.removeByName("UIDBase")}const e=new CFFOffsetTracker,s=this.compileDict(n,e);r.push(e);i.add(s);e.offset(t)}i=this.compileIndex(i,r);return{trackers:r,output:i}}compilePrivateDicts(e,t,a){for(let r=0,i=e.length;r<i;++r){const i=e[r],n=i.privateDict;if(!n||!i.hasName("Private"))throw new FormatError("There must be a private dictionary.");const s=new CFFOffsetTracker,o=this.compileDict(n,s);let c=a.length;s.offset(c);o.length||(c=0);t[r].setEntryLocation("Private",[o.length,c],a);a.add(o);if(n.subrsIndex&&n.hasName("Subrs")){const e=this.compileIndex(n.subrsIndex);s.setEntryLocation("Subrs",[o.length],a);a.add(e)}}}compileDict(e,t){const a=[];for(const r of e.order){if(!(r in e.values))continue;let i=e.values[r],n=e.types[r];Array.isArray(n)||(n=[n]);Array.isArray(i)||(i=[i]);if(0!==i.length){for(let s=0,o=n.length;s<o;++s){const o=n[s],c=i[s];switch(o){case"num":case"sid":a.push(...this.encodeNumber(c));break;case"offset":const n=e.keyToNameMap[r];t.isTracking(n)||t.track(n,a.length);a.push(29,0,0,0,0);break;case"array":case"delta":a.push(...this.encodeNumber(c));for(let e=1,t=i.length;e<t;++e)a.push(...this.encodeNumber(i[e]));break;default:throw new FormatError(`Unknown data type of ${o}`)}}a.push(...e.opcodes[r])}}return a}compileStringIndex(e){const t=new CFFIndex;for(const a of e)t.add(stringToBytes(a));return this.compileIndex(t)}compileCharStrings(e){const t=new CFFIndex;for(let a=0;a<e.count;a++){const r=e.get(a);0!==r.length?t.add(r):t.add(new Uint8Array([139,14]))}return this.compileIndex(t)}compileCharset(e,t,a,r){let i;const n=t-1;if(r){const e=n-1;i=new Uint8Array([2,0,1,e>>8&255,255&e])}else{i=new Uint8Array(1+2*n);i[0]=0;let t=0;const r=e.charset.length;let s=!1;for(let n=1;n<i.length;n+=2){let o=0;if(t<r){const r=e.charset[t++];o=a.getSID(r);if(-1===o){o=0;if(!s){s=!0;warn(`Couldn\'t find ${r} in CFF strings`)}}}i[n]=o>>8&255;i[n+1]=255&o}}return this.compileTypedArray(i)}compileEncoding(e){return this.compileTypedArray(e.raw)}compileFDSelect(e){const t=e.format;let a,r;switch(t){case 0:a=new Uint8Array(1+e.fdSelect.length);a[0]=t;for(r=0;r<e.fdSelect.length;r++)a[r+1]=e.fdSelect[r];break;case 3:const i=0;let n=e.fdSelect[0];const s=[t,0,0,i>>8&255,255&i,n];for(r=1;r<e.fdSelect.length;r++){const t=e.fdSelect[r];if(t!==n){s.push(r>>8&255,255&r,t);n=t}}const o=(s.length-3)/3;s[1]=o>>8&255;s[2]=255&o;s.push(r>>8&255,255&r);a=new Uint8Array(s)}return this.compileTypedArray(a)}compileTypedArray(e){return Array.from(e)}compileIndex(e,t=[]){const a=e.objects,r=a.length;if(0===r)return[0,0];const i=[r>>8&255,255&r];let n,s,o=1;for(n=0;n<r;++n)o+=a[n].length;s=o<256?1:o<65536?2:o<16777216?3:4;i.push(s);let c=1;for(n=0;n<r+1;n++){1===s?i.push(255&c):2===s?i.push(c>>8&255,255&c):3===s?i.push(c>>16&255,c>>8&255,255&c):i.push(c>>>24&255,c>>16&255,c>>8&255,255&c);a[n]&&(c+=a[n].length)}for(n=0;n<r;n++){t[n]&&t[n].offset(i.length);i.push(...a[n])}return i}}const Jr=getLookupTableFactory((function(e){e["Times-Roman"]="Times-Roman";e.Helvetica="Helvetica";e.Courier="Courier";e.Symbol="Symbol";e["Times-Bold"]="Times-Bold";e["Helvetica-Bold"]="Helvetica-Bold";e["Courier-Bold"]="Courier-Bold";e.ZapfDingbats="ZapfDingbats";e["Times-Italic"]="Times-Italic";e["Helvetica-Oblique"]="Helvetica-Oblique";e["Courier-Oblique"]="Courier-Oblique";e["Times-BoldItalic"]="Times-BoldItalic";e["Helvetica-BoldOblique"]="Helvetica-BoldOblique";e["Courier-BoldOblique"]="Courier-BoldOblique";e.ArialNarrow="Helvetica";e["ArialNarrow-Bold"]="Helvetica-Bold";e["ArialNarrow-BoldItalic"]="Helvetica-BoldOblique";e["ArialNarrow-Italic"]="Helvetica-Oblique";e.ArialBlack="Helvetica";e["ArialBlack-Bold"]="Helvetica-Bold";e["ArialBlack-BoldItalic"]="Helvetica-BoldOblique";e["ArialBlack-Italic"]="Helvetica-Oblique";e["Arial-Black"]="Helvetica";e["Arial-Black-Bold"]="Helvetica-Bold";e["Arial-Black-BoldItalic"]="Helvetica-BoldOblique";e["Arial-Black-Italic"]="Helvetica-Oblique";e.Arial="Helvetica";e["Arial-Bold"]="Helvetica-Bold";e["Arial-BoldItalic"]="Helvetica-BoldOblique";e["Arial-Italic"]="Helvetica-Oblique";e.ArialMT="Helvetica";e["Arial-BoldItalicMT"]="Helvetica-BoldOblique";e["Arial-BoldMT"]="Helvetica-Bold";e["Arial-ItalicMT"]="Helvetica-Oblique";e["Arial-BoldItalicMT-BoldItalic"]="Helvetica-BoldOblique";e["Arial-BoldMT-Bold"]="Helvetica-Bold";e["Arial-ItalicMT-Italic"]="Helvetica-Oblique";e.ArialUnicodeMS="Helvetica";e["ArialUnicodeMS-Bold"]="Helvetica-Bold";e["ArialUnicodeMS-BoldItalic"]="Helvetica-BoldOblique";e["ArialUnicodeMS-Italic"]="Helvetica-Oblique";e["Courier-BoldItalic"]="Courier-BoldOblique";e["Courier-Italic"]="Courier-Oblique";e.CourierNew="Courier";e["CourierNew-Bold"]="Courier-Bold";e["CourierNew-BoldItalic"]="Courier-BoldOblique";e["CourierNew-Italic"]="Courier-Oblique";e["CourierNewPS-BoldItalicMT"]="Courier-BoldOblique";e["CourierNewPS-BoldMT"]="Courier-Bold";e["CourierNewPS-ItalicMT"]="Courier-Oblique";e.CourierNewPSMT="Courier";e["Helvetica-BoldItalic"]="Helvetica-BoldOblique";e["Helvetica-Italic"]="Helvetica-Oblique";e["HelveticaLTStd-Bold"]="Helvetica-Bold";e["Symbol-Bold"]="Symbol";e["Symbol-BoldItalic"]="Symbol";e["Symbol-Italic"]="Symbol";e.TimesNewRoman="Times-Roman";e["TimesNewRoman-Bold"]="Times-Bold";e["TimesNewRoman-BoldItalic"]="Times-BoldItalic";e["TimesNewRoman-Italic"]="Times-Italic";e.TimesNewRomanPS="Times-Roman";e["TimesNewRomanPS-Bold"]="Times-Bold";e["TimesNewRomanPS-BoldItalic"]="Times-BoldItalic";e["TimesNewRomanPS-BoldItalicMT"]="Times-BoldItalic";e["TimesNewRomanPS-BoldMT"]="Times-Bold";e["TimesNewRomanPS-Italic"]="Times-Italic";e["TimesNewRomanPS-ItalicMT"]="Times-Italic";e.TimesNewRomanPSMT="Times-Roman";e["TimesNewRomanPSMT-Bold"]="Times-Bold";e["TimesNewRomanPSMT-BoldItalic"]="Times-BoldItalic";e["TimesNewRomanPSMT-Italic"]="Times-Italic"})),Yr=getLookupTableFactory((function(e){e.Courier="FoxitFixed.pfb";e["Courier-Bold"]="FoxitFixedBold.pfb";e["Courier-BoldOblique"]="FoxitFixedBoldItalic.pfb";e["Courier-Oblique"]="FoxitFixedItalic.pfb";e.Helvetica="LiberationSans-Regular.ttf";e["Helvetica-Bold"]="LiberationSans-Bold.ttf";e["Helvetica-BoldOblique"]="LiberationSans-BoldItalic.ttf";e["Helvetica-Oblique"]="LiberationSans-Italic.ttf";e["Times-Roman"]="FoxitSerif.pfb";e["Times-Bold"]="FoxitSerifBold.pfb";e["Times-BoldItalic"]="FoxitSerifBoldItalic.pfb";e["Times-Italic"]="FoxitSerifItalic.pfb";e.Symbol="FoxitSymbol.pfb";e.ZapfDingbats="FoxitDingbats.pfb";e["LiberationSans-Regular"]="LiberationSans-Regular.ttf";e["LiberationSans-Bold"]="LiberationSans-Bold.ttf";e["LiberationSans-Italic"]="LiberationSans-Italic.ttf";e["LiberationSans-BoldItalic"]="LiberationSans-BoldItalic.ttf"})),Zr=getLookupTableFactory((function(e){e.Calibri="Helvetica";e["Calibri-Bold"]="Helvetica-Bold";e["Calibri-BoldItalic"]="Helvetica-BoldOblique";e["Calibri-Italic"]="Helvetica-Oblique";e.CenturyGothic="Helvetica";e["CenturyGothic-Bold"]="Helvetica-Bold";e["CenturyGothic-BoldItalic"]="Helvetica-BoldOblique";e["CenturyGothic-Italic"]="Helvetica-Oblique";e.ComicSansMS="Comic Sans MS";e["ComicSansMS-Bold"]="Comic Sans MS-Bold";e["ComicSansMS-BoldItalic"]="Comic Sans MS-BoldItalic";e["ComicSansMS-Italic"]="Comic Sans MS-Italic";e.GillSansMT="Helvetica";e["GillSansMT-Bold"]="Helvetica-Bold";e["GillSansMT-BoldItalic"]="Helvetica-BoldOblique";e["GillSansMT-Italic"]="Helvetica-Oblique";e.Impact="Helvetica";e["ItcSymbol-Bold"]="Helvetica-Bold";e["ItcSymbol-BoldItalic"]="Helvetica-BoldOblique";e["ItcSymbol-Book"]="Helvetica";e["ItcSymbol-BookItalic"]="Helvetica-Oblique";e["ItcSymbol-Medium"]="Helvetica";e["ItcSymbol-MediumItalic"]="Helvetica-Oblique";e.LucidaConsole="Courier";e["LucidaConsole-Bold"]="Courier-Bold";e["LucidaConsole-BoldItalic"]="Courier-BoldOblique";e["LucidaConsole-Italic"]="Courier-Oblique";e["LucidaSans-Demi"]="Helvetica-Bold";e["MS-Gothic"]="MS Gothic";e["MS-Gothic-Bold"]="MS Gothic-Bold";e["MS-Gothic-BoldItalic"]="MS Gothic-BoldItalic";e["MS-Gothic-Italic"]="MS Gothic-Italic";e["MS-Mincho"]="MS Mincho";e["MS-Mincho-Bold"]="MS Mincho-Bold";e["MS-Mincho-BoldItalic"]="MS Mincho-BoldItalic";e["MS-Mincho-Italic"]="MS Mincho-Italic";e["MS-PGothic"]="MS PGothic";e["MS-PGothic-Bold"]="MS PGothic-Bold";e["MS-PGothic-BoldItalic"]="MS PGothic-BoldItalic";e["MS-PGothic-Italic"]="MS PGothic-Italic";e["MS-PMincho"]="MS PMincho";e["MS-PMincho-Bold"]="MS PMincho-Bold";e["MS-PMincho-BoldItalic"]="MS PMincho-BoldItalic";e["MS-PMincho-Italic"]="MS PMincho-Italic";e.NuptialScript="Times-Italic";e.SegoeUISymbol="Helvetica"})),Qr=getLookupTableFactory((function(e){e["Adobe Jenson"]=!0;e["Adobe Text"]=!0;e.Albertus=!0;e.Aldus=!0;e.Alexandria=!0;e.Algerian=!0;e["American Typewriter"]=!0;e.Antiqua=!0;e.Apex=!0;e.Arno=!0;e.Aster=!0;e.Aurora=!0;e.Baskerville=!0;e.Bell=!0;e.Bembo=!0;e["Bembo Schoolbook"]=!0;e.Benguiat=!0;e["Berkeley Old Style"]=!0;e["Bernhard Modern"]=!0;e["Berthold City"]=!0;e.Bodoni=!0;e["Bauer Bodoni"]=!0;e["Book Antiqua"]=!0;e.Bookman=!0;e["Bordeaux Roman"]=!0;e["Californian FB"]=!0;e.Calisto=!0;e.Calvert=!0;e.Capitals=!0;e.Cambria=!0;e.Cartier=!0;e.Caslon=!0;e.Catull=!0;e.Centaur=!0;e["Century Old Style"]=!0;e["Century Schoolbook"]=!0;e.Chaparral=!0;e["Charis SIL"]=!0;e.Cheltenham=!0;e["Cholla Slab"]=!0;e.Clarendon=!0;e.Clearface=!0;e.Cochin=!0;e.Colonna=!0;e["Computer Modern"]=!0;e["Concrete Roman"]=!0;e.Constantia=!0;e["Cooper Black"]=!0;e.Corona=!0;e.Ecotype=!0;e.Egyptienne=!0;e.Elephant=!0;e.Excelsior=!0;e.Fairfield=!0;e["FF Scala"]=!0;e.Folkard=!0;e.Footlight=!0;e.FreeSerif=!0;e["Friz Quadrata"]=!0;e.Garamond=!0;e.Gentium=!0;e.Georgia=!0;e.Gloucester=!0;e["Goudy Old Style"]=!0;e["Goudy Schoolbook"]=!0;e["Goudy Pro Font"]=!0;e.Granjon=!0;e["Guardian Egyptian"]=!0;e.Heather=!0;e.Hercules=!0;e["High Tower Text"]=!0;e.Hiroshige=!0;e["Hoefler Text"]=!0;e["Humana Serif"]=!0;e.Imprint=!0;e["Ionic No. 5"]=!0;e.Janson=!0;e.Joanna=!0;e.Korinna=!0;e.Lexicon=!0;e.LiberationSerif=!0;e["Liberation Serif"]=!0;e["Linux Libertine"]=!0;e.Literaturnaya=!0;e.Lucida=!0;e["Lucida Bright"]=!0;e.Melior=!0;e.Memphis=!0;e.Miller=!0;e.Minion=!0;e.Modern=!0;e["Mona Lisa"]=!0;e["Mrs Eaves"]=!0;e["MS Serif"]=!0;e["Museo Slab"]=!0;e["New York"]=!0;e["Nimbus Roman"]=!0;e["NPS Rawlinson Roadway"]=!0;e.NuptialScript=!0;e.Palatino=!0;e.Perpetua=!0;e.Plantin=!0;e["Plantin Schoolbook"]=!0;e.Playbill=!0;e["Poor Richard"]=!0;e["Rawlinson Roadway"]=!0;e.Renault=!0;e.Requiem=!0;e.Rockwell=!0;e.Roman=!0;e["Rotis Serif"]=!0;e.Sabon=!0;e.Scala=!0;e.Seagull=!0;e.Sistina=!0;e.Souvenir=!0;e.STIX=!0;e["Stone Informal"]=!0;e["Stone Serif"]=!0;e.Sylfaen=!0;e.Times=!0;e.Trajan=!0;e["Trinité"]=!0;e["Trump Mediaeval"]=!0;e.Utopia=!0;e["Vale Type"]=!0;e["Bitstream Vera"]=!0;e["Vera Serif"]=!0;e.Versailles=!0;e.Wanted=!0;e.Weiss=!0;e["Wide Latin"]=!0;e.Windsor=!0;e.XITS=!0})),ei=getLookupTableFactory((function(e){e.Dingbats=!0;e.Symbol=!0;e.ZapfDingbats=!0;e.Wingdings=!0;e["Wingdings-Bold"]=!0;e["Wingdings-Regular"]=!0})),ti=getLookupTableFactory((function(e){e[2]=10;e[3]=32;e[4]=33;e[5]=34;e[6]=35;e[7]=36;e[8]=37;e[9]=38;e[10]=39;e[11]=40;e[12]=41;e[13]=42;e[14]=43;e[15]=44;e[16]=45;e[17]=46;e[18]=47;e[19]=48;e[20]=49;e[21]=50;e[22]=51;e[23]=52;e[24]=53;e[25]=54;e[26]=55;e[27]=56;e[28]=57;e[29]=58;e[30]=894;e[31]=60;e[32]=61;e[33]=62;e[34]=63;e[35]=64;e[36]=65;e[37]=66;e[38]=67;e[39]=68;e[40]=69;e[41]=70;e[42]=71;e[43]=72;e[44]=73;e[45]=74;e[46]=75;e[47]=76;e[48]=77;e[49]=78;e[50]=79;e[51]=80;e[52]=81;e[53]=82;e[54]=83;e[55]=84;e[56]=85;e[57]=86;e[58]=87;e[59]=88;e[60]=89;e[61]=90;e[62]=91;e[63]=92;e[64]=93;e[65]=94;e[66]=95;e[67]=96;e[68]=97;e[69]=98;e[70]=99;e[71]=100;e[72]=101;e[73]=102;e[74]=103;e[75]=104;e[76]=105;e[77]=106;e[78]=107;e[79]=108;e[80]=109;e[81]=110;e[82]=111;e[83]=112;e[84]=113;e[85]=114;e[86]=115;e[87]=116;e[88]=117;e[89]=118;e[90]=119;e[91]=120;e[92]=121;e[93]=122;e[94]=123;e[95]=124;e[96]=125;e[97]=126;e[98]=196;e[99]=197;e[100]=199;e[101]=201;e[102]=209;e[103]=214;e[104]=220;e[105]=225;e[106]=224;e[107]=226;e[108]=228;e[109]=227;e[110]=229;e[111]=231;e[112]=233;e[113]=232;e[114]=234;e[115]=235;e[116]=237;e[117]=236;e[118]=238;e[119]=239;e[120]=241;e[121]=243;e[122]=242;e[123]=244;e[124]=246;e[125]=245;e[126]=250;e[127]=249;e[128]=251;e[129]=252;e[130]=8224;e[131]=176;e[132]=162;e[133]=163;e[134]=167;e[135]=8226;e[136]=182;e[137]=223;e[138]=174;e[139]=169;e[140]=8482;e[141]=180;e[142]=168;e[143]=8800;e[144]=198;e[145]=216;e[146]=8734;e[147]=177;e[148]=8804;e[149]=8805;e[150]=165;e[151]=181;e[152]=8706;e[153]=8721;e[154]=8719;e[156]=8747;e[157]=170;e[158]=186;e[159]=8486;e[160]=230;e[161]=248;e[162]=191;e[163]=161;e[164]=172;e[165]=8730;e[166]=402;e[167]=8776;e[168]=8710;e[169]=171;e[170]=187;e[171]=8230;e[179]=8220;e[180]=8221;e[181]=8216;e[182]=8217;e[200]=193;e[203]=205;e[207]=211;e[210]=218;e[223]=711;e[224]=321;e[225]=322;e[226]=352;e[227]=353;e[228]=381;e[229]=382;e[233]=221;e[234]=253;e[252]=263;e[253]=268;e[254]=269;e[258]=258;e[260]=260;e[261]=261;e[265]=280;e[266]=281;e[267]=282;e[268]=283;e[269]=313;e[275]=323;e[276]=324;e[278]=328;e[283]=344;e[284]=345;e[285]=346;e[286]=347;e[292]=367;e[295]=377;e[296]=378;e[298]=380;e[305]=963;e[306]=964;e[307]=966;e[308]=8215;e[309]=8252;e[310]=8319;e[311]=8359;e[312]=8592;e[313]=8593;e[337]=9552;e[493]=1039;e[494]=1040;e[570]=1040;e[571]=1041;e[572]=1042;e[573]=1043;e[574]=1044;e[575]=1045;e[576]=1046;e[577]=1047;e[578]=1048;e[579]=1049;e[580]=1050;e[581]=1051;e[582]=1052;e[583]=1053;e[584]=1054;e[585]=1055;e[586]=1056;e[587]=1057;e[588]=1058;e[589]=1059;e[590]=1060;e[591]=1061;e[592]=1062;e[593]=1063;e[594]=1064;e[595]=1065;e[596]=1066;e[597]=1067;e[598]=1068;e[599]=1069;e[600]=1070;e[672]=1488;e[673]=1489;e[674]=1490;e[675]=1491;e[676]=1492;e[677]=1493;e[678]=1494;e[679]=1495;e[680]=1496;e[681]=1497;e[682]=1498;e[683]=1499;e[684]=1500;e[685]=1501;e[686]=1502;e[687]=1503;e[688]=1504;e[689]=1505;e[690]=1506;e[691]=1507;e[692]=1508;e[693]=1509;e[694]=1510;e[695]=1511;e[696]=1512;e[697]=1513;e[698]=1514;e[705]=1524;e[706]=8362;e[710]=64288;e[711]=64298;e[759]=1617;e[761]=1776;e[763]=1778;e[775]=1652;e[777]=1764;e[778]=1780;e[779]=1781;e[780]=1782;e[782]=771;e[783]=64726;e[786]=8363;e[788]=8532;e[790]=768;e[791]=769;e[792]=768;e[795]=803;e[797]=64336;e[798]=64337;e[799]=64342;e[800]=64343;e[801]=64344;e[802]=64345;e[803]=64362;e[804]=64363;e[805]=64364;e[2424]=7821;e[2425]=7822;e[2426]=7823;e[2427]=7824;e[2428]=7825;e[2429]=7826;e[2430]=7827;e[2433]=7682;e[2678]=8045;e[2679]=8046;e[2830]=1552;e[2838]=686;e[2840]=751;e[2842]=753;e[2843]=754;e[2844]=755;e[2846]=757;e[2856]=767;e[2857]=848;e[2858]=849;e[2862]=853;e[2863]=854;e[2864]=855;e[2865]=861;e[2866]=862;e[2906]=7460;e[2908]=7462;e[2909]=7463;e[2910]=7464;e[2912]=7466;e[2913]=7467;e[2914]=7468;e[2916]=7470;e[2917]=7471;e[2918]=7472;e[2920]=7474;e[2921]=7475;e[2922]=7476;e[2924]=7478;e[2925]=7479;e[2926]=7480;e[2928]=7482;e[2929]=7483;e[2930]=7484;e[2932]=7486;e[2933]=7487;e[2934]=7488;e[2936]=7490;e[2937]=7491;e[2938]=7492;e[2940]=7494;e[2941]=7495;e[2942]=7496;e[2944]=7498;e[2946]=7500;e[2948]=7502;e[2950]=7504;e[2951]=7505;e[2952]=7506;e[2954]=7508;e[2955]=7509;e[2956]=7510;e[2958]=7512;e[2959]=7513;e[2960]=7514;e[2962]=7516;e[2963]=7517;e[2964]=7518;e[2966]=7520;e[2967]=7521;e[2968]=7522;e[2970]=7524;e[2971]=7525;e[2972]=7526;e[2974]=7528;e[2975]=7529;e[2976]=7530;e[2978]=1537;e[2979]=1538;e[2980]=1539;e[2982]=1549;e[2983]=1551;e[2984]=1552;e[2986]=1554;e[2987]=1555;e[2988]=1556;e[2990]=1623;e[2991]=1624;e[2995]=1775;e[2999]=1791;e[3002]=64290;e[3003]=64291;e[3004]=64292;e[3006]=64294;e[3007]=64295;e[3008]=64296;e[3011]=1900;e[3014]=8223;e[3015]=8244;e[3017]=7532;e[3018]=7533;e[3019]=7534;e[3075]=7590;e[3076]=7591;e[3079]=7594;e[3080]=7595;e[3083]=7598;e[3084]=7599;e[3087]=7602;e[3088]=7603;e[3091]=7606;e[3092]=7607;e[3095]=7610;e[3096]=7611;e[3099]=7614;e[3100]=7615;e[3103]=7618;e[3104]=7619;e[3107]=8337;e[3108]=8338;e[3116]=1884;e[3119]=1885;e[3120]=1885;e[3123]=1886;e[3124]=1886;e[3127]=1887;e[3128]=1887;e[3131]=1888;e[3132]=1888;e[3135]=1889;e[3136]=1889;e[3139]=1890;e[3140]=1890;e[3143]=1891;e[3144]=1891;e[3147]=1892;e[3148]=1892;e[3153]=580;e[3154]=581;e[3157]=584;e[3158]=585;e[3161]=588;e[3162]=589;e[3165]=891;e[3166]=892;e[3169]=1274;e[3170]=1275;e[3173]=1278;e[3174]=1279;e[3181]=7622;e[3182]=7623;e[3282]=11799;e[3316]=578;e[3379]=42785;e[3393]=1159;e[3416]=8377})),ai=getLookupTableFactory((function(e){e[227]=322;e[264]=261;e[291]=346})),ri=getLookupTableFactory((function(e){e[1]=32;e[4]=65;e[5]=192;e[6]=193;e[9]=196;e[17]=66;e[18]=67;e[21]=268;e[24]=68;e[28]=69;e[29]=200;e[30]=201;e[32]=282;e[38]=70;e[39]=71;e[44]=72;e[47]=73;e[48]=204;e[49]=205;e[58]=74;e[60]=75;e[62]=76;e[68]=77;e[69]=78;e[75]=79;e[76]=210;e[80]=214;e[87]=80;e[89]=81;e[90]=82;e[92]=344;e[94]=83;e[97]=352;e[100]=84;e[104]=85;e[109]=220;e[115]=86;e[116]=87;e[121]=88;e[122]=89;e[124]=221;e[127]=90;e[129]=381;e[258]=97;e[259]=224;e[260]=225;e[263]=228;e[268]=261;e[271]=98;e[272]=99;e[273]=263;e[275]=269;e[282]=100;e[286]=101;e[287]=232;e[288]=233;e[290]=283;e[295]=281;e[296]=102;e[336]=103;e[346]=104;e[349]=105;e[350]=236;e[351]=237;e[361]=106;e[364]=107;e[367]=108;e[371]=322;e[373]=109;e[374]=110;e[381]=111;e[382]=242;e[383]=243;e[386]=246;e[393]=112;e[395]=113;e[396]=114;e[398]=345;e[400]=115;e[401]=347;e[403]=353;e[410]=116;e[437]=117;e[442]=252;e[448]=118;e[449]=119;e[454]=120;e[455]=121;e[457]=253;e[460]=122;e[462]=382;e[463]=380;e[853]=44;e[855]=58;e[856]=46;e[876]=47;e[878]=45;e[882]=45;e[894]=40;e[895]=41;e[896]=91;e[897]=93;e[923]=64;e[940]=163;e[1004]=48;e[1005]=49;e[1006]=50;e[1007]=51;e[1008]=52;e[1009]=53;e[1010]=54;e[1011]=55;e[1012]=56;e[1013]=57;e[1081]=37;e[1085]=43;e[1086]=45}));function getStandardFontName(e){const t=normalizeFontName(e);return Jr()[t]}function isKnownFontName(e){const t=normalizeFontName(e);return!!(Jr()[t]||Zr()[t]||Qr()[t]||ei()[t])}class ToUnicodeMap{constructor(e=[]){this._map=e}get length(){return this._map.length}forEach(e){for(const t in this._map)e(t,this._map[t].codePointAt(0))}has(e){return void 0!==this._map[e]}get(e){return this._map[e]}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const a in t)if(t[a]===e)return 0|a;return-1}amend(e){for(const t in e)this._map[t]=e[t]}}class IdentityToUnicodeMap{constructor(e,t){this.firstChar=e;this.lastChar=t}get length(){return this.lastChar+1-this.firstChar}forEach(e){for(let t=this.firstChar,a=this.lastChar;t<=a;t++)e(t,t)}has(e){return this.firstChar<=e&&e<=this.lastChar}get(e){if(this.firstChar<=e&&e<=this.lastChar)return String.fromCharCode(e)}charCodeOf(e){return Number.isInteger(e)&&e>=this.firstChar&&e<=this.lastChar?e:-1}amend(e){unreachable("Should not call amend()")}}class CFFFont{constructor(e,t){this.properties=t;const a=new CFFParser(e,t,Rr);this.cff=a.parse();this.cff.duplicateFirstGlyph();const r=new CFFCompiler(this.cff);this.seacs=this.cff.seacs;try{this.data=r.compile()}catch{warn("Failed to compile font "+t.loadedName);this.data=e}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){const e=this.cff,t=this.properties,{cidToGidMap:a,cMap:r}=t,i=e.charset.charset;let n,s;if(t.composite){let t,o;if(a?.length>0){t=Object.create(null);for(let e=0,r=a.length;e<r;e++){const r=a[e];void 0!==r&&(t[r]=e)}}n=Object.create(null);if(e.isCIDFont)for(s=0;s<i.length;s++){const e=i[s];o=r.charCodeOf(e);void 0!==t?.[o]&&(o=t[o]);n[o]=s}else for(s=0;s<e.charStrings.count;s++){o=r.charCodeOf(s);n[o]=s}return n}let o=e.encoding?e.encoding.encoding:null;t.isInternalFont&&(o=t.defaultEncoding);n=type1FontGlyphMapping(t,o,i);return n}hasGlyphId(e){return this.cff.hasGlyphId(e)}_createBuiltInEncoding(){const{charset:e,encoding:t}=this.cff;if(!e||!t)return;const a=e.charset,r=t.encoding,i=[];for(const e in r){const t=r[e];if(t>=0){const r=a[t];r&&(i[e]=r)}}i.length>0&&(this.properties.builtInEncoding=i)}}function getFloat214(e,t){return readInt16(e,t)/16384}function getSubroutineBias(e){const t=e.length;let a=32768;t<1240?a=107:t<33900&&(a=1131);return a}function parseCmap(e,t,a){const r=1===readUint16(e,t+2)?readUint32(e,t+8):readUint32(e,t+16),i=readUint16(e,t+r);let n,s,o;if(4===i){readUint16(e,t+r+2);const a=readUint16(e,t+r+6)>>1;s=t+r+14;n=[];for(o=0;o<a;o++,s+=2)n[o]={end:readUint16(e,s)};s+=2;for(o=0;o<a;o++,s+=2)n[o].start=readUint16(e,s);for(o=0;o<a;o++,s+=2)n[o].idDelta=readUint16(e,s);for(o=0;o<a;o++,s+=2){let t=readUint16(e,s);if(0!==t){n[o].ids=[];for(let a=0,r=n[o].end-n[o].start+1;a<r;a++){n[o].ids[a]=readUint16(e,s+t);t+=2}}}return n}if(12===i){const a=readUint32(e,t+r+12);s=t+r+16;n=[];for(o=0;o<a;o++){t=readUint32(e,s);n.push({start:t,end:readUint32(e,s+4),idDelta:readUint32(e,s+8)-t});s+=12}return n}throw new FormatError(`unsupported cmap: ${i}`)}function parseCff(e,t,a,r){const i=new CFFParser(new Stream(e,t,a-t),{},r).parse();return{glyphs:i.charStrings.objects,subrs:i.topDict.privateDict?.subrsIndex?.objects,gsubrs:i.globalSubrIndex?.objects,isCFFCIDFont:i.isCIDFont,fdSelect:i.fdSelect,fdArray:i.fdArray}}function lookupCmap(e,t){const a=t.codePointAt(0);let r=0,i=0,n=e.length-1;for(;i<n;){const t=i+n+1>>1;a<e[t].start?n=t-1:i=t}e[i].start<=a&&a<=e[i].end&&(r=e[i].idDelta+(e[i].ids?e[i].ids[a-e[i].start]:a)&65535);return{charCode:a,glyphId:r}}function compileGlyf(e,t,a){function moveTo(e,a){s&&t.add("L",s);s=[e,a];t.add("M",[e,a])}function lineTo(e,a){t.add("L",[e,a])}function quadraticCurveTo(e,a,r,i){t.add("Q",[e,a,r,i])}let r=0;const i=readInt16(e,r);let n,s=null,o=0,c=0;r+=10;if(i<0)do{n=readUint16(e,r);const i=readUint16(e,r+2);r+=4;let s,l;if(1&n){if(2&n){s=readInt16(e,r);l=readInt16(e,r+2)}else{s=readUint16(e,r);l=readUint16(e,r+2)}r+=4}else if(2&n){s=readInt8(e,r++);l=readInt8(e,r++)}else{s=e[r++];l=e[r++]}if(2&n){o=s;c=l}else{o=0;c=0}let h=1,u=1,d=0,f=0;if(8&n){h=u=getFloat214(e,r);r+=2}else if(64&n){h=getFloat214(e,r);u=getFloat214(e,r+2);r+=4}else if(128&n){h=getFloat214(e,r);d=getFloat214(e,r+2);f=getFloat214(e,r+4);u=getFloat214(e,r+6);r+=8}const g=a.glyphs[i];if(g){t.save();t.transform([h,d,f,u,o,c]);compileGlyf(g,t,a);t.restore()}}while(32&n);else{const t=[];let a,s;for(a=0;a<i;a++){t.push(readUint16(e,r));r+=2}r+=2+readUint16(e,r);const l=t.at(-1)+1,h=[];for(;h.length<l;){n=e[r++];let t=1;8&n&&(t+=e[r++]);for(;t-- >0;)h.push({flags:n})}for(a=0;a<l;a++){switch(18&h[a].flags){case 0:o+=readInt16(e,r);r+=2;break;case 2:o-=e[r++];break;case 18:o+=e[r++]}h[a].x=o}for(a=0;a<l;a++){switch(36&h[a].flags){case 0:c+=readInt16(e,r);r+=2;break;case 4:c-=e[r++];break;case 36:c+=e[r++]}h[a].y=c}let u=0;for(r=0;r<i;r++){const e=t[r],i=h.slice(u,e+1);if(1&i[0].flags)i.push(i[0]);else if(1&i.at(-1).flags)i.unshift(i.at(-1));else{const e={flags:1,x:(i[0].x+i.at(-1).x)/2,y:(i[0].y+i.at(-1).y)/2};i.unshift(e);i.push(e)}moveTo(i[0].x,i[0].y);for(a=1,s=i.length;a<s;a++)if(1&i[a].flags)lineTo(i[a].x,i[a].y);else if(1&i[a+1].flags){quadraticCurveTo(i[a].x,i[a].y,i[a+1].x,i[a+1].y);a++}else quadraticCurveTo(i[a].x,i[a].y,(i[a].x+i[a+1].x)/2,(i[a].y+i[a+1].y)/2);u=e+1}}}function compileCharString(e,t,a,r){function moveTo(e,a){c&&t.add("L",c);c=[e,a];t.add("M",[e,a])}function lineTo(e,a){t.add("L",[e,a])}function bezierCurveTo(e,a,r,i,n,s){t.add("C",[e,a,r,i,n,s])}const i=[];let n=0,s=0,o=0,c=null;!function parse(e){let c=0;for(;c<e.length;){let l,h,u,d,f,g,p,m,b,y=!1,w=e[c++];switch(w){case 1:case 3:case 18:case 23:o+=i.length>>1;y=!0;break;case 4:s+=i.pop();moveTo(n,s);y=!0;break;case 5:for(;i.length>0;){n+=i.shift();s+=i.shift();lineTo(n,s)}break;case 6:for(;i.length>0;){n+=i.shift();lineTo(n,s);if(0===i.length)break;s+=i.shift();lineTo(n,s)}break;case 7:for(;i.length>0;){s+=i.shift();lineTo(n,s);if(0===i.length)break;n+=i.shift();lineTo(n,s)}break;case 8:for(;i.length>0;){l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s)}break;case 10:m=i.pop();b=null;if(a.isCFFCIDFont){const e=a.fdSelect.getFDIndex(r);if(e>=0&&e<a.fdArray.length){const t=a.fdArray[e];let r;t.privateDict?.subrsIndex&&(r=t.privateDict.subrsIndex.objects);if(r){m+=getSubroutineBias(r);b=r[m]}}else warn("Invalid fd index for glyph index.")}else b=a.subrs[m+a.subrsBias];b&&parse(b);break;case 11:return;case 12:w=e[c++];switch(w){case 34:l=n+i.shift();h=l+i.shift();f=s+i.shift();n=h+i.shift();bezierCurveTo(l,s,h,f,n,f);l=n+i.shift();h=l+i.shift();n=h+i.shift();bezierCurveTo(l,f,h,s,n,s);break;case 35:l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s);l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s);i.pop();break;case 36:l=n+i.shift();f=s+i.shift();h=l+i.shift();g=f+i.shift();n=h+i.shift();bezierCurveTo(l,f,h,g,n,g);l=n+i.shift();h=l+i.shift();p=g+i.shift();n=h+i.shift();bezierCurveTo(l,g,h,p,n,s);break;case 37:const e=n,t=s;l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s);l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h;s=d;Math.abs(n-e)>Math.abs(s-t)?n+=i.shift():s+=i.shift();bezierCurveTo(l,u,h,d,n,s);break;default:throw new FormatError(`unknown operator: 12 ${w}`)}break;case 14:if(i.length>=4){const e=i.pop(),r=i.pop();s=i.pop();n=i.pop();t.save();t.translate(n,s);let o=lookupCmap(a.cmap,String.fromCharCode(a.glyphNameMap[Ar[e]]));compileCharString(a.glyphs[o.glyphId],t,a,o.glyphId);t.restore();o=lookupCmap(a.cmap,String.fromCharCode(a.glyphNameMap[Ar[r]]));compileCharString(a.glyphs[o.glyphId],t,a,o.glyphId)}return;case 19:case 20:o+=i.length>>1;c+=o+7>>3;y=!0;break;case 21:s+=i.pop();n+=i.pop();moveTo(n,s);y=!0;break;case 22:n+=i.pop();moveTo(n,s);y=!0;break;case 24:for(;i.length>2;){l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s)}n+=i.shift();s+=i.shift();lineTo(n,s);break;case 25:for(;i.length>6;){n+=i.shift();s+=i.shift();lineTo(n,s)}l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s);break;case 26:i.length%2&&(n+=i.shift());for(;i.length>0;){l=n;u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h;s=d+i.shift();bezierCurveTo(l,u,h,d,n,s)}break;case 27:i.length%2&&(s+=i.shift());for(;i.length>0;){l=n+i.shift();u=s;h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d;bezierCurveTo(l,u,h,d,n,s)}break;case 28:i.push(readInt16(e,c));c+=2;break;case 29:m=i.pop()+a.gsubrsBias;b=a.gsubrs[m];b&&parse(b);break;case 30:for(;i.length>0;){l=n;u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+(1===i.length?i.shift():0);bezierCurveTo(l,u,h,d,n,s);if(0===i.length)break;l=n+i.shift();u=s;h=l+i.shift();d=u+i.shift();s=d+i.shift();n=h+(1===i.length?i.shift():0);bezierCurveTo(l,u,h,d,n,s)}break;case 31:for(;i.length>0;){l=n+i.shift();u=s;h=l+i.shift();d=u+i.shift();s=d+i.shift();n=h+(1===i.length?i.shift():0);bezierCurveTo(l,u,h,d,n,s);if(0===i.length)break;l=n;u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+(1===i.length?i.shift():0);bezierCurveTo(l,u,h,d,n,s)}break;default:if(w<32)throw new FormatError(`unknown operator: ${w}`);if(w<247)i.push(w-139);else if(w<251)i.push(256*(w-247)+e[c++]+108);else if(w<255)i.push(256*-(w-251)-e[c++]-108);else{i.push((e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3])/65536);c+=4}}y&&(i.length=0)}}(e)}class Commands{cmds=[];transformStack=[];currentTransform=[1,0,0,1,0,0];add(e,t){if(t){const{currentTransform:a}=this;for(let e=0,r=t.length;e<r;e+=2)Util.applyTransform(t,a,e);this.cmds.push(`${e}${t.join(" ")}`)}else this.cmds.push(e)}transform(e){this.currentTransform=Util.transform(this.currentTransform,e)}translate(e,t){this.transform([1,0,0,1,e,t])}save(){this.transformStack.push(this.currentTransform.slice())}restore(){this.currentTransform=this.transformStack.pop()||[1,0,0,1,0,0]}getSVG(){return this.cmds.join("")}}class CompiledFont{constructor(e){this.fontMatrix=e;this.compiledGlyphs=Object.create(null);this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(e){const{charCode:t,glyphId:a}=lookupCmap(this.cmap,e);let r,i=this.compiledGlyphs[a];if(void 0===i){try{i=this.compileGlyph(this.glyphs[a],a)}catch(e){i="";r=e}this.compiledGlyphs[a]=i}this.compiledCharCodeToGlyphId[t]??=a;if(r)throw r;return i}compileGlyph(e,a){if(!e?.length||14===e[0])return"";let r=this.fontMatrix;if(this.isCFFCIDFont){const e=this.fdSelect.getFDIndex(a);if(e>=0&&e<this.fdArray.length){r=this.fdArray[e].getByName("FontMatrix")||t}else warn("Invalid fd index for glyph index.")}assert(isNumberArray(r,6),"Expected a valid fontMatrix.");const i=new Commands;i.transform(r.slice());this.compileGlyphImpl(e,i,a);i.add("Z");return i.getSVG()}compileGlyphImpl(){unreachable("Children classes should implement this.")}hasBuiltPath(e){const{charCode:t,glyphId:a}=lookupCmap(this.cmap,e);return void 0!==this.compiledGlyphs[a]&&void 0!==this.compiledCharCodeToGlyphId[t]}}class TrueTypeCompiled extends CompiledFont{constructor(e,t,a){super(a||[488e-6,0,0,488e-6,0,0]);this.glyphs=e;this.cmap=t}compileGlyphImpl(e,t){compileGlyf(e,t,this)}}class Type2Compiled extends CompiledFont{constructor(e,t,a){super(a||[.001,0,0,.001,0,0]);this.glyphs=e.glyphs;this.gsubrs=e.gsubrs||[];this.subrs=e.subrs||[];this.cmap=t;this.glyphNameMap=Fr();this.gsubrsBias=getSubroutineBias(this.gsubrs);this.subrsBias=getSubroutineBias(this.subrs);this.isCFFCIDFont=e.isCFFCIDFont;this.fdSelect=e.fdSelect;this.fdArray=e.fdArray}compileGlyphImpl(e,t,a){compileCharString(e,t,this,a)}}class FontRendererFactory{static create(e,t){const a=new Uint8Array(e.data);let r,i,n,s,o,c;const l=readUint16(a,4);for(let e=0,h=12;e<l;e++,h+=16){const e=bytesToString(a.subarray(h,h+4)),l=readUint32(a,h+8),u=readUint32(a,h+12);switch(e){case"cmap":r=parseCmap(a,l);break;case"glyf":i=a.subarray(l,l+u);break;case"loca":n=a.subarray(l,l+u);break;case"head":c=readUint16(a,l+18);o=readUint16(a,l+50);break;case"CFF ":s=parseCff(a,l,l+u,t)}}if(i){const t=c?[1/c,0,0,1/c,0,0]:e.fontMatrix;return new TrueTypeCompiled(function parseGlyfTable(e,t,a){let r,i;if(a){r=4;i=readUint32}else{r=2;i=(e,t)=>2*readUint16(e,t)}const n=[];let s=i(t,0);for(let a=r;a<t.length;a+=r){const r=i(t,a);n.push(e.subarray(s,r));s=r}return n}(i,n,o),r,t)}return new Type2Compiled(s,r,e.fontMatrix)}}const ii=getLookupTableFactory((function(e){e.Courier=600;e["Courier-Bold"]=600;e["Courier-BoldOblique"]=600;e["Courier-Oblique"]=600;e.Helvetica=getLookupTableFactory((function(e){e.space=278;e.exclam=278;e.quotedbl=355;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=667;e.quoteright=222;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=278;e.semicolon=278;e.less=584;e.equal=584;e.greater=584;e.question=556;e.at=1015;e.A=667;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=500;e.K=667;e.L=556;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=278;e.backslash=278;e.bracketright=278;e.asciicircum=469;e.underscore=556;e.quoteleft=222;e.a=556;e.b=556;e.c=500;e.d=556;e.e=556;e.f=278;e.g=556;e.h=556;e.i=222;e.j=222;e.k=500;e.l=222;e.m=833;e.n=556;e.o=556;e.p=556;e.q=556;e.r=333;e.s=500;e.t=278;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=500;e.braceleft=334;e.bar=260;e.braceright=334;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=191;e.quotedblleft=333;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=537;e.bullet=350;e.quotesinglbase=222;e.quotedblbase=333;e.quotedblright=333;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=556;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=222;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=556;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=667;e.aacute=556;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=500;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=500;e.aring=556;e.Ncommaaccent=722;e.lacute=222;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=500;e.scedilla=500;e.iacute=278;e.lozenge=471;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=556;e.Amacron=667;e.rcaron=333;e.ccedilla=500;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=643;e.Umacron=722;e.uring=556;e.threesuperior=333;e.Ograve=778;e.Agrave=667;e.Abreve=667;e.multiply=584;e.uacute=556;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=500;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=260;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=333;e.omacron=556;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=222;e.tcaron=317;e.eogonek=556;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=556;e.zacute=500;e.iogonek=222;e.Oacute=778;e.oacute=556;e.amacron=556;e.sacute=500;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=333;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=556;e.Eogonek=667;e.dcroat=556;e.threequarters=834;e.Scedilla=667;e.lcaron=299;e.Kcommaaccent=667;e.Lacute=556;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=556;e.onehalf=834;e.lessequal=549;e.ocircumflex=556;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=556;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=556;e.Ccaron=722;e.ugrave=556;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=556;e.Rcommaaccent=722;e.Lcommaaccent=556;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=500;e.minus=584;e.Icircumflex=278;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=584;e.odieresis=556;e.udieresis=556;e.notequal=549;e.gcommaaccent=556;e.eth=556;e.zcaron=500;e.ncommaaccent=556;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-Bold"]=getLookupTableFactory((function(e){e.space=278;e.exclam=333;e.quotedbl=474;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=722;e.quoteright=278;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=333;e.semicolon=333;e.less=584;e.equal=584;e.greater=584;e.question=611;e.at=975;e.A=722;e.B=722;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=556;e.K=722;e.L=611;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=584;e.underscore=556;e.quoteleft=278;e.a=556;e.b=611;e.c=556;e.d=611;e.e=556;e.f=333;e.g=611;e.h=611;e.i=278;e.j=278;e.k=556;e.l=278;e.m=889;e.n=611;e.o=611;e.p=611;e.q=611;e.r=389;e.s=556;e.t=333;e.u=611;e.v=556;e.w=778;e.x=556;e.y=556;e.z=500;e.braceleft=389;e.bar=280;e.braceright=389;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=238;e.quotedblleft=500;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=611;e.fl=611;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=556;e.bullet=350;e.quotesinglbase=278;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=611;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=278;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=611;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=722;e.aacute=556;e.Ucircumflex=722;e.yacute=556;e.scommaaccent=556;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=611;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=556;e.aring=556;e.Ncommaaccent=722;e.lacute=278;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=556;e.scedilla=556;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=611;e.acircumflex=556;e.Amacron=722;e.rcaron=389;e.ccedilla=556;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=743;e.Umacron=722;e.uring=611;e.threesuperior=333;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=584;e.uacute=611;e.Tcaron=611;e.partialdiff=494;e.ydieresis=556;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=556;e.nacute=611;e.umacron=611;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=280;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=611;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=389;e.eogonek=556;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=556;e.zacute=500;e.iogonek=278;e.Oacute=778;e.oacute=611;e.amacron=556;e.sacute=556;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=611;e.twosuperior=333;e.Odieresis=778;e.mu=611;e.igrave=278;e.ohungarumlaut=611;e.Eogonek=667;e.dcroat=611;e.threequarters=834;e.Scedilla=667;e.lcaron=400;e.Kcommaaccent=722;e.Lacute=611;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=611;e.onehalf=834;e.lessequal=549;e.ocircumflex=611;e.ntilde=611;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=611;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=611;e.Ccaron=722;e.ugrave=611;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=611;e.Rcommaaccent=722;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=556;e.minus=584;e.Icircumflex=278;e.ncaron=611;e.tcommaaccent=333;e.logicalnot=584;e.odieresis=611;e.udieresis=611;e.notequal=549;e.gcommaaccent=611;e.eth=611;e.zcaron=500;e.ncommaaccent=611;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-BoldOblique"]=getLookupTableFactory((function(e){e.space=278;e.exclam=333;e.quotedbl=474;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=722;e.quoteright=278;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=333;e.semicolon=333;e.less=584;e.equal=584;e.greater=584;e.question=611;e.at=975;e.A=722;e.B=722;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=556;e.K=722;e.L=611;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=584;e.underscore=556;e.quoteleft=278;e.a=556;e.b=611;e.c=556;e.d=611;e.e=556;e.f=333;e.g=611;e.h=611;e.i=278;e.j=278;e.k=556;e.l=278;e.m=889;e.n=611;e.o=611;e.p=611;e.q=611;e.r=389;e.s=556;e.t=333;e.u=611;e.v=556;e.w=778;e.x=556;e.y=556;e.z=500;e.braceleft=389;e.bar=280;e.braceright=389;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=238;e.quotedblleft=500;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=611;e.fl=611;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=556;e.bullet=350;e.quotesinglbase=278;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=611;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=278;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=611;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=722;e.aacute=556;e.Ucircumflex=722;e.yacute=556;e.scommaaccent=556;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=611;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=556;e.aring=556;e.Ncommaaccent=722;e.lacute=278;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=556;e.scedilla=556;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=611;e.acircumflex=556;e.Amacron=722;e.rcaron=389;e.ccedilla=556;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=743;e.Umacron=722;e.uring=611;e.threesuperior=333;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=584;e.uacute=611;e.Tcaron=611;e.partialdiff=494;e.ydieresis=556;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=556;e.nacute=611;e.umacron=611;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=280;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=611;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=389;e.eogonek=556;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=556;e.zacute=500;e.iogonek=278;e.Oacute=778;e.oacute=611;e.amacron=556;e.sacute=556;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=611;e.twosuperior=333;e.Odieresis=778;e.mu=611;e.igrave=278;e.ohungarumlaut=611;e.Eogonek=667;e.dcroat=611;e.threequarters=834;e.Scedilla=667;e.lcaron=400;e.Kcommaaccent=722;e.Lacute=611;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=611;e.onehalf=834;e.lessequal=549;e.ocircumflex=611;e.ntilde=611;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=611;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=611;e.Ccaron=722;e.ugrave=611;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=611;e.Rcommaaccent=722;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=556;e.minus=584;e.Icircumflex=278;e.ncaron=611;e.tcommaaccent=333;e.logicalnot=584;e.odieresis=611;e.udieresis=611;e.notequal=549;e.gcommaaccent=611;e.eth=611;e.zcaron=500;e.ncommaaccent=611;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-Oblique"]=getLookupTableFactory((function(e){e.space=278;e.exclam=278;e.quotedbl=355;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=667;e.quoteright=222;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=278;e.semicolon=278;e.less=584;e.equal=584;e.greater=584;e.question=556;e.at=1015;e.A=667;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=500;e.K=667;e.L=556;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=278;e.backslash=278;e.bracketright=278;e.asciicircum=469;e.underscore=556;e.quoteleft=222;e.a=556;e.b=556;e.c=500;e.d=556;e.e=556;e.f=278;e.g=556;e.h=556;e.i=222;e.j=222;e.k=500;e.l=222;e.m=833;e.n=556;e.o=556;e.p=556;e.q=556;e.r=333;e.s=500;e.t=278;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=500;e.braceleft=334;e.bar=260;e.braceright=334;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=191;e.quotedblleft=333;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=537;e.bullet=350;e.quotesinglbase=222;e.quotedblbase=333;e.quotedblright=333;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=556;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=222;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=556;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=667;e.aacute=556;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=500;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=500;e.aring=556;e.Ncommaaccent=722;e.lacute=222;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=500;e.scedilla=500;e.iacute=278;e.lozenge=471;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=556;e.Amacron=667;e.rcaron=333;e.ccedilla=500;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=643;e.Umacron=722;e.uring=556;e.threesuperior=333;e.Ograve=778;e.Agrave=667;e.Abreve=667;e.multiply=584;e.uacute=556;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=500;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=260;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=333;e.omacron=556;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=222;e.tcaron=317;e.eogonek=556;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=556;e.zacute=500;e.iogonek=222;e.Oacute=778;e.oacute=556;e.amacron=556;e.sacute=500;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=333;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=556;e.Eogonek=667;e.dcroat=556;e.threequarters=834;e.Scedilla=667;e.lcaron=299;e.Kcommaaccent=667;e.Lacute=556;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=556;e.onehalf=834;e.lessequal=549;e.ocircumflex=556;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=556;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=556;e.Ccaron=722;e.ugrave=556;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=556;e.Rcommaaccent=722;e.Lcommaaccent=556;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=500;e.minus=584;e.Icircumflex=278;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=584;e.odieresis=556;e.udieresis=556;e.notequal=549;e.gcommaaccent=556;e.eth=556;e.zcaron=500;e.ncommaaccent=556;e.onesuperior=333;e.imacron=278;e.Euro=556}));e.Symbol=getLookupTableFactory((function(e){e.space=250;e.exclam=333;e.universal=713;e.numbersign=500;e.existential=549;e.percent=833;e.ampersand=778;e.suchthat=439;e.parenleft=333;e.parenright=333;e.asteriskmath=500;e.plus=549;e.comma=250;e.minus=549;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=278;e.semicolon=278;e.less=549;e.equal=549;e.greater=549;e.question=444;e.congruent=549;e.Alpha=722;e.Beta=667;e.Chi=722;e.Delta=612;e.Epsilon=611;e.Phi=763;e.Gamma=603;e.Eta=722;e.Iota=333;e.theta1=631;e.Kappa=722;e.Lambda=686;e.Mu=889;e.Nu=722;e.Omicron=722;e.Pi=768;e.Theta=741;e.Rho=556;e.Sigma=592;e.Tau=611;e.Upsilon=690;e.sigma1=439;e.Omega=768;e.Xi=645;e.Psi=795;e.Zeta=611;e.bracketleft=333;e.therefore=863;e.bracketright=333;e.perpendicular=658;e.underscore=500;e.radicalex=500;e.alpha=631;e.beta=549;e.chi=549;e.delta=494;e.epsilon=439;e.phi=521;e.gamma=411;e.eta=603;e.iota=329;e.phi1=603;e.kappa=549;e.lambda=549;e.mu=576;e.nu=521;e.omicron=549;e.pi=549;e.theta=521;e.rho=549;e.sigma=603;e.tau=439;e.upsilon=576;e.omega1=713;e.omega=686;e.xi=493;e.psi=686;e.zeta=494;e.braceleft=480;e.bar=200;e.braceright=480;e.similar=549;e.Euro=750;e.Upsilon1=620;e.minute=247;e.lessequal=549;e.fraction=167;e.infinity=713;e.florin=500;e.club=753;e.diamond=753;e.heart=753;e.spade=753;e.arrowboth=1042;e.arrowleft=987;e.arrowup=603;e.arrowright=987;e.arrowdown=603;e.degree=400;e.plusminus=549;e.second=411;e.greaterequal=549;e.multiply=549;e.proportional=713;e.partialdiff=494;e.bullet=460;e.divide=549;e.notequal=549;e.equivalence=549;e.approxequal=549;e.ellipsis=1e3;e.arrowvertex=603;e.arrowhorizex=1e3;e.carriagereturn=658;e.aleph=823;e.Ifraktur=686;e.Rfraktur=795;e.weierstrass=987;e.circlemultiply=768;e.circleplus=768;e.emptyset=823;e.intersection=768;e.union=768;e.propersuperset=713;e.reflexsuperset=713;e.notsubset=713;e.propersubset=713;e.reflexsubset=713;e.element=713;e.notelement=713;e.angle=768;e.gradient=713;e.registerserif=790;e.copyrightserif=790;e.trademarkserif=890;e.product=823;e.radical=549;e.dotmath=250;e.logicalnot=713;e.logicaland=603;e.logicalor=603;e.arrowdblboth=1042;e.arrowdblleft=987;e.arrowdblup=603;e.arrowdblright=987;e.arrowdbldown=603;e.lozenge=494;e.angleleft=329;e.registersans=790;e.copyrightsans=790;e.trademarksans=786;e.summation=713;e.parenlefttp=384;e.parenleftex=384;e.parenleftbt=384;e.bracketlefttp=384;e.bracketleftex=384;e.bracketleftbt=384;e.bracelefttp=494;e.braceleftmid=494;e.braceleftbt=494;e.braceex=494;e.angleright=329;e.integral=274;e.integraltp=686;e.integralex=686;e.integralbt=686;e.parenrighttp=384;e.parenrightex=384;e.parenrightbt=384;e.bracketrighttp=384;e.bracketrightex=384;e.bracketrightbt=384;e.bracerighttp=494;e.bracerightmid=494;e.bracerightbt=494;e.apple=790}));e["Times-Roman"]=getLookupTableFactory((function(e){e.space=250;e.exclam=333;e.quotedbl=408;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=564;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=278;e.semicolon=278;e.less=564;e.equal=564;e.greater=564;e.question=444;e.at=921;e.A=722;e.B=667;e.C=667;e.D=722;e.E=611;e.F=556;e.G=722;e.H=722;e.I=333;e.J=389;e.K=722;e.L=611;e.M=889;e.N=722;e.O=722;e.P=556;e.Q=722;e.R=667;e.S=556;e.T=611;e.U=722;e.V=722;e.W=944;e.X=722;e.Y=722;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=469;e.underscore=500;e.quoteleft=333;e.a=444;e.b=500;e.c=444;e.d=500;e.e=444;e.f=333;e.g=500;e.h=500;e.i=278;e.j=278;e.k=500;e.l=278;e.m=778;e.n=500;e.o=500;e.p=500;e.q=500;e.r=333;e.s=389;e.t=278;e.u=500;e.v=500;e.w=722;e.x=500;e.y=500;e.z=444;e.braceleft=480;e.bar=200;e.braceright=480;e.asciitilde=541;e.exclamdown=333;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=180;e.quotedblleft=444;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=453;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=444;e.quotedblright=444;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=444;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=889;e.ordfeminine=276;e.Lslash=611;e.Oslash=722;e.OE=889;e.ordmasculine=310;e.ae=667;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=500;e.Idieresis=333;e.eacute=444;e.abreve=444;e.uhungarumlaut=500;e.ecaron=444;e.Ydieresis=722;e.divide=564;e.Yacute=722;e.Acircumflex=722;e.aacute=444;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=444;e.Uacute=722;e.uogonek=500;e.Edieresis=611;e.Dcroat=722;e.commaaccent=250;e.copyright=760;e.Emacron=611;e.ccaron=444;e.aring=444;e.Ncommaaccent=722;e.lacute=278;e.agrave=444;e.Tcommaaccent=611;e.Cacute=667;e.atilde=444;e.Edotaccent=611;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=471;e.Rcaron=667;e.Gcommaaccent=722;e.ucircumflex=500;e.acircumflex=444;e.Amacron=722;e.rcaron=333;e.ccedilla=444;e.Zdotaccent=611;e.Thorn=556;e.Omacron=722;e.Racute=667;e.Sacute=556;e.dcaron=588;e.Umacron=722;e.uring=500;e.threesuperior=300;e.Ograve=722;e.Agrave=722;e.Abreve=722;e.multiply=564;e.uacute=500;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=611;e.adieresis=444;e.edieresis=444;e.cacute=444;e.nacute=500;e.umacron=500;e.Ncaron=722;e.Iacute=333;e.plusminus=564;e.brokenbar=200;e.registered=760;e.Gbreve=722;e.Idotaccent=333;e.summation=600;e.Egrave=611;e.racute=333;e.omacron=500;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=326;e.eogonek=444;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=444;e.zacute=444;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=444;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=500;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=611;e.dcroat=500;e.threequarters=750;e.Scedilla=556;e.lcaron=344;e.Kcommaaccent=722;e.Lacute=611;e.trademark=980;e.edotaccent=444;e.Igrave=333;e.Imacron=333;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=500;e.Uhungarumlaut=722;e.Eacute=611;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=500;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=667;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=722;e.zdotaccent=444;e.Ecaron=611;e.Iogonek=333;e.kcommaaccent=500;e.minus=564;e.Icircumflex=333;e.ncaron=500;e.tcommaaccent=278;e.logicalnot=564;e.odieresis=500;e.udieresis=500;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=444;e.ncommaaccent=500;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-Bold"]=getLookupTableFactory((function(e){e.space=250;e.exclam=333;e.quotedbl=555;e.numbersign=500;e.dollar=500;e.percent=1e3;e.ampersand=833;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=570;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=570;e.equal=570;e.greater=570;e.question=500;e.at=930;e.A=722;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=778;e.I=389;e.J=500;e.K=778;e.L=667;e.M=944;e.N=722;e.O=778;e.P=611;e.Q=778;e.R=722;e.S=556;e.T=667;e.U=722;e.V=722;e.W=1e3;e.X=722;e.Y=722;e.Z=667;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=581;e.underscore=500;e.quoteleft=333;e.a=500;e.b=556;e.c=444;e.d=556;e.e=444;e.f=333;e.g=500;e.h=556;e.i=278;e.j=333;e.k=556;e.l=278;e.m=833;e.n=556;e.o=500;e.p=556;e.q=556;e.r=444;e.s=389;e.t=333;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=444;e.braceleft=394;e.bar=220;e.braceright=394;e.asciitilde=520;e.exclamdown=333;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=278;e.quotedblleft=500;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=540;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=300;e.Lslash=667;e.Oslash=778;e.OE=1e3;e.ordmasculine=330;e.ae=722;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=556;e.Idieresis=389;e.eacute=444;e.abreve=500;e.uhungarumlaut=556;e.ecaron=444;e.Ydieresis=722;e.divide=570;e.Yacute=722;e.Acircumflex=722;e.aacute=500;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=747;e.Emacron=667;e.ccaron=444;e.aring=500;e.Ncommaaccent=722;e.lacute=278;e.agrave=500;e.Tcommaaccent=667;e.Cacute=722;e.atilde=500;e.Edotaccent=667;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=500;e.Amacron=722;e.rcaron=444;e.ccedilla=444;e.Zdotaccent=667;e.Thorn=611;e.Omacron=778;e.Racute=722;e.Sacute=556;e.dcaron=672;e.Umacron=722;e.uring=556;e.threesuperior=300;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=570;e.uacute=556;e.Tcaron=667;e.partialdiff=494;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=389;e.plusminus=570;e.brokenbar=220;e.registered=747;e.Gbreve=778;e.Idotaccent=389;e.summation=600;e.Egrave=667;e.racute=444;e.omacron=500;e.Zacute=667;e.Zcaron=667;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=416;e.eogonek=444;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=444;e.zacute=444;e.iogonek=278;e.Oacute=778;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=300;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=667;e.dcroat=556;e.threequarters=750;e.Scedilla=556;e.lcaron=394;e.Kcommaaccent=778;e.Lacute=667;e.trademark=1e3;e.edotaccent=444;e.Igrave=389;e.Imacron=389;e.Lcaron=667;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=778;e.degree=400;e.ograve=500;e.Ccaron=722;e.ugrave=556;e.radical=549;e.Dcaron=722;e.rcommaaccent=444;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=722;e.Lcommaaccent=667;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=444;e.Ecaron=667;e.Iogonek=389;e.kcommaaccent=556;e.minus=570;e.Icircumflex=389;e.ncaron=556;e.tcommaaccent=333;e.logicalnot=570;e.odieresis=500;e.udieresis=556;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=444;e.ncommaaccent=556;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-BoldItalic"]=getLookupTableFactory((function(e){e.space=250;e.exclam=389;e.quotedbl=555;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=570;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=570;e.equal=570;e.greater=570;e.question=500;e.at=832;e.A=667;e.B=667;e.C=667;e.D=722;e.E=667;e.F=667;e.G=722;e.H=778;e.I=389;e.J=500;e.K=667;e.L=611;e.M=889;e.N=722;e.O=722;e.P=611;e.Q=722;e.R=667;e.S=556;e.T=611;e.U=722;e.V=667;e.W=889;e.X=667;e.Y=611;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=570;e.underscore=500;e.quoteleft=333;e.a=500;e.b=500;e.c=444;e.d=500;e.e=444;e.f=333;e.g=500;e.h=556;e.i=278;e.j=278;e.k=500;e.l=278;e.m=778;e.n=556;e.o=500;e.p=500;e.q=500;e.r=389;e.s=389;e.t=278;e.u=556;e.v=444;e.w=667;e.x=500;e.y=444;e.z=389;e.braceleft=348;e.bar=220;e.braceright=348;e.asciitilde=570;e.exclamdown=389;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=278;e.quotedblleft=500;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=500;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=944;e.ordfeminine=266;e.Lslash=611;e.Oslash=722;e.OE=944;e.ordmasculine=300;e.ae=722;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=500;e.Idieresis=389;e.eacute=444;e.abreve=500;e.uhungarumlaut=556;e.ecaron=444;e.Ydieresis=611;e.divide=570;e.Yacute=611;e.Acircumflex=667;e.aacute=500;e.Ucircumflex=722;e.yacute=444;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=747;e.Emacron=667;e.ccaron=444;e.aring=500;e.Ncommaaccent=722;e.lacute=278;e.agrave=500;e.Tcommaaccent=611;e.Cacute=667;e.atilde=500;e.Edotaccent=667;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=494;e.Rcaron=667;e.Gcommaaccent=722;e.ucircumflex=556;e.acircumflex=500;e.Amacron=667;e.rcaron=389;e.ccedilla=444;e.Zdotaccent=611;e.Thorn=611;e.Omacron=722;e.Racute=667;e.Sacute=556;e.dcaron=608;e.Umacron=722;e.uring=556;e.threesuperior=300;e.Ograve=722;e.Agrave=667;e.Abreve=667;e.multiply=570;e.uacute=556;e.Tcaron=611;e.partialdiff=494;e.ydieresis=444;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=389;e.plusminus=570;e.brokenbar=220;e.registered=747;e.Gbreve=722;e.Idotaccent=389;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=500;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=366;e.eogonek=444;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=444;e.zacute=389;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=576;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=667;e.dcroat=500;e.threequarters=750;e.Scedilla=556;e.lcaron=382;e.Kcommaaccent=667;e.Lacute=611;e.trademark=1e3;e.edotaccent=444;e.Igrave=389;e.Imacron=389;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=556;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=667;e.Lcommaaccent=611;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=722;e.zdotaccent=389;e.Ecaron=667;e.Iogonek=389;e.kcommaaccent=500;e.minus=606;e.Icircumflex=389;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=606;e.odieresis=500;e.udieresis=556;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=389;e.ncommaaccent=556;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-Italic"]=getLookupTableFactory((function(e){e.space=250;e.exclam=333;e.quotedbl=420;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=675;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=675;e.equal=675;e.greater=675;e.question=500;e.at=920;e.A=611;e.B=611;e.C=667;e.D=722;e.E=611;e.F=611;e.G=722;e.H=722;e.I=333;e.J=444;e.K=667;e.L=556;e.M=833;e.N=667;e.O=722;e.P=611;e.Q=722;e.R=611;e.S=500;e.T=556;e.U=722;e.V=611;e.W=833;e.X=611;e.Y=556;e.Z=556;e.bracketleft=389;e.backslash=278;e.bracketright=389;e.asciicircum=422;e.underscore=500;e.quoteleft=333;e.a=500;e.b=500;e.c=444;e.d=500;e.e=444;e.f=278;e.g=500;e.h=500;e.i=278;e.j=278;e.k=444;e.l=278;e.m=722;e.n=500;e.o=500;e.p=500;e.q=500;e.r=389;e.s=389;e.t=278;e.u=500;e.v=444;e.w=667;e.x=444;e.y=444;e.z=389;e.braceleft=400;e.bar=275;e.braceright=400;e.asciitilde=541;e.exclamdown=389;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=214;e.quotedblleft=556;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=523;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=556;e.quotedblright=556;e.guillemotright=500;e.ellipsis=889;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=889;e.AE=889;e.ordfeminine=276;e.Lslash=556;e.Oslash=722;e.OE=944;e.ordmasculine=310;e.ae=667;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=667;e.germandbls=500;e.Idieresis=333;e.eacute=444;e.abreve=500;e.uhungarumlaut=500;e.ecaron=444;e.Ydieresis=556;e.divide=675;e.Yacute=556;e.Acircumflex=611;e.aacute=500;e.Ucircumflex=722;e.yacute=444;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=500;e.Edieresis=611;e.Dcroat=722;e.commaaccent=250;e.copyright=760;e.Emacron=611;e.ccaron=444;e.aring=500;e.Ncommaaccent=667;e.lacute=278;e.agrave=500;e.Tcommaaccent=556;e.Cacute=667;e.atilde=500;e.Edotaccent=611;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=471;e.Rcaron=611;e.Gcommaaccent=722;e.ucircumflex=500;e.acircumflex=500;e.Amacron=611;e.rcaron=389;e.ccedilla=444;e.Zdotaccent=556;e.Thorn=611;e.Omacron=722;e.Racute=611;e.Sacute=500;e.dcaron=544;e.Umacron=722;e.uring=500;e.threesuperior=300;e.Ograve=722;e.Agrave=611;e.Abreve=611;e.multiply=675;e.uacute=500;e.Tcaron=556;e.partialdiff=476;e.ydieresis=444;e.Nacute=667;e.icircumflex=278;e.Ecircumflex=611;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=500;e.umacron=500;e.Ncaron=667;e.Iacute=333;e.plusminus=675;e.brokenbar=275;e.registered=760;e.Gbreve=722;e.Idotaccent=333;e.summation=600;e.Egrave=611;e.racute=389;e.omacron=500;e.Zacute=556;e.Zcaron=556;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=300;e.eogonek=444;e.Uogonek=722;e.Aacute=611;e.Adieresis=611;e.egrave=444;e.zacute=389;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=500;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=611;e.dcroat=500;e.threequarters=750;e.Scedilla=500;e.lcaron=300;e.Kcommaaccent=667;e.Lacute=556;e.trademark=980;e.edotaccent=444;e.Igrave=333;e.Imacron=333;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=500;e.Uhungarumlaut=722;e.Eacute=611;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=500;e.Scommaaccent=500;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=500;e.radical=453;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=667;e.otilde=500;e.Rcommaaccent=611;e.Lcommaaccent=556;e.Atilde=611;e.Aogonek=611;e.Aring=611;e.Otilde=722;e.zdotaccent=389;e.Ecaron=611;e.Iogonek=333;e.kcommaaccent=444;e.minus=675;e.Icircumflex=333;e.ncaron=500;e.tcommaaccent=278;e.logicalnot=675;e.odieresis=500;e.udieresis=500;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=389;e.ncommaaccent=500;e.onesuperior=300;e.imacron=278;e.Euro=500}));e.ZapfDingbats=getLookupTableFactory((function(e){e.space=278;e.a1=974;e.a2=961;e.a202=974;e.a3=980;e.a4=719;e.a5=789;e.a119=790;e.a118=791;e.a117=690;e.a11=960;e.a12=939;e.a13=549;e.a14=855;e.a15=911;e.a16=933;e.a105=911;e.a17=945;e.a18=974;e.a19=755;e.a20=846;e.a21=762;e.a22=761;e.a23=571;e.a24=677;e.a25=763;e.a26=760;e.a27=759;e.a28=754;e.a6=494;e.a7=552;e.a8=537;e.a9=577;e.a10=692;e.a29=786;e.a30=788;e.a31=788;e.a32=790;e.a33=793;e.a34=794;e.a35=816;e.a36=823;e.a37=789;e.a38=841;e.a39=823;e.a40=833;e.a41=816;e.a42=831;e.a43=923;e.a44=744;e.a45=723;e.a46=749;e.a47=790;e.a48=792;e.a49=695;e.a50=776;e.a51=768;e.a52=792;e.a53=759;e.a54=707;e.a55=708;e.a56=682;e.a57=701;e.a58=826;e.a59=815;e.a60=789;e.a61=789;e.a62=707;e.a63=687;e.a64=696;e.a65=689;e.a66=786;e.a67=787;e.a68=713;e.a69=791;e.a70=785;e.a71=791;e.a72=873;e.a73=761;e.a74=762;e.a203=762;e.a75=759;e.a204=759;e.a76=892;e.a77=892;e.a78=788;e.a79=784;e.a81=438;e.a82=138;e.a83=277;e.a84=415;e.a97=392;e.a98=392;e.a99=668;e.a100=668;e.a89=390;e.a90=390;e.a93=317;e.a94=317;e.a91=276;e.a92=276;e.a205=509;e.a85=509;e.a206=410;e.a86=410;e.a87=234;e.a88=234;e.a95=334;e.a96=334;e.a101=732;e.a102=544;e.a103=544;e.a104=910;e.a106=667;e.a107=760;e.a108=760;e.a112=776;e.a111=595;e.a110=694;e.a109=626;e.a120=788;e.a121=788;e.a122=788;e.a123=788;e.a124=788;e.a125=788;e.a126=788;e.a127=788;e.a128=788;e.a129=788;e.a130=788;e.a131=788;e.a132=788;e.a133=788;e.a134=788;e.a135=788;e.a136=788;e.a137=788;e.a138=788;e.a139=788;e.a140=788;e.a141=788;e.a142=788;e.a143=788;e.a144=788;e.a145=788;e.a146=788;e.a147=788;e.a148=788;e.a149=788;e.a150=788;e.a151=788;e.a152=788;e.a153=788;e.a154=788;e.a155=788;e.a156=788;e.a157=788;e.a158=788;e.a159=788;e.a160=894;e.a161=838;e.a163=1016;e.a164=458;e.a196=748;e.a165=924;e.a192=748;e.a166=918;e.a167=927;e.a168=928;e.a169=928;e.a170=834;e.a171=873;e.a172=828;e.a173=924;e.a162=924;e.a174=917;e.a175=930;e.a176=931;e.a177=463;e.a178=883;e.a179=836;e.a193=836;e.a180=867;e.a199=867;e.a181=696;e.a200=696;e.a182=874;e.a201=874;e.a183=760;e.a184=946;e.a197=771;e.a185=865;e.a194=771;e.a198=888;e.a186=967;e.a195=888;e.a187=831;e.a188=873;e.a189=927;e.a190=970;e.a191=918}))})),ni=getLookupTableFactory((function(e){e.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426};e["Courier-Bold"]={ascent:629,descent:-157,capHeight:562,xHeight:439};e["Courier-Oblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426};e["Courier-BoldOblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426};e.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523};e["Helvetica-Bold"]={ascent:718,descent:-207,capHeight:718,xHeight:532};e["Helvetica-Oblique"]={ascent:718,descent:-207,capHeight:718,xHeight:523};e["Helvetica-BoldOblique"]={ascent:718,descent:-207,capHeight:718,xHeight:532};e["Times-Roman"]={ascent:683,descent:-217,capHeight:662,xHeight:450};e["Times-Bold"]={ascent:683,descent:-217,capHeight:676,xHeight:461};e["Times-Italic"]={ascent:683,descent:-217,capHeight:653,xHeight:441};e["Times-BoldItalic"]={ascent:683,descent:-217,capHeight:669,xHeight:462};e.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN};e.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}}));class GlyfTable{constructor({glyfTable:e,isGlyphLocationsLong:t,locaTable:a,numGlyphs:r}){this.glyphs=[];const i=new DataView(a.buffer,a.byteOffset,a.byteLength),n=new DataView(e.buffer,e.byteOffset,e.byteLength),s=t?4:2;let o=t?i.getUint32(0):2*i.getUint16(0),c=0;for(let e=0;e<r;e++){c+=s;const e=t?i.getUint32(c):2*i.getUint16(c);if(e===o){this.glyphs.push(new Glyph({}));continue}const a=Glyph.parse(o,n);this.glyphs.push(a);o=e}}getSize(){return Math.sumPrecise(this.glyphs.map((e=>e.getSize()+3&-4)))}write(){const e=this.getSize(),t=new DataView(new ArrayBuffer(e)),a=e>131070,r=a?4:2,i=new DataView(new ArrayBuffer((this.glyphs.length+1)*r));a?i.setUint32(0,0):i.setUint16(0,0);let n=0,s=0;for(const e of this.glyphs){n+=e.write(n,t);n=n+3&-4;s+=r;a?i.setUint32(s,n):i.setUint16(s,n>>1)}return{isLocationLong:a,loca:new Uint8Array(i.buffer),glyf:new Uint8Array(t.buffer)}}scale(e){for(let t=0,a=this.glyphs.length;t<a;t++)this.glyphs[t].scale(e[t])}}class Glyph{constructor({header:e=null,simple:t=null,composites:a=null}){this.header=e;this.simple=t;this.composites=a}static parse(e,t){const[a,r]=GlyphHeader.parse(e,t);e+=a;if(r.numberOfContours<0){const a=[];for(;;){const[r,i]=CompositeGlyph.parse(e,t);e+=r;a.push(i);if(!(32&i.flags))break}return new Glyph({header:r,composites:a})}const i=SimpleGlyph.parse(e,t,r.numberOfContours);return new Glyph({header:r,simple:i})}getSize(){if(!this.header)return 0;const e=this.simple?this.simple.getSize():Math.sumPrecise(this.composites.map((e=>e.getSize())));return this.header.getSize()+e}write(e,t){if(!this.header)return 0;const a=e;e+=this.header.write(e,t);if(this.simple)e+=this.simple.write(e,t);else for(const a of this.composites)e+=a.write(e,t);return e-a}scale(e){if(!this.header)return;const t=(this.header.xMin+this.header.xMax)/2;this.header.scale(t,e);if(this.simple)this.simple.scale(t,e);else for(const a of this.composites)a.scale(t,e)}}class GlyphHeader{constructor({numberOfContours:e,xMin:t,yMin:a,xMax:r,yMax:i}){this.numberOfContours=e;this.xMin=t;this.yMin=a;this.xMax=r;this.yMax=i}static parse(e,t){return[10,new GlyphHeader({numberOfContours:t.getInt16(e),xMin:t.getInt16(e+2),yMin:t.getInt16(e+4),xMax:t.getInt16(e+6),yMax:t.getInt16(e+8)})]}getSize(){return 10}write(e,t){t.setInt16(e,this.numberOfContours);t.setInt16(e+2,this.xMin);t.setInt16(e+4,this.yMin);t.setInt16(e+6,this.xMax);t.setInt16(e+8,this.yMax);return 10}scale(e,t){this.xMin=Math.round(e+(this.xMin-e)*t);this.xMax=Math.round(e+(this.xMax-e)*t)}}class Contour{constructor({flags:e,xCoordinates:t,yCoordinates:a}){this.xCoordinates=t;this.yCoordinates=a;this.flags=e}}class SimpleGlyph{constructor({contours:e,instructions:t}){this.contours=e;this.instructions=t}static parse(e,t,a){const r=[];for(let i=0;i<a;i++){const a=t.getUint16(e);e+=2;r.push(a)}const i=r[a-1]+1,n=t.getUint16(e);e+=2;const s=new Uint8Array(t).slice(e,e+n);e+=n;const o=[];for(let a=0;a<i;e++,a++){let r=t.getUint8(e);o.push(r);if(8&r){const i=t.getUint8(++e);r^=8;for(let e=0;e<i;e++)o.push(r);a+=i}}const c=[];let l=[],h=[],u=[];const d=[];let f=0,g=0;for(let a=0;a<i;a++){const i=o[a];if(2&i){const a=t.getUint8(e++);g+=16&i?a:-a;l.push(g)}else if(16&i)l.push(g);else{g+=t.getInt16(e);e+=2;l.push(g)}if(r[f]===a){f++;c.push(l);l=[]}}g=0;f=0;for(let a=0;a<i;a++){const i=o[a];if(4&i){const a=t.getUint8(e++);g+=32&i?a:-a;h.push(g)}else if(32&i)h.push(g);else{g+=t.getInt16(e);e+=2;h.push(g)}u.push(1&i|64&i);if(r[f]===a){l=c[f];f++;d.push(new Contour({flags:u,xCoordinates:l,yCoordinates:h}));h=[];u=[]}}return new SimpleGlyph({contours:d,instructions:s})}getSize(){let e=2*this.contours.length+2+this.instructions.length,t=0,a=0;for(const r of this.contours){e+=r.flags.length;for(let i=0,n=r.xCoordinates.length;i<n;i++){const n=r.xCoordinates[i],s=r.yCoordinates[i];let o=Math.abs(n-t);o>255?e+=2:o>0&&(e+=1);t=n;o=Math.abs(s-a);o>255?e+=2:o>0&&(e+=1);a=s}}return e}write(e,t){const a=e,r=[],i=[],n=[];let s=0,o=0;for(const a of this.contours){for(let e=0,t=a.xCoordinates.length;e<t;e++){let t=a.flags[e];const c=a.xCoordinates[e];let l=c-s;if(0===l){t|=16;r.push(0)}else{const e=Math.abs(l);if(e<=255){t|=l>=0?18:2;r.push(e)}else r.push(l)}s=c;const h=a.yCoordinates[e];l=h-o;if(0===l){t|=32;i.push(0)}else{const e=Math.abs(l);if(e<=255){t|=l>=0?36:4;i.push(e)}else i.push(l)}o=h;n.push(t)}t.setUint16(e,r.length-1);e+=2}t.setUint16(e,this.instructions.length);e+=2;if(this.instructions.length){new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e);e+=this.instructions.length}for(const a of n)t.setUint8(e++,a);for(let a=0,i=r.length;a<i;a++){const i=r[a],s=n[a];if(2&s)t.setUint8(e++,i);else if(!(16&s)){t.setInt16(e,i);e+=2}}for(let a=0,r=i.length;a<r;a++){const r=i[a],s=n[a];if(4&s)t.setUint8(e++,r);else if(!(32&s)){t.setInt16(e,r);e+=2}}return e-a}scale(e,t){for(const a of this.contours)if(0!==a.xCoordinates.length)for(let r=0,i=a.xCoordinates.length;r<i;r++)a.xCoordinates[r]=Math.round(e+(a.xCoordinates[r]-e)*t)}}class CompositeGlyph{constructor({flags:e,glyphIndex:t,argument1:a,argument2:r,transf:i,instructions:n}){this.flags=e;this.glyphIndex=t;this.argument1=a;this.argument2=r;this.transf=i;this.instructions=n}static parse(e,t){const a=e,r=[];let i=t.getUint16(e);const n=t.getUint16(e+2);e+=4;let s,o;if(1&i){if(2&i){s=t.getInt16(e);o=t.getInt16(e+2)}else{s=t.getUint16(e);o=t.getUint16(e+2)}e+=4;i^=1}else{if(2&i){s=t.getInt8(e);o=t.getInt8(e+1)}else{s=t.getUint8(e);o=t.getUint8(e+1)}e+=2}if(8&i){r.push(t.getUint16(e));e+=2}else if(64&i){r.push(t.getUint16(e),t.getUint16(e+2));e+=4}else if(128&i){r.push(t.getUint16(e),t.getUint16(e+2),t.getUint16(e+4),t.getUint16(e+6));e+=8}let c=null;if(256&i){const a=t.getUint16(e);e+=2;c=new Uint8Array(t).slice(e,e+a);e+=a}return[e-a,new CompositeGlyph({flags:i,glyphIndex:n,argument1:s,argument2:o,transf:r,instructions:c})]}getSize(){let e=4+2*this.transf.length;256&this.flags&&(e+=2+this.instructions.length);e+=2;2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(e+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(e+=2);return e}write(e,t){const a=e;2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(this.flags|=1):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(this.flags|=1);t.setUint16(e,this.flags);t.setUint16(e+2,this.glyphIndex);e+=4;if(1&this.flags){if(2&this.flags){t.setInt16(e,this.argument1);t.setInt16(e+2,this.argument2)}else{t.setUint16(e,this.argument1);t.setUint16(e+2,this.argument2)}e+=4}else{t.setUint8(e,this.argument1);t.setUint8(e+1,this.argument2);e+=2}if(256&this.flags){t.setUint16(e,this.instructions.length);e+=2;if(this.instructions.length){new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e);e+=this.instructions.length}}return e-a}scale(e,t){}}function writeInt16(e,t,a){e[t]=a>>8&255;e[t+1]=255&a}function writeInt32(e,t,a){e[t]=a>>24&255;e[t+1]=a>>16&255;e[t+2]=a>>8&255;e[t+3]=255&a}function writeData(e,t,a){if(a instanceof Uint8Array)e.set(a,t);else if("string"==typeof a)for(let r=0,i=a.length;r<i;r++)e[t++]=255&a.charCodeAt(r);else for(const r of a)e[t++]=255&r}class OpenTypeFileBuilder{constructor(e){this.sfnt=e;this.tables=Object.create(null)}static getSearchParams(e,t){let a=1,r=0;for(;(a^e)>a;){a<<=1;r++}const i=a*t;return{range:i,entry:r,rangeShift:t*e-i}}toArray(){let e=this.sfnt;const t=this.tables,a=Object.keys(t);a.sort();const r=a.length;let i,n,s,o,c,l=12+16*r;const h=[l];for(i=0;i<r;i++){o=t[a[i]];l+=(o.length+3&-4)>>>0;h.push(l)}const u=new Uint8Array(l);for(i=0;i<r;i++){o=t[a[i]];writeData(u,h[i],o)}"true"===e&&(e=string32(65536));u[0]=255&e.charCodeAt(0);u[1]=255&e.charCodeAt(1);u[2]=255&e.charCodeAt(2);u[3]=255&e.charCodeAt(3);writeInt16(u,4,r);const d=OpenTypeFileBuilder.getSearchParams(r,16);writeInt16(u,6,d.range);writeInt16(u,8,d.entry);writeInt16(u,10,d.rangeShift);l=12;for(i=0;i<r;i++){c=a[i];u[l]=255&c.charCodeAt(0);u[l+1]=255&c.charCodeAt(1);u[l+2]=255&c.charCodeAt(2);u[l+3]=255&c.charCodeAt(3);let e=0;for(n=h[i],s=h[i+1];n<s;n+=4){e=e+readUint32(u,n)>>>0}writeInt32(u,l+4,e);writeInt32(u,l+8,h[i]);writeInt32(u,l+12,t[c].length);l+=16}return u}addTable(e,t){if(e in this.tables)throw new Error("Table "+e+" already exists");this.tables[e]=t}}const si=[4],oi=[5],ci=[6],li=[7],hi=[8],ui=[12,35],di=[14],fi=[21],gi=[22],pi=[30],mi=[31];class Type1CharString{constructor(){this.width=0;this.lsb=0;this.flexing=!1;this.output=[];this.stack=[]}convert(e,t,a){const r=e.length;let i,n,s,o=!1;for(let c=0;c<r;c++){let r=e[c];if(r<32){12===r&&(r=(r<<8)+e[++c]);switch(r){case 1:case 3:case 9:case 3072:case 3073:case 3074:case 3105:this.stack=[];break;case 4:if(this.flexing){if(this.stack.length<1){o=!0;break}const e=this.stack.pop();this.stack.push(0,e);break}o=this.executeCommand(1,si);break;case 5:o=this.executeCommand(2,oi);break;case 6:o=this.executeCommand(1,ci);break;case 7:o=this.executeCommand(1,li);break;case 8:o=this.executeCommand(6,hi);break;case 10:if(this.stack.length<1){o=!0;break}s=this.stack.pop();if(!t[s]){o=!0;break}o=this.convert(t[s],t,a);break;case 11:return o;case 13:if(this.stack.length<2){o=!0;break}i=this.stack.pop();n=this.stack.pop();this.lsb=n;this.width=i;this.stack.push(i,n);o=this.executeCommand(2,gi);break;case 14:this.output.push(di[0]);break;case 21:if(this.flexing)break;o=this.executeCommand(2,fi);break;case 22:if(this.flexing){this.stack.push(0);break}o=this.executeCommand(1,gi);break;case 30:o=this.executeCommand(4,pi);break;case 31:o=this.executeCommand(4,mi);break;case 3078:if(a){const e=this.stack.at(-5);this.seac=this.stack.splice(-4,4);this.seac[0]+=this.lsb-e;o=this.executeCommand(0,di)}else o=this.executeCommand(4,di);break;case 3079:if(this.stack.length<4){o=!0;break}this.stack.pop();i=this.stack.pop();const e=this.stack.pop();n=this.stack.pop();this.lsb=n;this.width=i;this.stack.push(i,n,e);o=this.executeCommand(3,fi);break;case 3084:if(this.stack.length<2){o=!0;break}const c=this.stack.pop(),l=this.stack.pop();this.stack.push(l/c);break;case 3088:if(this.stack.length<2){o=!0;break}s=this.stack.pop();const h=this.stack.pop();if(0===s&&3===h){const e=this.stack.splice(-17,17);this.stack.push(e[2]+e[0],e[3]+e[1],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14]);o=this.executeCommand(13,ui,!0);this.flexing=!1;this.stack.push(e[15],e[16])}else 1===s&&0===h&&(this.flexing=!0);break;case 3089:break;default:warn(\'Unknown type 1 charstring command of "\'+r+\'"\')}if(o)break}else{r<=246?r-=139:r=r<=250?256*(r-247)+e[++c]+108:r<=254?-256*(r-251)-e[++c]-108:(255&e[++c])<<24|(255&e[++c])<<16|(255&e[++c])<<8|255&e[++c];this.stack.push(r)}}return o}executeCommand(e,t,a){const r=this.stack.length;if(e>r)return!0;const i=r-e;for(let e=i;e<r;e++){let t=this.stack[e];if(Number.isInteger(t))this.output.push(28,t>>8&255,255&t);else{t=65536*t|0;this.output.push(255,t>>24&255,t>>16&255,t>>8&255,255&t)}}this.output.push(...t);a?this.stack.splice(i,e):this.stack.length=0;return!1}}function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function decrypt(e,t,a){if(a>=e.length)return new Uint8Array(0);let r,i,n=0|t;for(r=0;r<a;r++)n=52845*(e[r]+n)+22719&65535;const s=e.length-a,o=new Uint8Array(s);for(r=a,i=0;i<s;r++,i++){const t=e[r];o[i]=t^n>>8;n=52845*(t+n)+22719&65535}return o}function isSpecial(e){return 47===e||91===e||93===e||123===e||125===e||40===e||41===e}class Type1Parser{constructor(e,t,a){if(t){const t=e.getBytes(),a=!((isHexDigit(t[0])||isWhiteSpace(t[0]))&&isHexDigit(t[1])&&isHexDigit(t[2])&&isHexDigit(t[3])&&isHexDigit(t[4])&&isHexDigit(t[5])&&isHexDigit(t[6])&&isHexDigit(t[7]));e=new Stream(a?decrypt(t,55665,4):function decryptAscii(e,t,a){let r=0|t;const i=e.length,n=new Uint8Array(i>>>1);let s,o;for(s=0,o=0;s<i;s++){const t=e[s];if(!isHexDigit(t))continue;s++;let a;for(;s<i&&!isHexDigit(a=e[s]);)s++;if(s<i){const e=parseInt(String.fromCharCode(t,a),16);n[o++]=e^r>>8;r=52845*(e+r)+22719&65535}}return n.slice(a,o)}(t,55665,4))}this.seacAnalysisEnabled=!!a;this.stream=e;this.nextChar()}readNumberArray(){this.getToken();const e=[];for(;;){const t=this.getToken();if(null===t||"]"===t||"}"===t)break;e.push(parseFloat(t||0))}return e}readNumber(){const e=this.getToken();return parseFloat(e||0)}readInt(){const e=this.getToken();return 0|parseInt(e||0,10)}readBoolean(){return"true"===this.getToken()?1:0}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){this.stream.skip(-2);return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(-1===t)return null;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!isWhiteSpace(t))break;t=this.nextChar()}if(isSpecial(t)){this.nextChar();return String.fromCharCode(t)}let a="";do{a+=String.fromCharCode(t);t=this.nextChar()}while(t>=0&&!isWhiteSpace(t)&&!isSpecial(t));return a}readCharStrings(e,t){return-1===t?e:decrypt(e,4330,t)}extractFontProgram(e){const t=this.stream,a=[],r=[],i=Object.create(null);i.lenIV=4;const n={subrs:[],charstrings:[],properties:{privateData:i}};let s,o,c,l;for(;null!==(s=this.getToken());)if("/"===s){s=this.getToken();switch(s){case"CharStrings":this.getToken();this.getToken();this.getToken();this.getToken();for(;;){s=this.getToken();if(null===s||"end"===s)break;if("/"!==s)continue;const e=this.getToken();o=this.readInt();this.getToken();c=o>0?t.getBytes(o):new Uint8Array(0);l=n.properties.privateData.lenIV;const a=this.readCharStrings(c,l);this.nextChar();s=this.getToken();"noaccess"===s?this.getToken():"/"===s&&this.prevChar();r.push({glyph:e,encoded:a})}break;case"Subrs":this.readInt();this.getToken();for(;"dup"===this.getToken();){const e=this.readInt();o=this.readInt();this.getToken();c=o>0?t.getBytes(o):new Uint8Array(0);l=n.properties.privateData.lenIV;const r=this.readCharStrings(c,l);this.nextChar();s=this.getToken();"noaccess"===s&&this.getToken();a[e]=r}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":const e=this.readNumberArray();e.length>0&&e.length,0;break;case"StemSnapH":case"StemSnapV":n.properties.privateData[s]=this.readNumberArray();break;case"StdHW":case"StdVW":n.properties.privateData[s]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":n.properties.privateData[s]=this.readNumber();break;case"ExpansionFactor":n.properties.privateData[s]=this.readNumber()||.06;break;case"ForceBold":n.properties.privateData[s]=this.readBoolean()}}for(const{encoded:t,glyph:i}of r){const r=new Type1CharString,s=r.convert(t,a,this.seacAnalysisEnabled);let o=r.output;s&&(o=[14]);const c={glyphName:i,charstring:o,width:r.width,lsb:r.lsb,seac:r.seac};".notdef"===i?n.charstrings.unshift(c):n.charstrings.push(c);if(e.builtInEncoding){const t=e.builtInEncoding.indexOf(i);t>-1&&void 0===e.widths[t]&&t>=e.firstChar&&t<=e.lastChar&&(e.widths[t]=r.width)}}return n}extractFontHeader(e){let t;for(;null!==(t=this.getToken());)if("/"===t){t=this.getToken();switch(t){case"FontMatrix":const a=this.readNumberArray();e.fontMatrix=a;break;case"Encoding":const r=this.getToken();let i;if(/^\\d+$/.test(r)){i=[];const e=0|parseInt(r,10);this.getToken();for(let a=0;a<e;a++){t=this.getToken();for(;"dup"!==t&&"def"!==t;){t=this.getToken();if(null===t)return}if("def"===t)break;const e=this.readInt();this.getToken();const a=this.getToken();i[e]=a;this.getToken()}}else i=getEncoding(r);e.builtInEncoding=i;break;case"FontBBox":const n=this.readNumberArray();e.ascent=Math.max(n[3],n[1]);e.descent=Math.min(n[1],n[3]);e.ascentScaled=!0}}}}function findBlock(e,t,a){const r=e.length,i=t.length,n=r-i;let s=a,o=!1;for(;s<n;){let a=0;for(;a<i&&e[s+a]===t[a];)a++;if(a>=i){s+=a;for(;s<r&&isWhiteSpace(e[s]);)s++;o=!0;break}s++}return{found:o,length:s}}class Type1Font{constructor(e,t,a){let r=a.length1,i=a.length2,n=t.peekBytes(6);const s=128===n[0]&&1===n[1];if(s){t.skip(6);r=n[5]<<24|n[4]<<16|n[3]<<8|n[2]}const o=function getHeaderBlock(e,t){const a=[101,101,120,101,99],r=e.pos;let i,n,s,o;try{i=e.getBytes(t);n=i.length}catch{}if(n===t){s=findBlock(i,a,t-2*a.length);if(s.found&&s.length===t)return{stream:new Stream(i),length:t}}warn(\'Invalid "Length1" property in Type1 font -- trying to recover.\');e.pos=r;for(;;){s=findBlock(e.peekBytes(2048),a,0);if(0===s.length)break;e.pos+=s.length;if(s.found){o=e.pos-r;break}}e.pos=r;if(o)return{stream:new Stream(e.getBytes(o)),length:o};warn(\'Unable to recover "Length1" property in Type1 font -- using as is.\');return{stream:new Stream(e.getBytes(t)),length:t}}(t,r);new Type1Parser(o.stream,!1,Rr).extractFontHeader(a);if(s){n=t.getBytes(6);i=n[5]<<24|n[4]<<16|n[3]<<8|n[2]}const c=function getEexecBlock(e,t){const a=e.getBytes();if(0===a.length)throw new FormatError("getEexecBlock - no font program found.");return{stream:new Stream(a),length:a.length}}(t),l=new Type1Parser(c.stream,!0,Rr).extractFontProgram(a);for(const e in l.properties)a[e]=l.properties[e];const h=l.charstrings,u=this.getType2Charstrings(h),d=this.getType2Subrs(l.subrs);this.charstrings=h;this.data=this.wrap(e,u,this.charstrings,d,a);this.seacs=this.getSeacs(l.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){const e=[".notdef"];for(const{glyphName:t}of this.charstrings)e.push(t);return e}getGlyphMapping(e){const t=this.charstrings;if(e.composite){const a=Object.create(null);for(let r=0,i=t.length;r<i;r++){a[e.cMap.charCodeOf(r)]=r+1}return a}const a=[".notdef"];let r,i;for(i=0;i<t.length;i++)a.push(t[i].glyphName);const n=e.builtInEncoding;if(n){r=Object.create(null);for(const e in n){i=a.indexOf(n[e]);i>=0&&(r[e]=i)}}return type1FontGlyphMapping(e,r,a)}hasGlyphId(e){if(e<0||e>=this.numGlyphs)return!1;if(0===e)return!0;return this.charstrings[e-1].charstring.length>0}getSeacs(e){const t=[];for(let a=0,r=e.length;a<r;a++){const r=e[a];r.seac&&(t[a+1]=r.seac)}return t}getType2Charstrings(e){const t=[];for(const a of e)t.push(a.charstring);return t}getType2Subrs(e){let t=0;const a=e.length;t=a<1133?107:a<33769?1131:32768;const r=[];let i;for(i=0;i<t;i++)r.push([11]);for(i=0;i<a;i++)r.push(e[i]);return r}wrap(e,t,a,r,i){const n=new CFF;n.header=new CFFHeader(1,0,4,4);n.names=[e];const s=new CFFTopDict;s.setByName("version",391);s.setByName("Notice",392);s.setByName("FullName",393);s.setByName("FamilyName",394);s.setByName("Weight",395);s.setByName("Encoding",null);s.setByName("FontMatrix",i.fontMatrix);s.setByName("FontBBox",i.bbox);s.setByName("charset",null);s.setByName("CharStrings",null);s.setByName("Private",null);n.topDict=s;const o=new CFFStrings;o.add("Version 0.11");o.add("See original notice");o.add(e);o.add(e);o.add("Medium");n.strings=o;n.globalSubrIndex=new CFFIndex;const c=t.length,l=[".notdef"];let h,u;for(h=0;h<c;h++){const e=a[h].glyphName;-1===Hr.indexOf(e)&&o.add(e);l.push(e)}n.charset=new CFFCharset(!1,0,l);const d=new CFFIndex;d.add([139,14]);for(h=0;h<c;h++)d.add(t[h]);n.charStrings=d;const f=new CFFPrivateDict;f.setByName("Subrs",null);const g=["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"];for(h=0,u=g.length;h<u;h++){const e=g[h];if(!(e in i.privateData))continue;const t=i.privateData[e];if(Array.isArray(t))for(let e=t.length-1;e>0;e--)t[e]-=t[e-1];f.setByName(e,t)}n.topDict.privateDict=f;const p=new CFFIndex;for(h=0,u=r.length;h<u;h++)p.add(r[h]);f.subrsIndex=p;return new CFFCompiler(n).compile()}}const bi=[[57344,63743],[1048576,1114109]],yi=1e3,wi=["ascent","bbox","black","bold","charProcOperatorList","cssFontInfo","data","defaultVMetrics","defaultWidth","descent","disableFontFace","fallbackName","fontExtraProperties","fontMatrix","isInvalidPDFjsFont","isType3Font","italic","loadedName","mimetype","missingFile","name","remeasure","systemFontInfo","vertical"],xi=["cMap","composite","defaultEncoding","differences","isMonospace","isSerifFont","isSymbolicFont","seacMap","subtype","toFontChar","toUnicode","type","vmetrics","widths"];function adjustWidths(e){if(!e.fontMatrix)return;if(e.fontMatrix[0]===t[0])return;const a=.001/e.fontMatrix[0],r=e.widths;for(const e in r)r[e]*=a;e.defaultWidth*=a}function amendFallbackToUnicode(e){if(!e.fallbackToUnicode)return;if(e.toUnicode instanceof IdentityToUnicodeMap)return;const t=[];for(const a in e.fallbackToUnicode)e.toUnicode.has(a)||(t[a]=e.fallbackToUnicode[a]);t.length>0&&e.toUnicode.amend(t)}class fonts_Glyph{constructor(e,t,a,r,i,n,s,o,c){this.originalCharCode=e;this.fontChar=t;this.unicode=a;this.accent=r;this.width=i;this.vmetric=n;this.operatorListId=s;this.isSpace=o;this.isInFont=c}get category(){return shadow(this,"category",function getCharUnicodeCategory(e){const t=Dr.get(e);if(t)return t;const a=e.match(Mr),r={isWhitespace:!!a?.[1],isZeroWidthDiacritic:!!a?.[2],isInvisibleFormatMark:!!a?.[3]};Dr.set(e,r);return r}(this.unicode),!0)}}function int16(e,t){return(e<<8)+t}function writeSignedInt16(e,t,a){e[t+1]=a;e[t]=a>>>8}function signedInt16(e,t){const a=(e<<8)+t;return 32768&a?a-65536:a}function string16(e){return String.fromCharCode(e>>8&255,255&e)}function safeString16(e){e>32767?e=32767:e<-32768&&(e=-32768);return String.fromCharCode(e>>8&255,255&e)}function isTrueTypeCollectionFile(e){return"ttcf"===bytesToString(e.peekBytes(4))}function getFontFileType(e,{type:t,subtype:a,composite:r}){let i,n;if(function isTrueTypeFile(e){const t=e.peekBytes(4);return 65536===readUint32(t,0)||"true"===bytesToString(t)}(e)||isTrueTypeCollectionFile(e))i=r?"CIDFontType2":"TrueType";else if(function isOpenTypeFile(e){return"OTTO"===bytesToString(e.peekBytes(4))}(e))i=r?"CIDFontType2":"OpenType";else if(function isType1File(e){const t=e.peekBytes(2);return 37===t[0]&&33===t[1]||128===t[0]&&1===t[1]}(e))i=r?"CIDFontType0":"MMType1"===t?"MMType1":"Type1";else if(function isCFFFile(e){const t=e.peekBytes(4);return t[0]>=1&&t[3]>=1&&t[3]<=4}(e))if(r){i="CIDFontType0";n="CIDFontType0C"}else{i="MMType1"===t?"MMType1":"Type1";n="Type1C"}else{warn("getFontFileType: Unable to detect correct font file Type/Subtype.");i=t;n=a}return[i,n]}function applyStandardFontGlyphMap(e,t){for(const a in t)e[+a]=t[a]}function buildToFontChar(e,t,a){const r=[];let i;for(let a=0,n=e.length;a<n;a++){i=getUnicodeForGlyph(e[a],t);-1!==i&&(r[a]=i)}for(const e in a){i=getUnicodeForGlyph(a[e],t);-1!==i&&(r[+e]=i)}return r}function isMacNameRecord(e){return 1===e.platform&&0===e.encoding&&0===e.language}function isWinNameRecord(e){return 3===e.platform&&1===e.encoding&&1033===e.language}function convertCidString(e,t,a=!1){switch(t.length){case 1:return t.charCodeAt(0);case 2:return t.charCodeAt(0)<<8|t.charCodeAt(1)}const r=`Unsupported CID string (charCode ${e}): "${t}".`;if(a)throw new FormatError(r);warn(r);return t}function adjustMapping(e,t,a,r){const i=Object.create(null),n=new Map,s=[],o=new Set;let c=0;let l=bi[c][0],h=bi[c][1];let u=null;for(const f in e){let g=e[f];if(!t(g))continue;if(l>h){c++;if(c>=bi.length){warn("Ran out of space in font private use area.");break}l=bi[c][0];h=bi[c][1]}const p=l++;0===g&&(g=a);let m=r.get(f);if("string"==typeof m)if(1===m.length)m=m.codePointAt(0);else{if(!u){u=new Map;for(let e=64256;e<=64335;e++){const t=String.fromCharCode(e).normalize("NFKD");t.length>1&&u.set(t,e)}}m=u.get(m)||m.codePointAt(0)}if(m&&!(d=m,bi[0][0]<=d&&d<=bi[0][1]||bi[1][0]<=d&&d<=bi[1][1])&&!o.has(g)){n.set(m,g);o.add(g)}i[p]=g;s[f]=p}var d;return{toFontChar:s,charCodeToGlyphId:i,toUnicodeExtraMap:n,nextAvailableFontCharCode:l}}function createCmapTable(e,t,a){const r=function getRanges(e,t,a){const r=[];for(const t in e)e[t]>=a||r.push({fontCharCode:0|t,glyphId:e[t]});if(t)for(const[e,i]of t)i>=a||r.push({fontCharCode:e,glyphId:i});0===r.length&&r.push({fontCharCode:0,glyphId:0});r.sort(((e,t)=>e.fontCharCode-t.fontCharCode));const i=[],n=r.length;for(let e=0;e<n;){const t=r[e].fontCharCode,a=[r[e].glyphId];++e;let s=t;for(;e<n&&s+1===r[e].fontCharCode;){a.push(r[e].glyphId);++s;++e;if(65535===s)break}i.push([t,s,a])}return i}(e,t,a),i=r.at(-1)[1]>65535?2:1;let n,s,o,c,l="\\0\\0"+string16(i)+"\\0\\0"+string32(4+8*i);for(n=r.length-1;n>=0&&!(r[n][0]<=65535);--n);const h=n+1;r[n][0]<65535&&65535===r[n][1]&&(r[n][1]=65534);const u=r[n][1]<65535?1:0,d=h+u,f=OpenTypeFileBuilder.getSearchParams(d,2);let g,p,m,b,y="",w="",x="",S="",k="",C=0;for(n=0,s=h;n<s;n++){g=r[n];p=g[0];m=g[1];y+=string16(p);w+=string16(m);b=g[2];let e=!0;for(o=1,c=b.length;o<c;++o)if(b[o]!==b[o-1]+1){e=!1;break}if(e){x+=string16(b[0]-p&65535);S+=string16(0)}else{const e=2*(d-n)+2*C;C+=m-p+1;x+=string16(0);S+=string16(e);for(o=0,c=b.length;o<c;++o)k+=string16(b[o])}}if(u>0){w+="ÿÿ";y+="ÿÿ";x+="\\0";S+="\\0\\0"}const v="\\0\\0"+string16(2*d)+string16(f.range)+string16(f.entry)+string16(f.rangeShift)+w+"\\0\\0"+y+x+S+k;let F="",T="";if(i>1){l+="\\0\\0\\n"+string32(4+8*i+4+v.length);F="";for(n=0,s=r.length;n<s;n++){g=r[n];p=g[0];b=g[2];let e=b[0];for(o=1,c=b.length;o<c;++o)if(b[o]!==b[o-1]+1){m=g[0]+o-1;F+=string32(p)+string32(m)+string32(e);p=m+1;e=b[o]}F+=string32(p)+string32(g[1])+string32(e)}T="\\0\\f\\0\\0"+string32(F.length+16)+"\\0\\0\\0\\0"+string32(F.length/12)}return l+"\\0"+string16(v.length+4)+v+T+F}function createOS2Table(e,t,a){a||={unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};let r=0,i=0,n=0,s=0,o=null,c=0,l=-1;if(t){for(let e in t){e|=0;(o>e||!o)&&(o=e);c<e&&(c=e);l=getUnicodeRangeFor(e,l);if(l<32)r|=1<<l;else if(l<64)i|=1<<l-32;else if(l<96)n|=1<<l-64;else{if(!(l<123))throw new FormatError("Unicode ranges Bits > 123 are reserved for internal usage");s|=1<<l-96}}c>65535&&(c=65535)}else{o=0;c=255}const h=e.bbox||[0,0,0,0],u=a.unitsPerEm||(e.fontMatrix?1/Math.max(...e.fontMatrix.slice(0,4).map(Math.abs)):1e3),d=e.ascentScaled?1:u/yi,f=a.ascent||Math.round(d*(e.ascent||h[3]));let g=a.descent||Math.round(d*(e.descent||h[1]));g>0&&e.descent>0&&h[1]<0&&(g=-g);const p=a.yMax||f,m=-a.yMin||-g;return"\\0$ô\\0\\0\\0Š»\\0\\0\\0ŒŠ»\\0\\0ß\\x001\\0\\0\\0\\0"+String.fromCharCode(e.fixedPitch?9:0)+"\\0\\0\\0\\0\\0\\0"+string32(r)+string32(i)+string32(n)+string32(s)+"*21*"+string16(e.italicAngle?1:0)+string16(o||e.firstChar)+string16(c||e.lastChar)+string16(f)+string16(g)+"\\0d"+string16(p)+string16(m)+"\\0\\0\\0\\0\\0\\0\\0\\0"+string16(e.xHeight)+string16(e.capHeight)+string16(0)+string16(o||e.firstChar)+"\\0"}function createPostTable(e){return"\\0\\0\\0"+string32(Math.floor(65536*e.italicAngle))+"\\0\\0\\0\\0"+string32(e.fixedPitch?1:0)+"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"}function createPostscriptName(e){return e.replaceAll(/[^\\x21-\\x7E]|[[\\](){}<>/%]/g,"").slice(0,63)}function createNameTable(e,t){t||(t=[[],[]]);const a=[t[0][0]||"Original licence",t[0][1]||e,t[0][2]||"Unknown",t[0][3]||"uniqueID",t[0][4]||e,t[0][5]||"Version 0.11",t[0][6]||createPostscriptName(e),t[0][7]||"Unknown",t[0][8]||"Unknown",t[0][9]||"Unknown"],r=[];let i,n,s,o,c;for(i=0,n=a.length;i<n;i++){c=t[1][i]||a[i];const e=[];for(s=0,o=c.length;s<o;s++)e.push(string16(c.charCodeAt(s)));r.push(e.join(""))}const l=[a,r],h=["\\0","\\0"],u=["\\0\\0","\\0"],d=["\\0\\0","\\t"],f=a.length*h.length;let g="\\0\\0"+string16(f)+string16(12*f+6),p=0;for(i=0,n=h.length;i<n;i++){const e=l[i];for(s=0,o=e.length;s<o;s++){c=e[s];g+=h[i]+u[i]+d[i]+string16(s)+string16(c.length)+string16(p);p+=c.length}}g+=a.join("")+r.join("");return g}class Font{constructor(e,t,a,r){this.name=e;this.psName=null;this.mimetype=null;this.disableFontFace=r.disableFontFace;this.fontExtraProperties=r.fontExtraProperties;this.loadedName=a.loadedName;this.isType3Font=a.isType3Font;this.missingFile=!1;this.cssFontInfo=a.cssFontInfo;this._charsCache=Object.create(null);this._glyphCache=Object.create(null);let i=!!(a.flags&Er);if(!i&&!a.isSimulatedFlags){const t=e.replaceAll(/[,_]/g,"-").split("-",1)[0],a=Qr();for(const e of t.split("+"))if(a[e]){i=!0;break}}this.isSerifFont=i;this.isSymbolicFont=!!(a.flags&Pr);this.isMonospace=!!(a.flags&Nr);let{type:n,subtype:s}=a;this.type=n;this.subtype=s;this.systemFontInfo=a.systemFontInfo;const o=e.match(/^InvalidPDFjsFont_(.*)_\\d+$/);this.isInvalidPDFjsFont=!!o;this.isInvalidPDFjsFont?this.fallbackName=o[1]:this.isMonospace?this.fallbackName="monospace":this.isSerifFont?this.fallbackName="serif":this.fallbackName="sans-serif";if(this.systemFontInfo?.guessFallback){this.systemFontInfo.guessFallback=!1;this.systemFontInfo.css+=`,${this.fallbackName}`}this.differences=a.differences;this.widths=a.widths;this.defaultWidth=a.defaultWidth;this.composite=a.composite;this.cMap=a.cMap;this.capHeight=a.capHeight/yi;this.ascent=a.ascent/yi;this.descent=a.descent/yi;this.lineHeight=this.ascent-this.descent;this.fontMatrix=a.fontMatrix;this.bbox=a.bbox;this.defaultEncoding=a.defaultEncoding;this.toUnicode=a.toUnicode;this.toFontChar=[];if("Type3"===a.type){for(let e=0;e<256;e++)this.toFontChar[e]=this.differences[e]||a.defaultEncoding[e];return}this.cidEncoding=a.cidEncoding||"";this.vertical=!!a.vertical;if(this.vertical){this.vmetrics=a.vmetrics;this.defaultVMetrics=a.defaultVMetrics}if(!t||t.isEmpty){t&&warn(\'Font file is empty in "\'+e+\'" (\'+this.loadedName+")");this.fallbackToSystemFont(a);return}[n,s]=getFontFileType(t,a);n===this.type&&s===this.subtype||info(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${n}/${s}.`);let c;try{switch(n){case"MMType1":info("MMType1 font ("+e+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";const r="Type1C"===s||"CIDFontType0C"===s?new CFFFont(t,a):new Type1Font(e,t,a);adjustWidths(a);c=this.convert(e,r,a);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype";c=this.checkAndRepair(e,t,a);adjustWidths(a);this.isOpenType&&(n="OpenType");break;default:throw new FormatError(`Font ${n} is not supported`)}}catch(e){warn(e);this.fallbackToSystemFont(a);return}amendFallbackToUnicode(a);this.data=c;this.type=n;this.subtype=s;this.fontMatrix=a.fontMatrix;this.widths=a.widths;this.defaultWidth=a.defaultWidth;this.toUnicode=a.toUnicode;this.seacMap=a.seacMap}get renderer(){return shadow(this,"renderer",FontRendererFactory.create(this,Rr))}exportData(){const e=this.fontExtraProperties?[...wi,...xi]:wi,t=Object.create(null);for(const a of e){const e=this[a];void 0!==e&&(t[a]=e)}return t}fallbackToSystemFont(e){this.missingFile=!0;const{name:t,type:a}=this;let r=normalizeFontName(t);const i=Jr(),n=Zr(),s=!!i[r],o=!(!n[r]||!i[n[r]]);r=i[r]||n[r]||r;const c=ni()[r];if(c){isNaN(this.ascent)&&(this.ascent=c.ascent/yi);isNaN(this.descent)&&(this.descent=c.descent/yi);isNaN(this.capHeight)&&(this.capHeight=c.capHeight/yi)}this.bold=/bold/gi.test(r);this.italic=/oblique|italic/gi.test(r);this.black=/Black/g.test(t);const l=/Narrow/g.test(t);this.remeasure=(!s||l)&&Object.keys(this.widths).length>0;if((s||o)&&"CIDFontType2"===a&&this.cidEncoding.startsWith("Identity-")){const a=e.cidToGidMap,r=[];applyStandardFontGlyphMap(r,ti());/Arial-?Black/i.test(t)?applyStandardFontGlyphMap(r,ai()):/Calibri/i.test(t)&&applyStandardFontGlyphMap(r,ri());if(a){for(const e in r){const t=r[e];void 0!==a[t]&&(r[+e]=a[t])}a.length!==this.toUnicode.length&&e.hasIncludedToUnicodeMap&&this.toUnicode instanceof IdentityToUnicodeMap&&this.toUnicode.forEach((function(e,t){const i=r[e];void 0===a[i]&&(r[+e]=t)}))}this.toUnicode instanceof IdentityToUnicodeMap||this.toUnicode.forEach((function(e,t){r[+e]=t}));this.toFontChar=r;this.toUnicode=new ToUnicodeMap(r)}else if(/Symbol/i.test(r))this.toFontChar=buildToFontChar(Cr,Fr(),this.differences);else if(/Dingbats/i.test(r))this.toFontChar=buildToFontChar(vr,Ir(),this.differences);else if(s||o){const e=buildToFontChar(this.defaultEncoding,Fr(),this.differences);"CIDFontType2"!==a||this.cidEncoding.startsWith("Identity-")||this.toUnicode instanceof IdentityToUnicodeMap||this.toUnicode.forEach((function(t,a){e[+t]=a}));this.toFontChar=e}else{const e=Fr(),a=[];this.toUnicode.forEach(((t,r)=>{if(!this.composite){const a=getUnicodeForGlyph(this.differences[t]||this.defaultEncoding[t],e);-1!==a&&(r=a)}a[+t]=r}));this.composite&&this.toUnicode instanceof IdentityToUnicodeMap&&/Tahoma|Verdana/i.test(t)&&applyStandardFontGlyphMap(a,ti());this.toFontChar=a}amendFallbackToUnicode(e);this.loadedName=r.split("-",1)[0]}checkAndRepair(e,t,a){const r=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function readTables(e,t){const a=Object.create(null);a["OS/2"]=null;a.cmap=null;a.head=null;a.hhea=null;a.hmtx=null;a.maxp=null;a.name=null;a.post=null;for(let i=0;i<t;i++){const t=readTableEntry(e);r.includes(t.tag)&&(0!==t.length&&(a[t.tag]=t))}return a}function readTableEntry(e){const t=e.getString(4),a=e.getInt32()>>>0,r=e.getInt32()>>>0,i=e.getInt32()>>>0,n=e.pos;e.pos=e.start||0;e.skip(r);const s=e.getBytes(i);e.pos=n;if("head"===t){s[8]=s[9]=s[10]=s[11]=0;s[17]|=32}return{tag:t,checksum:a,length:i,offset:r,data:s}}function readOpenTypeHeader(e){return{version:e.getString(4),numTables:e.getUint16(),searchRange:e.getUint16(),entrySelector:e.getUint16(),rangeShift:e.getUint16()}}function sanitizeGlyph(e,t,a,r,i,n){const s={length:0,sizeOfInstructions:0};if(t<0||t>=e.length||a>e.length||a-t<=12)return s;const o=e.subarray(t,a),c=signedInt16(o[2],o[3]),l=signedInt16(o[4],o[5]),h=signedInt16(o[6],o[7]),u=signedInt16(o[8],o[9]);if(c>h){writeSignedInt16(o,2,h);writeSignedInt16(o,6,c)}if(l>u){writeSignedInt16(o,4,u);writeSignedInt16(o,8,l)}const d=signedInt16(o[0],o[1]);if(d<0){if(d<-1)return s;r.set(o,i);s.length=o.length;return s}let f,g=10,p=0;for(f=0;f<d;f++){p=(o[g]<<8|o[g+1])+1;g+=2}const m=g,b=o[g]<<8|o[g+1];s.sizeOfInstructions=b;g+=2+b;const y=g;let w=0;for(f=0;f<p;f++){const e=o[g++];192&e&&(o[g-1]=63&e);let t=2;2&e?t=1:16&e&&(t=0);let a=2;4&e?a=1:32&e&&(a=0);const r=t+a;w+=r;if(8&e){const e=o[g++];0===e&&(o[g-1]^=8);f+=e;w+=e*r}}if(0===w)return s;let x=g+w;if(x>o.length)return s;if(!n&&b>0){r.set(o.subarray(0,m),i);r.set([0,0],i+m);r.set(o.subarray(y,x),i+m+2);x-=b;o.length-x>3&&(x=x+3&-4);s.length=x;return s}if(o.length-x>3){x=x+3&-4;r.set(o.subarray(0,x),i);s.length=x;return s}r.set(o,i);s.length=o.length;return s}function readNameTable(e){const a=(t.start||0)+e.offset;t.pos=a;const r=[[],[]],i=[],n=e.length,s=a+n;if(0!==t.getUint16()||n<6)return[r,i];const o=t.getUint16(),c=t.getUint16();let l,h;for(l=0;l<o&&t.pos+12<=s;l++){const e={platform:t.getUint16(),encoding:t.getUint16(),language:t.getUint16(),name:t.getUint16(),length:t.getUint16(),offset:t.getUint16()};(isMacNameRecord(e)||isWinNameRecord(e))&&i.push(e)}for(l=0,h=i.length;l<h;l++){const e=i[l];if(e.length<=0)continue;const n=a+c+e.offset;if(n+e.length>s)continue;t.pos=n;const o=e.name;if(e.encoding){let a="";for(let r=0,i=e.length;r<i;r+=2)a+=String.fromCharCode(t.getUint16());r[1][o]=a}else r[0][o]=t.getString(e.length)}return[r,i]}const i=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];function sanitizeTTProgram(e,t){let a,r,n,s,o,c=e.data,l=0,h=0,u=0;const d=[],f=[],g=[];let p=t.tooComplexToFollowFunctions,m=!1,b=0,y=0;for(let e=c.length;l<e;){const e=c[l++];if(64===e){r=c[l++];if(m||y)l+=r;else for(a=0;a<r;a++)d.push(c[l++])}else if(65===e){r=c[l++];if(m||y)l+=2*r;else for(a=0;a<r;a++){n=c[l++];d.push(n<<8|c[l++])}}else if(176==(248&e)){r=e-176+1;if(m||y)l+=r;else for(a=0;a<r;a++)d.push(c[l++])}else if(184==(248&e)){r=e-184+1;if(m||y)l+=2*r;else for(a=0;a<r;a++){n=c[l++];d.push(signedInt16(n,c[l++]))}}else if(43!==e||p)if(44!==e||p){if(45===e)if(m){m=!1;h=l}else{o=f.pop();if(!o){warn("TT: ENDF bad stack");t.hintsValid=!1;return}s=g.pop();c=o.data;l=o.i;t.functionsStackDeltas[s]=d.length-o.stackTop}else if(137===e){if(m||y){warn("TT: nested IDEFs not allowed");p=!0}m=!0;u=l}else if(88===e)++b;else if(27===e)y=b;else if(89===e){y===b&&(y=0);--b}else if(28===e&&!m&&!y){const e=d.at(-1);e>0&&(l+=e-1)}}else{if(m||y){warn("TT: nested FDEFs not allowed");p=!0}m=!0;u=l;s=d.pop();t.functionsDefined[s]={data:c,i:l}}else if(!m&&!y){s=d.at(-1);if(isNaN(s))info("TT: CALL empty stack (or invalid entry).");else{t.functionsUsed[s]=!0;if(s in t.functionsStackDeltas){const e=d.length+t.functionsStackDeltas[s];if(e<0){warn("TT: CALL invalid functions stack delta.");t.hintsValid=!1;return}d.length=e}else if(s in t.functionsDefined&&!g.includes(s)){f.push({data:c,i:l,stackTop:d.length-1});g.push(s);o=t.functionsDefined[s];if(!o){warn("TT: CALL non-existent function");t.hintsValid=!1;return}c=o.data;l=o.i}}}if(!m&&!y){let t=0;e<=142?t=i[e]:e>=192&&e<=223?t=-1:e>=224&&(t=-2);if(e>=113&&e<=117){r=d.pop();isNaN(r)||(t=2*-r)}for(;t<0&&d.length>0;){d.pop();t++}for(;t>0;){d.push(NaN);t--}}}t.tooComplexToFollowFunctions=p;const w=[c];l>c.length&&w.push(new Uint8Array(l-c.length));if(u>h){warn("TT: complementing a missing function tail");w.push(new Uint8Array([34,45]))}!function foldTTTable(e,t){if(t.length>1){let a,r,i=0;for(a=0,r=t.length;a<r;a++)i+=t[a].length;i=i+3&-4;const n=new Uint8Array(i);let s=0;for(a=0,r=t.length;a<r;a++){n.set(t[a],s);s+=t[a].length}e.data=n;e.length=i}}(e,w)}let n,s,o,c;if(isTrueTypeCollectionFile(t=new Stream(new Uint8Array(t.getBytes())))){const e=function readTrueTypeCollectionData(e,t){const{numFonts:a,offsetTable:r}=function readTrueTypeCollectionHeader(e){const t=e.getString(4);assert("ttcf"===t,"Must be a TrueType Collection font.");const a=e.getUint16(),r=e.getUint16(),i=e.getInt32()>>>0,n=[];for(let t=0;t<i;t++)n.push(e.getInt32()>>>0);const s={ttcTag:t,majorVersion:a,minorVersion:r,numFonts:i,offsetTable:n};switch(a){case 1:return s;case 2:s.dsigTag=e.getInt32()>>>0;s.dsigLength=e.getInt32()>>>0;s.dsigOffset=e.getInt32()>>>0;return s}throw new FormatError(`Invalid TrueType Collection majorVersion: ${a}.`)}(e),i=t.split("+");let n;for(let s=0;s<a;s++){e.pos=(e.start||0)+r[s];const a=readOpenTypeHeader(e),o=readTables(e,a.numTables);if(!o.name)throw new FormatError(\'TrueType Collection font must contain a "name" table.\');const[c]=readNameTable(o.name);for(let e=0,r=c.length;e<r;e++)for(let r=0,s=c[e].length;r<s;r++){const s=c[e][r]?.replaceAll(/\\s/g,"");if(s){if(s===t)return{header:a,tables:o};if(!(i.length<2))for(const e of i)s===e&&(n={name:e,header:a,tables:o})}}}if(n){warn(`TrueType Collection does not contain "${t}" font, falling back to "${n.name}" font instead.`);return{header:n.header,tables:n.tables}}throw new FormatError(`TrueType Collection does not contain "${t}" font.`)}(t,this.name);n=e.header;s=e.tables}else{n=readOpenTypeHeader(t);s=readTables(t,n.numTables)}const l=!s["CFF "];if(l){if(!s.loca)throw new FormatError(\'Required "loca" table is not found\');if(!s.glyf){warn(\'Required "glyf" table is not found -- trying to recover.\');s.glyf={tag:"glyf",data:new Uint8Array(0)}}this.isOpenType=!1}else{const t=a.composite&&(a.cidToGidMap?.length>0||!(a.cMap instanceof IdentityCMap));if("OTTO"===n.version&&!t||!s.head||!s.hhea||!s.maxp||!s.post){c=new Stream(s["CFF "].data);o=new CFFFont(c,a);return this.convert(e,o,a)}delete s.glyf;delete s.loca;delete s.fpgm;delete s.prep;delete s["cvt "];this.isOpenType=!0}if(!s.maxp)throw new FormatError(\'Required "maxp" table is not found\');t.pos=(t.start||0)+s.maxp.offset;let h=t.getInt32();const u=t.getUint16();if(65536!==h&&20480!==h){if(6===s.maxp.length)h=20480;else{if(!(s.maxp.length>=32))throw new FormatError(\'"maxp" table has a wrong version number\');h=65536}!function writeUint32(e,t,a){e[t+3]=255&a;e[t+2]=a>>>8;e[t+1]=a>>>16;e[t]=a>>>24}(s.maxp.data,0,h)}if(a.scaleFactors?.length===u&&l){const{scaleFactors:e}=a,t=int16(s.head.data[50],s.head.data[51]),r=new GlyfTable({glyfTable:s.glyf.data,isGlyphLocationsLong:t,locaTable:s.loca.data,numGlyphs:u});r.scale(e);const{glyf:i,loca:n,isLocationLong:o}=r.write();s.glyf.data=i;s.loca.data=n;if(o!==!!t){s.head.data[50]=0;s.head.data[51]=o?1:0}const c=s.hmtx.data;for(let t=0;t<u;t++){const a=4*t,r=Math.round(e[t]*int16(c[a],c[a+1]));c[a]=r>>8&255;c[a+1]=255&r;writeSignedInt16(c,a+2,Math.round(e[t]*signedInt16(c[a+2],c[a+3])))}}let d=u+1,f=!0;if(d>65535){f=!1;d=u;warn("Not enough space in glyfs to duplicate first glyph.")}let g=0,p=0;if(h>=65536&&s.maxp.length>=32){t.pos+=8;if(t.getUint16()>2){s.maxp.data[14]=0;s.maxp.data[15]=2}t.pos+=4;g=t.getUint16();t.pos+=4;p=t.getUint16()}s.maxp.data[4]=d>>8;s.maxp.data[5]=255&d;const m=function sanitizeTTPrograms(e,t,a,r){const i={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};e&&sanitizeTTProgram(e,i);t&&sanitizeTTProgram(t,i);e&&function checkInvalidFunctions(e,t){if(!e.tooComplexToFollowFunctions)if(e.functionsDefined.length>t){warn("TT: more functions defined than expected");e.hintsValid=!1}else for(let a=0,r=e.functionsUsed.length;a<r;a++){if(a>t){warn("TT: invalid function id: "+a);e.hintsValid=!1;return}if(e.functionsUsed[a]&&!e.functionsDefined[a]){warn("TT: undefined function: "+a);e.hintsValid=!1;return}}}(i,r);if(a&&1&a.length){const e=new Uint8Array(a.length+1);e.set(a.data);a.data=e}return i.hintsValid}(s.fpgm,s.prep,s["cvt "],g);if(!m){delete s.fpgm;delete s.prep;delete s["cvt "]}!function sanitizeMetrics(e,t,a,r,i,n){if(!t){a&&(a.data=null);return}e.pos=(e.start||0)+t.offset;e.pos+=4;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;const s=e.getUint16();e.pos+=8;e.pos+=2;let o=e.getUint16();if(0!==s){if(!(2&int16(r.data[44],r.data[45]))){t.data[22]=0;t.data[23]=0}}if(o>i){info(`The numOfMetrics (${o}) should not be greater than the numGlyphs (${i}).`);o=i;t.data[34]=(65280&o)>>8;t.data[35]=255&o}const c=i-o-(a.length-4*o>>1);if(c>0){const e=new Uint8Array(a.length+2*c);e.set(a.data);if(n){e[a.length]=a.data[2];e[a.length+1]=a.data[3]}a.data=e}}(t,s.hhea,s.hmtx,s.head,d,f);if(!s.head)throw new FormatError(\'Required "head" table is not found\');!function sanitizeHead(e,t,a){const r=e.data,i=function int32(e,t,a,r){return(e<<24)+(t<<16)+(a<<8)+r}(r[0],r[1],r[2],r[3]);if(i>>16!=1){info("Attempting to fix invalid version in head table: "+i);r[0]=0;r[1]=1;r[2]=0;r[3]=0}const n=int16(r[50],r[51]);if(n<0||n>1){info("Attempting to fix invalid indexToLocFormat in head table: "+n);const e=t+1;if(a===e<<1){r[50]=0;r[51]=0}else{if(a!==e<<2)throw new FormatError("Could not fix indexToLocFormat: "+n);r[50]=0;r[51]=1}}}(s.head,u,l?s.loca.length:0);let b=Object.create(null);if(l){const e=int16(s.head.data[50],s.head.data[51]),t=function sanitizeGlyphLocations(e,t,a,r,i,n,s){let o,c,l;if(r){o=4;c=function fontItemDecodeLong(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};l=function fontItemEncodeLong(e,t,a){e[t]=a>>>24&255;e[t+1]=a>>16&255;e[t+2]=a>>8&255;e[t+3]=255&a}}else{o=2;c=function fontItemDecode(e,t){return e[t]<<9|e[t+1]<<1};l=function fontItemEncode(e,t,a){e[t]=a>>9&255;e[t+1]=a>>1&255}}const h=n?a+1:a,u=o*(1+h),d=new Uint8Array(u);d.set(e.data.subarray(0,u));e.data=d;const f=t.data,g=f.length,p=new Uint8Array(g);let m,b;const y=[];for(m=0,b=0;m<a+1;m++,b+=o){let e=c(d,b);e>g&&(e=g);y.push({index:m,offset:e,endOffset:0})}y.sort(((e,t)=>e.offset-t.offset));for(m=0;m<a;m++)y[m].endOffset=y[m+1].offset;y.sort(((e,t)=>e.index-t.index));for(m=0;m<a;m++){const{offset:e,endOffset:t}=y[m];if(0!==e||0!==t)break;const a=y[m+1].offset;if(0!==a){y[m].endOffset=a;break}}const w=y.at(-2);0!==w.offset&&0===w.endOffset&&(w.endOffset=g);const x=Object.create(null);let S=0;l(d,0,S);for(m=0,b=o;m<a;m++,b+=o){const e=sanitizeGlyph(f,y[m].offset,y[m].endOffset,p,S,i),t=e.length;0===t&&(x[m]=!0);e.sizeOfInstructions>s&&(s=e.sizeOfInstructions);S+=t;l(d,b,S)}if(0===S){const e=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(m=0,b=o;m<h;m++,b+=o)l(d,b,e.length);t.data=e}else if(n){const a=c(d,o);if(p.length>a+S)t.data=p.subarray(0,a+S);else{t.data=new Uint8Array(a+S);t.data.set(p.subarray(0,S))}t.data.set(p.subarray(0,a),S);l(e.data,d.length-o,S+a)}else t.data=p.subarray(0,S);return{missingGlyphs:x,maxSizeOfInstructions:s}}(s.loca,s.glyf,u,e,m,f,p);b=t.missingGlyphs;if(h>=65536&&s.maxp.length>=32){s.maxp.data[26]=t.maxSizeOfInstructions>>8;s.maxp.data[27]=255&t.maxSizeOfInstructions}}if(!s.hhea)throw new FormatError(\'Required "hhea" table is not found\');if(0===s.hhea.data[10]&&0===s.hhea.data[11]){s.hhea.data[10]=255;s.hhea.data[11]=255}const y={unitsPerEm:int16(s.head.data[18],s.head.data[19]),yMax:signedInt16(s.head.data[42],s.head.data[43]),yMin:signedInt16(s.head.data[38],s.head.data[39]),ascent:signedInt16(s.hhea.data[4],s.hhea.data[5]),descent:signedInt16(s.hhea.data[6],s.hhea.data[7]),lineGap:signedInt16(s.hhea.data[8],s.hhea.data[9])};this.ascent=y.ascent/y.unitsPerEm;this.descent=y.descent/y.unitsPerEm;this.lineGap=y.lineGap/y.unitsPerEm;if(this.cssFontInfo?.lineHeight){this.lineHeight=this.cssFontInfo.metrics.lineHeight;this.lineGap=this.cssFontInfo.metrics.lineGap}else this.lineHeight=this.ascent-this.descent+this.lineGap;s.post&&function readPostScriptTable(e,a,r){const i=(t.start||0)+e.offset;t.pos=i;const n=i+e.length,s=t.getInt32();t.skip(28);let o,c,l=!0;switch(s){case 65536:o=jr;break;case 131072:const e=t.getUint16();if(e!==r){l=!1;break}const i=[];for(c=0;c<e;++c){const e=t.getUint16();if(e>=32768){l=!1;break}i.push(e)}if(!l)break;const h=[],u=[];for(;t.pos<n;){const e=t.getByte();u.length=e;for(c=0;c<e;++c)u[c]=String.fromCharCode(t.getByte());h.push(u.join(""))}o=[];for(c=0;c<e;++c){const e=i[c];e<258?o.push(jr[e]):o.push(h[e-258])}break;case 196608:break;default:warn("Unknown/unsupported post table version "+s);l=!1;a.defaultEncoding&&(o=a.defaultEncoding)}a.glyphNames=o;return l}(s.post,a,u);s.post={tag:"post",data:createPostTable(a)};const w=Object.create(null);function hasGlyph(e){return!b[e]}if(a.composite){const e=a.cidToGidMap||[],t=0===e.length;a.cMap.forEach((function(a,r){"string"==typeof r&&(r=convertCidString(a,r,!0));if(r>65535)throw new FormatError("Max size of CID is 65,535");let i=-1;t?i=r:void 0!==e[r]&&(i=e[r]);i>=0&&i<u&&hasGlyph(i)&&(w[a]=i)}))}else{const e=function readCmapTable(e,t,a,r){if(!e){warn("No cmap table available.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}let i,n=(t.start||0)+e.offset;t.pos=n;t.skip(2);const s=t.getUint16();let o,c=!1;for(let e=0;e<s;e++){const i=t.getUint16(),n=t.getUint16(),l=t.getInt32()>>>0;let h=!1;if(o?.platformId!==i||o?.encodingId!==n){if(0!==i||0!==n&&1!==n&&3!==n)if(1===i&&0===n)h=!0;else if(3!==i||1!==n||!r&&o){if(a&&3===i&&0===n){h=!0;let a=!0;if(e<s-1){const e=t.peekBytes(2);int16(e[0],e[1])<i&&(a=!1)}a&&(c=!0)}}else{h=!0;a||(c=!0)}else h=!0;h&&(o={platformId:i,encodingId:n,offset:l});if(c)break}}o&&(t.pos=n+o.offset);if(!o||-1===t.peekByte()){warn("Could not find a preferred cmap table.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}const l=t.getUint16();let h=!1;const u=[];let d,f;if(0===l){t.skip(4);for(d=0;d<256;d++){const e=t.getByte();e&&u.push({charCode:d,glyphId:e})}h=!0}else if(2===l){t.skip(4);const e=[];let a=0;for(let r=0;r<256;r++){const r=t.getUint16()>>3;e.push(r);a=Math.max(r,a)}const r=[];for(let e=0;e<=a;e++)r.push({firstCode:t.getUint16(),entryCount:t.getUint16(),idDelta:signedInt16(t.getByte(),t.getByte()),idRangePos:t.pos+t.getUint16()});for(let a=0;a<256;a++)if(0===e[a]){t.pos=r[0].idRangePos+2*a;f=t.getUint16();u.push({charCode:a,glyphId:f})}else{const i=r[e[a]];for(d=0;d<i.entryCount;d++){const e=(a<<8)+d+i.firstCode;t.pos=i.idRangePos+2*d;f=t.getUint16();0!==f&&(f=(f+i.idDelta)%65536);u.push({charCode:e,glyphId:f})}}}else if(4===l){t.skip(4);const e=t.getUint16()>>1;t.skip(6);const a=[];let r;for(r=0;r<e;r++)a.push({end:t.getUint16()});t.skip(2);for(r=0;r<e;r++)a[r].start=t.getUint16();for(r=0;r<e;r++)a[r].delta=t.getUint16();let s,o=0;for(r=0;r<e;r++){i=a[r];const n=t.getUint16();if(n){s=(n>>1)-(e-r);i.offsetIndex=s;o=Math.max(o,s+i.end-i.start+1)}else i.offsetIndex=-1}const c=[];for(d=0;d<o;d++)c.push(t.getUint16());for(r=0;r<e;r++){i=a[r];n=i.start;const e=i.end,t=i.delta;s=i.offsetIndex;for(d=n;d<=e;d++)if(65535!==d){f=s<0?d:c[s+d-n];f=f+t&65535;u.push({charCode:d,glyphId:f})}}}else if(6===l){t.skip(4);const e=t.getUint16(),a=t.getUint16();for(d=0;d<a;d++){f=t.getUint16();const a=e+d;u.push({charCode:a,glyphId:f})}}else{if(12!==l){warn("cmap table has unsupported format: "+l);return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}{t.skip(10);const e=t.getInt32()>>>0;for(d=0;d<e;d++){const e=t.getInt32()>>>0,a=t.getInt32()>>>0;let r=t.getInt32()>>>0;for(let t=e;t<=a;t++)u.push({charCode:t,glyphId:r++})}}}u.sort(((e,t)=>e.charCode-t.charCode));const g=[],p=new Set;for(const e of u){const{charCode:t}=e;if(!p.has(t)){p.add(t);g.push(e)}}return{platformId:o.platformId,encodingId:o.encodingId,mappings:g,hasShortCmap:h}}(s.cmap,t,this.isSymbolicFont,a.hasEncoding),r=e.platformId,i=e.encodingId,n=e.mappings;let o=[],c=!1;!a.hasEncoding||"MacRomanEncoding"!==a.baseEncodingName&&"WinAnsiEncoding"!==a.baseEncodingName||(o=getEncoding(a.baseEncodingName));if(a.hasEncoding&&!this.isSymbolicFont&&(3===r&&1===i||1===r&&0===i)){const e=Fr();for(let t=0;t<256;t++){let s;s=void 0!==this.differences[t]?this.differences[t]:o.length&&""!==o[t]?o[t]:Ar[t];if(!s)continue;const c=recoverGlyphName(s,e);let l;3===r&&1===i?l=e[c]:1===r&&0===i&&(l=Sr.indexOf(c));if(void 0===l){if(!a.glyphNames&&a.hasIncludedToUnicodeMap&&!(this.toUnicode instanceof IdentityToUnicodeMap)){const e=this.toUnicode.get(t);e&&(l=e.codePointAt(0))}if(void 0===l)continue}for(const e of n)if(e.charCode===l){w[t]=e.glyphId;break}}}else if(0===r){for(const e of n)w[e.charCode]=e.glyphId;c=!0}else if(3===r&&0===i)for(const e of n){let t=e.charCode;t>=61440&&t<=61695&&(t&=255);w[t]=e.glyphId}else for(const e of n)w[e.charCode]=e.glyphId;if(a.glyphNames&&(o.length||this.differences.length))for(let e=0;e<256;++e){if(!c&&void 0!==w[e])continue;const t=this.differences[e]||o[e];if(!t)continue;const r=a.glyphNames.indexOf(t);r>0&&hasGlyph(r)&&(w[e]=r)}}0===w.length&&(w[0]=0);let x=d-1;f||(x=0);if(!a.cssFontInfo){const e=adjustMapping(w,hasGlyph,x,this.toUnicode);this.toFontChar=e.toFontChar;s.cmap={tag:"cmap",data:createCmapTable(e.charCodeToGlyphId,e.toUnicodeExtraMap,d)};s["OS/2"]&&function validateOS2Table(e,t){t.pos=(t.start||0)+e.offset;const a=t.getUint16();t.skip(60);const r=t.getUint16();if(a<4&&768&r)return!1;if(t.getUint16()>t.getUint16())return!1;t.skip(6);if(0===t.getUint16())return!1;e.data[8]=e.data[9]=0;return!0}(s["OS/2"],t)||(s["OS/2"]={tag:"OS/2",data:createOS2Table(a,e.charCodeToGlyphId,y)})}if(!l)try{c=new Stream(s["CFF "].data);o=new CFFParser(c,a,Rr).parse();o.duplicateFirstGlyph();const e=new CFFCompiler(o);s["CFF "].data=e.compile()}catch{warn("Failed to compile font "+a.loadedName)}if(s.name){const[t,r]=readNameTable(s.name);s.name.data=createNameTable(e,t);this.psName=t[0][6]||null;a.composite||function adjustTrueTypeToUnicode(e,t,a){if(e.isInternalFont)return;if(e.hasIncludedToUnicodeMap)return;if(e.hasEncoding)return;if(e.toUnicode instanceof IdentityToUnicodeMap)return;if(!t)return;if(0===a.length)return;if(e.defaultEncoding===kr)return;for(const e of a)if(!isWinNameRecord(e))return;const r=kr,i=[],n=Fr();for(const e in r){const t=r[e];if(""===t)continue;const a=n[t];void 0!==a&&(i[e]=String.fromCharCode(a))}i.length>0&&e.toUnicode.amend(i)}(a,this.isSymbolicFont,r)}else s.name={tag:"name",data:createNameTable(this.name)};const S=new OpenTypeFileBuilder(n.version);for(const e in s)S.addTable(e,s[e].data);return S.toArray()}convert(e,a,r){r.fixedPitch=!1;r.builtInEncoding&&function adjustType1ToUnicode(e,t){if(e.isInternalFont)return;if(e.hasIncludedToUnicodeMap)return;if(t===e.defaultEncoding)return;if(e.toUnicode instanceof IdentityToUnicodeMap)return;const a=[],r=Fr();for(const i in t){if(e.hasEncoding&&(e.baseEncodingName||void 0!==e.differences[i]))continue;const n=getUnicodeForGlyph(t[i],r);-1!==n&&(a[i]=String.fromCharCode(n))}a.length>0&&e.toUnicode.amend(a)}(r,r.builtInEncoding);let i=1;a instanceof CFFFont&&(i=a.numGlyphs-1);const n=a.getGlyphMapping(r);let s=null,o=n,c=null;if(!r.cssFontInfo){s=adjustMapping(n,a.hasGlyphId.bind(a),i,this.toUnicode);this.toFontChar=s.toFontChar;o=s.charCodeToGlyphId;c=s.toUnicodeExtraMap}const l=a.numGlyphs;function getCharCodes(e,t){let a=null;for(const r in e)t===e[r]&&(a||=[]).push(0|r);return a}function createCharCode(e,t){for(const a in e)if(t===e[a])return 0|a;s.charCodeToGlyphId[s.nextAvailableFontCharCode]=t;return s.nextAvailableFontCharCode++}const h=a.seacs;if(s&&h?.length){const e=r.fontMatrix||t,i=a.getCharset(),o=Object.create(null);for(let t in h){t|=0;const a=h[t],r=Ar[a[2]],c=Ar[a[3]],l=i.indexOf(r),u=i.indexOf(c);if(l<0||u<0)continue;const d={x:a[0]*e[0]+a[1]*e[2]+e[4],y:a[0]*e[1]+a[1]*e[3]+e[5]},f=getCharCodes(n,t);if(f)for(const e of f){const t=s.charCodeToGlyphId,a=createCharCode(t,l),r=createCharCode(t,u);o[e]={baseFontCharCode:a,accentFontCharCode:r,accentOffset:d}}}r.seacMap=o}const u=r.fontMatrix?1/Math.max(...r.fontMatrix.slice(0,4).map(Math.abs)):1e3,d=new OpenTypeFileBuilder("OTTO");d.addTable("CFF ",a.data);d.addTable("OS/2",createOS2Table(r,o));d.addTable("cmap",createCmapTable(o,c,l));d.addTable("head","\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0_<õ\\0\\0"+safeString16(u)+"\\0\\0\\0\\0ž\\v~\'\\0\\0\\0\\0ž\\v~\'\\0\\0"+safeString16(r.descent)+"ÿ"+safeString16(r.ascent)+string16(r.italicAngle?2:0)+"\\0\\0\\0\\0\\0\\0\\0");d.addTable("hhea","\\0\\0\\0"+safeString16(r.ascent)+safeString16(r.descent)+"\\0\\0ÿÿ\\0\\0\\0\\0\\0\\0"+safeString16(r.capHeight)+safeString16(Math.tan(r.italicAngle)*r.xHeight)+"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"+string16(l));d.addTable("hmtx",function fontFieldsHmtx(){const e=a.charstrings,t=a.cff?a.cff.widths:null;let r="\\0\\0\\0\\0";for(let a=1,i=l;a<i;a++){let i=0;if(e){const t=e[a-1];i="width"in t?t.width:0}else t&&(i=Math.ceil(t[a]||0));r+=string16(i)+string16(0)}return r}());d.addTable("maxp","\\0\\0P\\0"+string16(l));d.addTable("name",createNameTable(e));d.addTable("post",createPostTable(r));return d.toArray()}get _spaceWidth(){const e=["space","minus","one","i","I"];let t;for(const a of e){if(a in this.widths){t=this.widths[a];break}const e=Fr()[a];let r=0;if(this.composite&&this.cMap.contains(e)){r=this.cMap.lookup(e);"string"==typeof r&&(r=convertCidString(e,r))}!r&&this.toUnicode&&(r=this.toUnicode.charCodeOf(e));r<=0&&(r=e);t=this.widths[r];if(t)break}return shadow(this,"_spaceWidth",t||this.defaultWidth)}_charToGlyph(e,t=!1){let a,r,i,n=this._glyphCache[e];if(n?.isSpace===t)return n;let s=e;if(this.cMap?.contains(e)){s=this.cMap.lookup(e);"string"==typeof s&&(s=convertCidString(e,s))}r=this.widths[s];"number"!=typeof r&&(r=this.defaultWidth);const o=this.vmetrics?.[s];let c=this.toUnicode.get(e)||e;"number"==typeof c&&(c=String.fromCharCode(c));let l=void 0!==this.toFontChar[e];a=this.toFontChar[e]||e;if(this.missingFile){const t=this.differences[e]||this.defaultEncoding[e];if((".notdef"===t||""===t)&&"Type1"===this.type){a=32;if(""===t){r||=this._spaceWidth;c=String.fromCharCode(a)}}a=function mapSpecialUnicodeValues(e){return e>=65520&&e<=65535?0:e>=62976&&e<=63743?Tr()[e]||e:173===e?45:e}(a)}this.isType3Font&&(i=a);let h=null;if(this.seacMap?.[e]){l=!0;const t=this.seacMap[e];a=t.baseFontCharCode;h={fontChar:String.fromCodePoint(t.accentFontCharCode),offset:t.accentOffset}}let u="";"number"==typeof a&&(a<=1114111?u=String.fromCodePoint(a):warn(`charToGlyph - invalid fontCharCode: ${a}`));if(this.missingFile&&this.vertical&&1===u.length){const e=_r()[u.charCodeAt(0)];e&&(u=c=String.fromCharCode(e))}n=new fonts_Glyph(e,u,c,h,r,o,i,t,l);return this._glyphCache[e]=n}charsToGlyphs(e){let t=this._charsCache[e];if(t)return t;t=[];if(this.cMap){const a=Object.create(null),r=e.length;let i=0;for(;i<r;){this.cMap.readCharCode(e,i,a);const{charcode:r,length:n}=a;i+=n;const s=this._charToGlyph(r,1===n&&32===e.charCodeAt(i-1));t.push(s)}}else for(let a=0,r=e.length;a<r;++a){const r=e.charCodeAt(a),i=this._charToGlyph(r,32===r);t.push(i)}return this._charsCache[e]=t}getCharPositions(e){const t=[];if(this.cMap){const a=Object.create(null);let r=0;for(;r<e.length;){this.cMap.readCharCode(e,r,a);const i=a.length;t.push([r,r+i]);r+=i}}else for(let a=0,r=e.length;a<r;++a)t.push([a,a+1]);return t}get glyphCacheValues(){return Object.values(this._glyphCache)}encodeString(e){const t=[],a=[],hasCurrentBufErrors=()=>t.length%2==1,r=this.toUnicode instanceof IdentityToUnicodeMap?e=>this.toUnicode.charCodeOf(e):e=>this.toUnicode.charCodeOf(String.fromCodePoint(e));for(let i=0,n=e.length;i<n;i++){const n=e.codePointAt(i);n>55295&&(n<57344||n>65533)&&i++;if(this.toUnicode){const e=r(n);if(-1!==e){if(hasCurrentBufErrors()){t.push(a.join(""));a.length=0}for(let t=(this.cMap?this.cMap.getCharCodeLength(e):1)-1;t>=0;t--)a.push(String.fromCharCode(e>>8*t&255));continue}}if(!hasCurrentBufErrors()){t.push(a.join(""));a.length=0}a.push(String.fromCodePoint(n))}t.push(a.join(""));return t}}class ErrorFont{constructor(e){this.error=e;this.loadedName="g_font_error";this.missingFile=!0}charsToGlyphs(){return[]}encodeString(e){return[e]}exportData(){return{error:this.error}}}const Si=2,Ai=3,ki=4,Ci=5,vi=6,Fi=7;class Pattern{constructor(){unreachable("Cannot initialize Pattern.")}static parseShading(e,t,a,r,i,n){const s=e instanceof BaseStream?e.dict:e,o=s.get("ShadingType");try{switch(o){case Si:case Ai:return new RadialAxialShading(s,t,a,r,i,n);case ki:case Ci:case vi:case Fi:return new MeshShading(e,t,a,r,i,n);default:throw new FormatError("Unsupported ShadingType: "+o)}}catch(e){if(e instanceof MissingDataException)throw e;warn(e);return new DummyShading}}}class BaseShading{static SMALL_NUMBER=1e-6;getIR(){unreachable("Abstract method `getIR` called.")}}class RadialAxialShading extends BaseShading{constructor(e,t,a,r,i,n){super();this.shadingType=e.get("ShadingType");let s=0;this.shadingType===Si?s=4:this.shadingType===Ai&&(s=6);this.coordsArr=e.getArray("Coords");if(!isNumberArray(this.coordsArr,s))throw new FormatError("RadialAxialShading: Invalid /Coords array.");const o=ColorSpaceUtils.parse({cs:e.getRaw("CS")||e.getRaw("ColorSpace"),xref:t,resources:a,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:n});this.bbox=lookupNormalRect(e.getArray("BBox"),null);let c=0,l=1;const h=e.getArray("Domain");isNumberArray(h,2)&&([c,l]=h);let u=!1,d=!1;const f=e.getArray("Extend");(function isBooleanArray(e,t){return Array.isArray(e)&&(null===t||e.length===t)&&e.every((e=>"boolean"==typeof e))})(f,2)&&([u,d]=f);if(!(this.shadingType!==Ai||u&&d)){const[e,t,a,r,i,n]=this.coordsArr,s=Math.hypot(e-r,t-i);a<=n+s&&n<=a+s&&warn("Unsupported radial gradient.")}this.extendStart=u;this.extendEnd=d;const g=e.getRaw("Function"),p=r.create(g,!0),m=(l-c)/840,b=this.colorStops=[];if(c>=l||m<=0){info("Bad shading domain.");return}const y=new Float32Array(o.numComps),w=new Float32Array(1);let x=0;w[0]=c;p(w,0,y,0);const S=new Uint8ClampedArray(3);o.getRgb(y,0,S);let[k,C,v]=S;b.push([0,Util.makeHexColor(k,C,v)]);let F=1;w[0]=c+m;p(w,0,y,0);o.getRgb(y,0,S);let[T,O,M]=S,D=T-k+1,R=O-C+1,N=M-v+1,E=T-k-1,L=O-C-1,j=M-v-1;for(let e=2;e<840;e++){w[0]=c+e*m;p(w,0,y,0);o.getRgb(y,0,S);const[t,a,r]=S,i=e-x;D=Math.min(D,(t-k+1)/i);R=Math.min(R,(a-C+1)/i);N=Math.min(N,(r-v+1)/i);E=Math.max(E,(t-k-1)/i);L=Math.max(L,(a-C-1)/i);j=Math.max(j,(r-v-1)/i);if(!(E<=D&&L<=R&&j<=N)){const e=Util.makeHexColor(T,O,M);b.push([F/840,e]);D=t-T+1;R=a-O+1;N=r-M+1;E=t-T-1;L=a-O-1;j=r-M-1;x=F;k=T;C=O;v=M}F=e;T=t;O=a;M=r}b.push([1,Util.makeHexColor(T,O,M)]);let _="transparent";e.has("Background")&&(_=o.getRgbHex(e.get("Background"),0));if(!u){b.unshift([0,_]);b[1][0]+=BaseShading.SMALL_NUMBER}if(!d){b.at(-1)[0]-=BaseShading.SMALL_NUMBER;b.push([1,_])}this.colorStops=b}getIR(){const{coordsArr:e,shadingType:t}=this;let a,r,i,n,s;if(t===Si){r=[e[0],e[1]];i=[e[2],e[3]];n=null;s=null;a="axial"}else if(t===Ai){r=[e[0],e[1]];i=[e[3],e[4]];n=e[2];s=e[5];a="radial"}else unreachable(`getPattern type unknown: ${t}`);return["RadialAxial",a,this.bbox,this.colorStops,r,i,n,s]}}class MeshStreamReader{constructor(e,t){this.stream=e;this.context=t;this.buffer=0;this.bufferLength=0;const a=t.numComps;this.tmpCompsBuf=new Float32Array(a);const r=t.colorSpace.numComps;this.tmpCsCompsBuf=t.colorFn?new Float32Array(r):this.tmpCompsBuf}get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;const e=this.stream.getByte();if(e<0)return!1;this.buffer=e;this.bufferLength=8;return!0}readBits(e){const{stream:t}=this;let{buffer:a,bufferLength:r}=this;if(32===e){if(0===r)return t.getInt32()>>>0;a=a<<24|t.getByte()<<16|t.getByte()<<8|t.getByte();const e=t.getByte();this.buffer=e&(1<<r)-1;return(a<<8-r|(255&e)>>r)>>>0}if(8===e&&0===r)return t.getByte();for(;r<e;){a=a<<8|t.getByte();r+=8}r-=e;this.bufferLength=r;this.buffer=a&(1<<r)-1;return a>>r}align(){this.buffer=0;this.bufferLength=0}readFlag(){return this.readBits(this.context.bitsPerFlag)}readCoordinate(){const{bitsPerCoordinate:e,decode:t}=this.context,a=this.readBits(e),r=this.readBits(e),i=e<32?1/((1<<e)-1):2.3283064365386963e-10;return[a*i*(t[1]-t[0])+t[0],r*i*(t[3]-t[2])+t[2]]}readComponents(){const{bitsPerComponent:e,colorFn:t,colorSpace:a,decode:r,numComps:i}=this.context,n=e<32?1/((1<<e)-1):2.3283064365386963e-10,s=this.tmpCompsBuf;for(let t=0,a=4;t<i;t++,a+=2){const i=this.readBits(e);s[t]=i*n*(r[a+1]-r[a])+r[a]}const o=this.tmpCsCompsBuf;t?.(s,0,o,0);return a.getRgb(o,0)}}let Ii=Object.create(null);function getB(e){return Ii[e]||=function buildB(e){const t=[];for(let a=0;a<=e;a++){const r=a/e,i=1-r;t.push(new Float32Array([i**3,3*r*i**2,3*r**2*i,r**3]))}return t}(e)}class MeshShading extends BaseShading{static MIN_SPLIT_PATCH_CHUNKS_AMOUNT=3;static MAX_SPLIT_PATCH_CHUNKS_AMOUNT=20;static TRIANGLE_DENSITY=20;constructor(e,t,a,r,i,n){super();if(!(e instanceof BaseStream))throw new FormatError("Mesh data is not a stream");const s=e.dict;this.shadingType=s.get("ShadingType");this.bbox=lookupNormalRect(s.getArray("BBox"),null);const o=ColorSpaceUtils.parse({cs:s.getRaw("CS")||s.getRaw("ColorSpace"),xref:t,resources:a,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:n});this.background=s.has("Background")?o.getRgb(s.get("Background"),0):null;const c=s.getRaw("Function"),l=c?r.create(c,!0):null;this.coords=[];this.colors=[];this.figures=[];const h={bitsPerCoordinate:s.get("BitsPerCoordinate"),bitsPerComponent:s.get("BitsPerComponent"),bitsPerFlag:s.get("BitsPerFlag"),decode:s.getArray("Decode"),colorFn:l,colorSpace:o,numComps:l?1:o.numComps},u=new MeshStreamReader(e,h);let d=!1;switch(this.shadingType){case ki:this._decodeType4Shading(u);break;case Ci:const e=0|s.get("VerticesPerRow");if(e<2)throw new FormatError("Invalid VerticesPerRow");this._decodeType5Shading(u,e);break;case vi:this._decodeType6Shading(u);d=!0;break;case Fi:this._decodeType7Shading(u);d=!0;break;default:unreachable("Unsupported mesh type.")}if(d){this._updateBounds();for(let e=0,t=this.figures.length;e<t;e++)this._buildFigureFromPatch(e)}this._updateBounds();this._packData()}_decodeType4Shading(e){const t=this.coords,a=this.colors,r=[],i=[];let n=0;for(;e.hasData;){const s=e.readFlag(),o=e.readCoordinate(),c=e.readComponents();if(0===n){if(!(0<=s&&s<=2))throw new FormatError("Unknown type4 flag");switch(s){case 0:n=3;break;case 1:i.push(i.at(-2),i.at(-1));n=1;break;case 2:i.push(i.at(-3),i.at(-1));n=1}r.push(s)}i.push(t.length);t.push(o);a.push(c);n--;e.align()}this.figures.push({type:"triangles",coords:new Int32Array(i),colors:new Int32Array(i)})}_decodeType5Shading(e,t){const a=this.coords,r=this.colors,i=[];for(;e.hasData;){const t=e.readCoordinate(),n=e.readComponents();i.push(a.length);a.push(t);r.push(n)}this.figures.push({type:"lattice",coords:new Int32Array(i),colors:new Int32Array(i),verticesPerRow:t})}_decodeType6Shading(e){const t=this.coords,a=this.colors,r=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){const n=e.readFlag();if(!(0<=n&&n<=3))throw new FormatError("Unknown type6 flag");const s=t.length;for(let a=0,r=0!==n?8:12;a<r;a++)t.push(e.readCoordinate());const o=a.length;for(let t=0,r=0!==n?2:4;t<r;t++)a.push(e.readComponents());let c,l,h,u;switch(n){case 0:r[12]=s+3;r[13]=s+4;r[14]=s+5;r[15]=s+6;r[8]=s+2;r[11]=s+7;r[4]=s+1;r[7]=s+8;r[0]=s;r[1]=s+11;r[2]=s+10;r[3]=s+9;i[2]=o+1;i[3]=o+2;i[0]=o;i[1]=o+3;break;case 1:c=r[12];l=r[13];h=r[14];u=r[15];r[12]=u;r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=h;r[11]=s+3;r[4]=l;r[7]=s+4;r[0]=c;r[1]=s+7;r[2]=s+6;r[3]=s+5;c=i[2];l=i[3];i[2]=l;i[3]=o;i[0]=c;i[1]=o+1;break;case 2:c=r[15];l=r[11];r[12]=r[3];r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=r[7];r[11]=s+3;r[4]=l;r[7]=s+4;r[0]=c;r[1]=s+7;r[2]=s+6;r[3]=s+5;c=i[3];i[2]=i[1];i[3]=o;i[0]=c;i[1]=o+1;break;case 3:r[12]=r[0];r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=r[1];r[11]=s+3;r[4]=r[2];r[7]=s+4;r[0]=r[3];r[1]=s+7;r[2]=s+6;r[3]=s+5;i[2]=i[0];i[3]=o;i[0]=i[1];i[1]=o+1}r[5]=t.length;t.push([(-4*t[r[0]][0]-t[r[15]][0]+6*(t[r[4]][0]+t[r[1]][0])-2*(t[r[12]][0]+t[r[3]][0])+3*(t[r[13]][0]+t[r[7]][0]))/9,(-4*t[r[0]][1]-t[r[15]][1]+6*(t[r[4]][1]+t[r[1]][1])-2*(t[r[12]][1]+t[r[3]][1])+3*(t[r[13]][1]+t[r[7]][1]))/9]);r[6]=t.length;t.push([(-4*t[r[3]][0]-t[r[12]][0]+6*(t[r[2]][0]+t[r[7]][0])-2*(t[r[0]][0]+t[r[15]][0])+3*(t[r[4]][0]+t[r[14]][0]))/9,(-4*t[r[3]][1]-t[r[12]][1]+6*(t[r[2]][1]+t[r[7]][1])-2*(t[r[0]][1]+t[r[15]][1])+3*(t[r[4]][1]+t[r[14]][1]))/9]);r[9]=t.length;t.push([(-4*t[r[12]][0]-t[r[3]][0]+6*(t[r[8]][0]+t[r[13]][0])-2*(t[r[0]][0]+t[r[15]][0])+3*(t[r[11]][0]+t[r[1]][0]))/9,(-4*t[r[12]][1]-t[r[3]][1]+6*(t[r[8]][1]+t[r[13]][1])-2*(t[r[0]][1]+t[r[15]][1])+3*(t[r[11]][1]+t[r[1]][1]))/9]);r[10]=t.length;t.push([(-4*t[r[15]][0]-t[r[0]][0]+6*(t[r[11]][0]+t[r[14]][0])-2*(t[r[12]][0]+t[r[3]][0])+3*(t[r[2]][0]+t[r[8]][0]))/9,(-4*t[r[15]][1]-t[r[0]][1]+6*(t[r[11]][1]+t[r[14]][1])-2*(t[r[12]][1]+t[r[3]][1])+3*(t[r[2]][1]+t[r[8]][1]))/9]);this.figures.push({type:"patch",coords:new Int32Array(r),colors:new Int32Array(i)})}}_decodeType7Shading(e){const t=this.coords,a=this.colors,r=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){const n=e.readFlag();if(!(0<=n&&n<=3))throw new FormatError("Unknown type7 flag");const s=t.length;for(let a=0,r=0!==n?12:16;a<r;a++)t.push(e.readCoordinate());const o=a.length;for(let t=0,r=0!==n?2:4;t<r;t++)a.push(e.readComponents());let c,l,h,u;switch(n){case 0:r[12]=s+3;r[13]=s+4;r[14]=s+5;r[15]=s+6;r[8]=s+2;r[9]=s+13;r[10]=s+14;r[11]=s+7;r[4]=s+1;r[5]=s+12;r[6]=s+15;r[7]=s+8;r[0]=s;r[1]=s+11;r[2]=s+10;r[3]=s+9;i[2]=o+1;i[3]=o+2;i[0]=o;i[1]=o+3;break;case 1:c=r[12];l=r[13];h=r[14];u=r[15];r[12]=u;r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=h;r[9]=s+9;r[10]=s+10;r[11]=s+3;r[4]=l;r[5]=s+8;r[6]=s+11;r[7]=s+4;r[0]=c;r[1]=s+7;r[2]=s+6;r[3]=s+5;c=i[2];l=i[3];i[2]=l;i[3]=o;i[0]=c;i[1]=o+1;break;case 2:c=r[15];l=r[11];r[12]=r[3];r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=r[7];r[9]=s+9;r[10]=s+10;r[11]=s+3;r[4]=l;r[5]=s+8;r[6]=s+11;r[7]=s+4;r[0]=c;r[1]=s+7;r[2]=s+6;r[3]=s+5;c=i[3];i[2]=i[1];i[3]=o;i[0]=c;i[1]=o+1;break;case 3:r[12]=r[0];r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=r[1];r[9]=s+9;r[10]=s+10;r[11]=s+3;r[4]=r[2];r[5]=s+8;r[6]=s+11;r[7]=s+4;r[0]=r[3];r[1]=s+7;r[2]=s+6;r[3]=s+5;i[2]=i[0];i[3]=o;i[0]=i[1];i[1]=o+1}this.figures.push({type:"patch",coords:new Int32Array(r),colors:new Int32Array(i)})}}_buildFigureFromPatch(e){const t=this.figures[e];assert("patch"===t.type,"Unexpected patch mesh figure");const a=this.coords,r=this.colors,i=t.coords,n=t.colors,s=Math.min(a[i[0]][0],a[i[3]][0],a[i[12]][0],a[i[15]][0]),o=Math.min(a[i[0]][1],a[i[3]][1],a[i[12]][1],a[i[15]][1]),c=Math.max(a[i[0]][0],a[i[3]][0],a[i[12]][0],a[i[15]][0]),l=Math.max(a[i[0]][1],a[i[3]][1],a[i[12]][1],a[i[15]][1]);let h=Math.ceil((c-s)*MeshShading.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0]));h=MathClamp(h,MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);let u=Math.ceil((l-o)*MeshShading.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1]));u=MathClamp(u,MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);const d=h+1,f=new Int32Array((u+1)*d),g=new Int32Array((u+1)*d);let p=0;const m=new Uint8Array(3),b=new Uint8Array(3),y=r[n[0]],w=r[n[1]],x=r[n[2]],S=r[n[3]],k=getB(u),C=getB(h);for(let e=0;e<=u;e++){m[0]=(y[0]*(u-e)+x[0]*e)/u|0;m[1]=(y[1]*(u-e)+x[1]*e)/u|0;m[2]=(y[2]*(u-e)+x[2]*e)/u|0;b[0]=(w[0]*(u-e)+S[0]*e)/u|0;b[1]=(w[1]*(u-e)+S[1]*e)/u|0;b[2]=(w[2]*(u-e)+S[2]*e)/u|0;for(let t=0;t<=h;t++,p++){if(!(0!==e&&e!==u||0!==t&&t!==h))continue;let n=0,s=0,o=0;for(let r=0;r<=3;r++)for(let c=0;c<=3;c++,o++){const l=k[e][r]*C[t][c];n+=a[i[o]][0]*l;s+=a[i[o]][1]*l}f[p]=a.length;a.push([n,s]);g[p]=r.length;const c=new Uint8Array(3);c[0]=(m[0]*(h-t)+b[0]*t)/h|0;c[1]=(m[1]*(h-t)+b[1]*t)/h|0;c[2]=(m[2]*(h-t)+b[2]*t)/h|0;r.push(c)}}f[0]=i[0];g[0]=n[0];f[h]=i[3];g[h]=n[1];f[d*u]=i[12];g[d*u]=n[2];f[d*u+h]=i[15];g[d*u+h]=n[3];this.figures[e]={type:"lattice",coords:f,colors:g,verticesPerRow:d}}_updateBounds(){let e=this.coords[0][0],t=this.coords[0][1],a=e,r=t;for(let i=1,n=this.coords.length;i<n;i++){const n=this.coords[i][0],s=this.coords[i][1];e=e>n?n:e;t=t>s?s:t;a=a<n?n:a;r=r<s?s:r}this.bounds=[e,t,a,r]}_packData(){let e,t,a,r;const i=this.coords,n=new Float32Array(2*i.length);for(e=0,a=0,t=i.length;e<t;e++){const t=i[e];n[a++]=t[0];n[a++]=t[1]}this.coords=n;const s=this.colors,o=new Uint8Array(3*s.length);for(e=0,a=0,t=s.length;e<t;e++){const t=s[e];o[a++]=t[0];o[a++]=t[1];o[a++]=t[2]}this.colors=o;const c=this.figures;for(e=0,t=c.length;e<t;e++){const t=c[e],i=t.coords,n=t.colors;for(a=0,r=i.length;a<r;a++){i[a]*=2;n[a]*=3}}}getIR(){const{bounds:e}=this;if(e[2]-e[0]==0||e[3]-e[1]==0)throw new FormatError(`Invalid MeshShading bounds: [${e}].`);return["Mesh",this.shadingType,this.coords,this.colors,this.figures,e,this.bbox,this.background]}}class DummyShading extends BaseShading{getIR(){return["Dummy"]}}function getTilingPatternIR(e,t,a){const r=lookupMatrix(t.getArray("Matrix"),Fa),i=lookupNormalRect(t.getArray("BBox"),null);if(!i||i[2]-i[0]==0||i[3]-i[1]==0)throw new FormatError("Invalid getTilingPatternIR /BBox array.");const n=t.get("XStep");if("number"!=typeof n)throw new FormatError("Invalid getTilingPatternIR /XStep value.");const s=t.get("YStep");if("number"!=typeof s)throw new FormatError("Invalid getTilingPatternIR /YStep value.");const o=t.get("PaintType");if(!Number.isInteger(o))throw new FormatError("Invalid getTilingPatternIR /PaintType value.");const c=t.get("TilingType");if(!Number.isInteger(c))throw new FormatError("Invalid getTilingPatternIR /TilingType value.");return["TilingPattern",a,e,r,i,n,s,o,c]}const Ti=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.54657,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.73293,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.9121,.86943,.79795,.88198,.77958,.70864,.81055,.90399,.88653,.96017,.82577,.77892,.78257,.97507,1.54657,.97507,.85284,.89552,.90176,.88762,.8785,.75241,.8785,.90518,.95015,.77618,.8785,.88401,.91916,.86304,.88401,.91488,.8785,.8801,.8785,.8785,.91343,.7173,1.04106,.8785,.85075,.95794,.82616,.85162,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.12401,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.73293,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.9121,.86943,.86943,.86943,.86943,.86943,.85284,.87508,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.88762,.88762,.88762,.88762,.88762,.88762,.8715,.75241,.90518,.90518,.90518,.90518,.88401,.88401,.88401,.88401,.8785,.8785,.8801,.8801,.8801,.8801,.8801,.90747,.89049,.8785,.8785,.8785,.8785,.85162,.8785,.85162,.83908,.88762,.83908,.88762,.83908,.88762,.73293,.75241,.73293,.75241,.73293,.75241,.73293,.75241,.87289,.83016,.88506,.93125,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.81921,.77618,.81921,.77618,.81921,.77618,1,1,.87356,.8785,.91075,.89608,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76229,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.79468,.91926,.88175,.70823,.94903,.9121,.8785,1,1,.9121,.8785,.87802,.88656,.8785,.86943,.8801,.86943,.8801,.86943,.8801,.87402,.89291,.77958,.91343,1,1,.77958,.91343,.70864,.7173,.70864,.7173,.70864,.7173,.70864,.7173,1,1,.81055,.75841,.81055,1.06452,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.96017,.95794,.77892,.85162,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.88762,.77539,.8715,.87508,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70674,.98387,.94721,1.33431,1.45894,.95161,1.06303,.83908,.80352,.57184,.6965,.56289,.82001,.56029,.81235,1.02988,.83908,.7762,.68156,.80367,.73133,.78257,.87356,.86943,.95958,.75727,.89019,1.04924,.9121,.7648,.86943,.87356,.79795,.78275,.81055,.77892,.9762,.82577,.99819,.84896,.95958,.77892,.96108,1.01407,.89049,1.02988,.94211,.96108,.8936,.84021,.87842,.96399,.79109,.89049,1.00813,1.02988,.86077,.87445,.92099,.84723,.86513,.8801,.75638,.85714,.78216,.79586,.87965,.94211,.97747,.78287,.97926,.84971,1.02988,.94211,.8801,.94211,.84971,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90264,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.90518,1,1,1,1,1,1,1,1,1,1,1,1,.90548,1,1,1,1,1,1,.96017,.95794,.96017,.95794,.96017,.95794,.77892,.85162,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.92794,.87012,.87012,.87012,.89552,.89552,1.42259,.71143,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.93835,.83406,.91133,.84107,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90527,1.81055,.90527,1.81055,1.31006,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Oi={lineHeight:1.2207,lineGap:.2207},Mi=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.56239,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.71805,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.90872,.85938,.79795,.87068,.77958,.69766,.81055,.90399,.88653,.96068,.82577,.77892,.78257,.97507,1.529,.97507,.85284,.89552,.90176,.94908,.86411,.74012,.86411,.88323,.95015,.86411,.86331,.88401,.91916,.86304,.88401,.9039,.86331,.86331,.86411,.86411,.90464,.70852,1.04106,.86331,.84372,.95794,.82616,.84548,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.19129,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.71805,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.90872,.85938,.85938,.85938,.85938,.85938,.85284,.87068,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.94908,.94908,.94908,.94908,.94908,.94908,.85887,.74012,.88323,.88323,.88323,.88323,.88401,.88401,.88401,.88401,.8785,.86331,.86331,.86331,.86331,.86331,.86331,.90747,.89049,.86331,.86331,.86331,.86331,.84548,.86411,.84548,.83908,.94908,.83908,.94908,.83908,.94908,.71805,.74012,.71805,.74012,.71805,.74012,.71805,.74012,.87289,.79538,.88506,.92726,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.81921,.86411,.81921,.86411,.81921,.86411,1,1,.87356,.86331,.91075,.8777,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76467,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.77312,.91926,.88175,.70823,.94903,.90872,.86331,1,1,.90872,.86331,.86906,.88116,.86331,.85938,.86331,.85938,.86331,.85938,.86331,.87402,.86549,.77958,.90464,1,1,.77958,.90464,.69766,.70852,.69766,.70852,.69766,.70852,.69766,.70852,1,1,.81055,.75841,.81055,1.06452,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.96068,.95794,.77892,.84548,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.94908,.77539,.85887,.87068,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70088,.98387,.94721,1.33431,1.45894,.95161,1.48387,.83908,.80352,.57118,.6965,.56347,.79179,.55853,.80346,1.02988,.83908,.7762,.67174,.86036,.73133,.78257,.87356,.86441,.95958,.75727,.89019,1.04924,.90872,.74889,.85938,.87891,.79795,.7957,.81055,.77892,.97447,.82577,.97466,.87179,.95958,.77892,.94252,.95612,.8753,1.02988,.92733,.94252,.87411,.84021,.8728,.95612,.74081,.8753,1.02189,1.02988,.84814,.87445,.91822,.84723,.85668,.86331,.81344,.87581,.76422,.82046,.96057,.92733,.99375,.78022,.95452,.86015,1.02988,.92733,.86331,.92733,.86015,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90631,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.88323,1,1,1,1,1,1,1,1,1,1,1,1,.85174,1,1,1,1,1,1,.96068,.95794,.96068,.95794,.96068,.95794,.77892,.84548,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.89807,.87012,.87012,.87012,.89552,.89552,1.42259,.71094,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.92972,.83406,.91133,.83326,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90616,1.81055,.90527,1.81055,1.3107,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Di={lineHeight:1.2207,lineGap:.2207},Bi=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39543,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.72346,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89249,.84118,.77452,.85374,.75186,.67789,.79776,.88844,.85066,.94309,.77818,.7306,.76659,1.10369,1.38313,1.10369,1.06139,.89552,.8739,.9245,.9245,.83203,.9245,.85865,1.09842,.9245,.9245,1.03297,1.07692,.90918,1.03297,.94959,.9245,.92274,.9245,.9245,1.02933,.77832,1.20562,.9245,.8916,.98986,.86621,.89453,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.16359,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.72346,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89249,.84118,.84118,.84118,.84118,.84118,.85284,.84557,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.9245,.9245,.9245,.9245,.9245,.9245,.84843,.83203,.85865,.85865,.85865,.85865,.82601,.82601,.82601,.82601,.94469,.9245,.92274,.92274,.92274,.92274,.92274,.90747,.86651,.9245,.9245,.9245,.9245,.89453,.9245,.89453,.8675,.9245,.8675,.9245,.8675,.9245,.72346,.83203,.72346,.83203,.72346,.83203,.72346,.83203,.85193,.8875,.86477,.99034,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.81105,.9245,.81105,.9245,.81105,.9245,1,1,.86275,.9245,.90872,.93591,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77896,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.9375,.98156,.93407,.77261,1.11429,.89249,.9245,1,1,.89249,.9245,.92534,.86698,.9245,.84118,.92274,.84118,.92274,.84118,.92274,.8667,.86291,.75186,1.02933,1,1,.75186,1.02933,.67789,.77832,.67789,.77832,.67789,.77832,.67789,.77832,1,1,.79776,.97655,.79776,1.23023,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.94309,.98986,.7306,.89453,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.9245,.76318,.84843,.84557,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67009,.96334,.93695,1.35191,1.40909,.95161,1.48387,.8675,.90861,.6192,.7363,.64824,.82411,.56321,.85696,1.23516,.8675,.81552,.7286,.84134,.73206,.76659,.86275,.84369,.90685,.77892,.85871,1.02638,.89249,.75828,.84118,.85984,.77452,.76466,.79776,.7306,.90782,.77818,.903,.87291,.90685,.7306,.99058,1.03667,.94635,1.23516,.9849,.99058,.92393,.8916,.942,1.03667,.75026,.94635,1.0297,1.23516,.90918,.94048,.98217,.89746,.84153,.92274,.82507,.88832,.84438,.88178,1.03525,.9849,1.00225,.78086,.97248,.89404,1.23516,.9849,.92274,.9849,.89404,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.89693,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.85865,1,1,1,1,1,1,1,1,1,1,1,1,.90933,1,1,1,1,1,1,.94309,.98986,.94309,.98986,.94309,.98986,.7306,.89453,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.68994,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.97858,.82616,.91133,.83437,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90572,1.81055,.90749,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85284,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Ri={lineHeight:1.2207,lineGap:.2207},Ni=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39016,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.73834,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89385,.85122,.77452,.86503,.75186,.68887,.79776,.88844,.85066,.94258,.77818,.7306,.76659,1.10369,1.39016,1.10369,1.06139,.89552,.8739,.86128,.94469,.8457,.94469,.89464,1.09842,.84636,.94469,1.03297,1.07692,.90918,1.03297,.95897,.94469,.9482,.94469,.94469,1.04692,.78223,1.20562,.94469,.90332,.98986,.86621,.90527,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.08707,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.73834,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89385,.85122,.85122,.85122,.85122,.85122,.85284,.85311,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.86128,.86128,.86128,.86128,.86128,.86128,.8693,.8457,.89464,.89464,.89464,.89464,.82601,.82601,.82601,.82601,.94469,.94469,.9482,.9482,.9482,.9482,.9482,.90747,.86651,.94469,.94469,.94469,.94469,.90527,.94469,.90527,.8675,.86128,.8675,.86128,.8675,.86128,.73834,.8457,.73834,.8457,.73834,.8457,.73834,.8457,.85193,.92454,.86477,.9921,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.81105,.84636,.81105,.84636,.81105,.84636,1,1,.86275,.94469,.90872,.95786,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77741,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.90452,.98156,1.11842,.77261,1.11429,.89385,.94469,1,1,.89385,.94469,.95877,.86901,.94469,.85122,.9482,.85122,.9482,.85122,.9482,.8667,.90016,.75186,1.04692,1,1,.75186,1.04692,.68887,.78223,.68887,.78223,.68887,.78223,.68887,.78223,1,1,.79776,.92188,.79776,1.23023,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.94258,.98986,.7306,.90527,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.86128,.76318,.8693,.85311,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67742,.96334,.93695,1.35191,1.40909,.95161,1.48387,.86686,.90861,.62267,.74359,.65649,.85498,.56963,.88254,1.23516,.8675,.81552,.75443,.84503,.73206,.76659,.86275,.85122,.90685,.77892,.85746,1.02638,.89385,.75657,.85122,.86275,.77452,.74171,.79776,.7306,.95165,.77818,.89772,.88831,.90685,.7306,.98142,1.02191,.96576,1.23516,.99018,.98142,.9236,.89258,.94035,1.02191,.78848,.96576,.9561,1.23516,.90918,.92578,.95424,.89746,.83969,.9482,.80113,.89442,.85208,.86155,.98022,.99018,1.00452,.81209,.99247,.89181,1.23516,.99018,.9482,.99018,.89181,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.88844,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89464,1,1,1,1,1,1,1,1,1,1,1,1,.96766,1,1,1,1,1,1,.94258,.98986,.94258,.98986,.94258,.98986,.7306,.90527,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.69043,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.99331,.82616,.91133,.84286,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90527,1.81055,.90527,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1.07185,.99413,.96334,1.08065,1,1,1,1,1,1,1,1,1,1,1],Ei={lineHeight:1.2207,lineGap:.2207},Pi=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.03374,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.00042,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.03828,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00034,.99977,1,.99997,1.00026,1.00078,1.00036,.99973,1.00013,1.0006,.99977,.99977,.99988,.85148,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,1.00069,1.00022,.99977,1.00001,.99984,1.00026,1.00001,1.00024,1.00001,.9999,1,1.0006,1.00001,1.00041,.99962,1.00026,1.0006,.99995,1.00041,.99942,.99973,.99927,1.00082,.99902,1.00026,1.00087,1.0006,1.00069,.99973,.99867,.99973,.9993,1.00026,1.00049,1.00056,1,.99988,.99935,.99995,.99954,1.00055,.99945,1.00032,1.0006,.99995,1.00026,.99995,1.00032,1.00001,1.00008,.99971,1.00019,.9994,1.00001,1.0006,1.00044,.99973,1.00023,1.00047,1,.99942,.99561,.99989,1.00035,.99977,1.00035,.99977,1.00019,.99944,1.00001,1.00021,.99926,1.00035,1.00035,.99942,1.00048,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.99989,1.00057,1.00001,.99936,1.00052,1.00012,.99996,1.00043,1,1.00035,.9994,.99976,1.00035,.99973,1.00052,1.00041,1.00119,1.00037,.99973,1.00002,.99986,1.00041,1.00041,.99902,.9996,1.00034,.99999,1.00026,.99999,1.00026,.99973,1.00052,.99973,1,.99973,1.00041,1.00075,.9994,1.0003,.99999,1,1.00041,.99955,1,.99915,.99973,.99973,1.00026,1.00119,.99955,.99973,1.0006,.99911,1.0006,1.00026,.99972,1.00026,.99902,1.00041,.99973,.99999,1,1,1.00038,1.0005,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,1.00047,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],ji={lineHeight:1.2,lineGap:.2},_i=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.0044,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99971,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.01011,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99977,1,1,1.00026,.99969,.99972,.99981,.9998,1.0006,.99977,.99977,1.00022,.91155,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,.99966,1.00022,1.00032,1.00001,.99944,1.00026,1.00001,.99968,1.00001,1.00047,1,1.0006,1.00001,.99981,1.00101,1.00026,1.0006,.99948,.99981,1.00064,.99973,.99942,1.00101,1.00061,1.00026,1.00069,1.0006,1.00014,.99973,1.01322,.99973,1.00065,1.00026,1.00012,.99923,1,1.00064,1.00076,.99948,1.00055,1.00063,1.00007,.99943,1.0006,.99948,1.00026,.99948,.99943,1.00001,1.00001,1.00029,1.00038,1.00035,1.00001,1.0006,1.0006,.99973,.99978,1.00001,1.00057,.99989,.99967,.99964,.99967,.99977,.99999,.99977,1.00038,.99977,1.00001,.99973,1.00066,.99967,.99967,1.00041,.99998,.99999,.99977,1.00022,.99967,1.00001,.99977,1.00026,.99964,1.00031,1.00001,.99999,.99999,1,1.00023,1,1,.99999,1.00035,1.00001,.99999,.99973,.99977,.99999,1.00058,.99973,.99973,.99955,.9995,1.00026,1.00026,1.00032,.99989,1.00034,.99999,1.00026,1.00026,1.00026,.99973,.45998,.99973,1.00026,.99973,1.00001,.99999,.99982,.99994,.99996,1,1.00042,1.00044,1.00029,1.00023,.99973,.99973,1.00026,.99949,1.00002,.99973,1.0006,1.0006,1.0006,.99975,1.00026,1.00026,1.00032,.98685,.99973,1.00026,1,1,.99966,1.00044,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1,.99973,.99971,.99978,1,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00098,1,1,1,1.00049,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],Xi={lineHeight:1.35,lineGap:.2},qi=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.0288,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,.99946,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.06311,.99973,1.00024,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,1.00041,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.89547,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00001,1,1.00054,.99977,1.00084,1.00007,.99973,1.00013,.99924,1.00001,1.00001,.99945,.91221,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00001,.99999,.99977,.99933,1.00022,1.00054,1.00001,1.00065,1.00026,1.00001,1.0001,1.00001,1.00052,1,1.0006,1.00001,.99945,.99897,.99968,.99924,1.00036,.99945,.99949,1,1.0006,.99897,.99918,.99968,.99911,.99924,1,.99962,1.01487,1,1.0005,.99973,1.00012,1.00043,1,.99995,.99994,1.00036,.99947,1.00019,1.00063,1.00025,.99924,1.00036,.99973,1.00036,1.00025,1.00001,1.00001,1.00027,1.0001,1.00068,1.00001,1.0006,1.0006,1,1.00008,.99957,.99972,.9994,.99954,.99975,1.00051,1.00001,1.00019,1.00001,1.0001,.99986,1.00001,1.00001,1.00038,.99954,.99954,.9994,1.00066,.99999,.99977,1.00022,1.00054,1.00001,.99977,1.00026,.99975,1.0001,1.00001,.99993,.9995,.99955,1.00016,.99978,.99974,1.00019,1.00022,.99955,1.00053,.99973,1.00089,1.00005,.99967,1.00048,.99973,1.00002,1.00034,.99973,.99973,.99964,1.00006,1.00066,.99947,.99973,.98894,.99973,1,.44898,1,.99946,1,1.00039,1.00082,.99991,.99991,.99985,1.00022,1.00023,1.00061,1.00006,.99966,.99973,.99973,.99973,1.00019,1.0008,1,.99924,.99924,.99924,.99983,1.00044,.99973,.99964,.98332,1,.99973,1,1,.99962,.99895,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,1.00423,.99925,.99999,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00049,1,1.00245,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,1.00003,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],Hi={lineHeight:1.35,lineGap:.2},Wi=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.04596,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,1.00019,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.02572,.99973,1.00005,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,.99999,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.84533,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99928,1,.99977,1.00013,1.00055,.99947,.99945,.99941,.99924,1.00001,1.00001,1.0004,.91621,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00005,.99999,.99977,1.00015,1.00022,.99977,1.00001,.99973,1.00026,1.00001,1.00019,1.00001,.99946,1,1.0006,1.00001,.99978,1.00045,.99973,.99924,1.00023,.99978,.99966,1,1.00065,1.00045,1.00019,.99973,.99973,.99924,1,1,.96499,1,1.00055,.99973,1.00008,1.00027,1,.9997,.99995,1.00023,.99933,1.00019,1.00015,1.00031,.99924,1.00023,.99973,1.00023,1.00031,1.00001,.99928,1.00029,1.00092,1.00035,1.00001,1.0006,1.0006,1,.99988,.99975,1,1.00082,.99561,.9996,1.00035,1.00001,.99962,1.00001,1.00092,.99964,1.00001,.99963,.99999,1.00035,1.00035,1.00082,.99962,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.9996,.99967,1.00001,1.00034,1.00074,1.00054,1.00053,1.00063,.99971,.99962,1.00035,.99975,.99977,.99973,1.00043,.99953,1.0007,.99915,.99973,1.00008,.99892,1.00073,1.00073,1.00114,.99915,1.00073,.99955,.99973,1.00092,.99973,1,.99998,1,1.0003,1,1.00043,1.00001,.99969,1.0003,1,1.00035,1.00001,.9995,1,1.00092,.99973,.99973,.99973,1.0007,.9995,1,.99924,1.0006,.99924,.99972,1.00062,.99973,1.00114,1.00073,1,.99955,1,1,1.00047,.99968,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,.99925,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],zi={lineHeight:1.2,lineGap:.2},$i=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,719,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,785,556,556,278,722,556,556,611,278,611,278,611,385,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,465,722,333,853,906,474,825,927,838,278,722,722,601,719,667,611,722,778,278,722,667,833,722,644,778,722,667,600,611,667,821,667,809,802,278,667,615,451,611,278,582,615,610,556,606,475,460,611,541,278,558,556,612,556,445,611,766,619,520,684,446,582,715,576,753,845,278,582,611,582,845,667,669,885,567,711,667,278,276,556,1094,1062,875,610,722,622,719,722,719,722,567,712,667,904,626,719,719,610,702,833,722,778,719,667,722,611,622,854,667,730,703,1005,1019,870,979,719,711,1031,719,556,618,615,417,635,556,709,497,615,615,500,635,740,604,611,604,611,556,490,556,875,556,615,581,833,844,729,854,615,552,854,583,556,556,611,417,552,556,278,281,278,969,906,611,500,615,556,604,778,611,487,447,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1094,556,885,489,1115,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],Gi=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Vi=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,740,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,782,556,556,278,722,556,556,611,278,611,278,611,396,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,333,722,333,854,906,473,844,930,847,278,722,722,610,671,667,611,722,778,278,722,667,833,722,657,778,718,667,590,611,667,822,667,829,781,278,667,620,479,611,278,591,620,621,556,610,479,492,611,558,278,566,556,603,556,450,611,712,605,532,664,409,591,704,578,773,834,278,591,611,591,834,667,667,886,614,719,667,278,278,556,1094,1042,854,622,719,677,719,722,708,722,614,722,667,927,643,719,719,615,687,833,722,778,719,667,722,611,677,781,667,729,708,979,989,854,1e3,708,719,1042,729,556,619,604,534,618,556,736,510,611,611,507,622,740,604,611,611,611,556,889,556,885,556,646,583,889,935,707,854,594,552,865,589,556,556,611,469,563,556,278,278,278,969,906,611,507,619,556,611,778,611,575,467,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1104,556,885,516,1146,1e3,768,600,834,834,834,834,999,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],Ki=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Ji=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,625,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,733,444,500,222,667,500,500,556,222,556,222,556,281,556,400,556,222,722,556,722,556,722,556,615,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,354,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,789,846,389,794,865,775,222,667,667,570,671,667,611,722,778,278,667,667,833,722,648,778,725,667,600,611,667,837,667,831,761,278,667,570,439,555,222,550,570,571,500,556,439,463,555,542,222,500,492,548,500,447,556,670,573,486,603,374,550,652,546,728,779,222,550,556,550,779,667,667,843,544,708,667,278,278,500,1066,982,844,589,715,639,724,667,651,667,544,704,667,917,614,715,715,589,686,833,722,778,725,667,722,611,639,795,667,727,673,920,923,805,886,651,694,1022,682,556,562,522,493,553,556,688,465,556,556,472,564,686,550,556,556,556,500,833,500,835,500,572,518,830,851,621,736,526,492,752,534,556,556,556,378,496,500,222,222,222,910,828,556,472,565,500,556,778,556,492,339,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1083,1e3,768,600,834,834,834,834,1e3,500,998,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,584,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],Yi=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Zi=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,615,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,735,444,500,222,667,500,500,556,222,556,222,556,292,556,334,556,222,722,556,722,556,722,556,604,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,375,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,784,838,384,774,855,752,222,667,667,551,668,667,611,722,778,278,667,668,833,722,650,778,722,667,618,611,667,798,667,835,748,278,667,578,446,556,222,547,578,575,500,557,446,441,556,556,222,500,500,576,500,448,556,690,569,482,617,395,547,648,525,713,781,222,547,556,547,781,667,667,865,542,719,667,278,278,500,1057,1010,854,583,722,635,719,667,656,667,542,677,667,923,604,719,719,583,656,833,722,778,719,667,722,611,635,760,667,740,667,917,938,792,885,656,719,1010,722,556,573,531,365,583,556,669,458,559,559,438,583,688,552,556,542,556,500,458,500,823,500,573,521,802,823,625,719,521,510,750,542,556,556,556,365,510,500,222,278,222,906,812,556,438,559,500,552,778,556,489,411,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1073,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],Qi=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],en=[1.36898,1,1,.72706,.80479,.83734,.98894,.99793,.9897,.93884,.86209,.94292,.94292,1.16661,1.02058,.93582,.96694,.93582,1.19137,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.78076,.78076,1.02058,1.02058,1.02058,.72851,.78966,.90838,.83637,.82391,.96376,.80061,.86275,.8768,.95407,1.0258,.73901,.85022,.83655,1.0156,.95546,.92179,.87107,.92179,.82114,.8096,.89713,.94438,.95353,.94083,.91905,.90406,.9446,.94292,1.18777,.94292,1.02058,.89903,.90088,.94938,.97898,.81093,.97571,.94938,1.024,.9577,.95933,.98621,1.0474,.97455,.98981,.9672,.95933,.9446,.97898,.97407,.97646,.78036,1.10208,.95442,.95298,.97579,.9332,.94039,.938,.80687,1.01149,.80687,1.02058,.80479,.99793,.99793,.99793,.99793,1.01149,1.00872,.90088,.91882,1.0213,.8361,1.02058,.62295,.54324,.89022,1.08595,1,1,.90088,1,.97455,.93582,.90088,1,1.05686,.8361,.99642,.99642,.99642,.72851,.90838,.90838,.90838,.90838,.90838,.90838,.868,.82391,.80061,.80061,.80061,.80061,1.0258,1.0258,1.0258,1.0258,.97484,.95546,.92179,.92179,.92179,.92179,.92179,1.02058,.92179,.94438,.94438,.94438,.94438,.90406,.86958,.98225,.94938,.94938,.94938,.94938,.94938,.94938,.9031,.81093,.94938,.94938,.94938,.94938,.98621,.98621,.98621,.98621,.93969,.95933,.9446,.9446,.9446,.9446,.9446,1.08595,.9446,.95442,.95442,.95442,.95442,.94039,.97898,.94039,.90838,.94938,.90838,.94938,.90838,.94938,.82391,.81093,.82391,.81093,.82391,.81093,.82391,.81093,.96376,.84313,.97484,.97571,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.8768,.9577,.8768,.9577,.8768,.9577,1,1,.95407,.95933,.97069,.95933,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,.887,1.01591,.73901,1.0474,1,1,.97455,.83655,.98981,1,1,.83655,.73977,.83655,.73903,.84638,1.033,.95546,.95933,1,1,.95546,.95933,.8271,.95417,.95933,.92179,.9446,.92179,.9446,.92179,.9446,.936,.91964,.82114,.97646,1,1,.82114,.97646,.8096,.78036,.8096,.78036,1,1,.8096,.78036,1,1,.89713,.77452,.89713,1.10208,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94083,.97579,.90406,.94039,.90406,.9446,.938,.9446,.938,.9446,.938,1,.99793,.90838,.94938,.868,.9031,.92179,.9446,1,1,.89713,1.10208,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90989,.9358,.91945,.83181,.75261,.87992,.82976,.96034,.83689,.97268,1.0078,.90838,.83637,.8019,.90157,.80061,.9446,.95407,.92436,1.0258,.85022,.97153,1.0156,.95546,.89192,.92179,.92361,.87107,.96318,.89713,.93704,.95638,.91905,.91709,.92796,1.0258,.93704,.94836,1.0373,.95933,1.0078,.95871,.94836,.96174,.92601,.9498,.98607,.95776,.95933,1.05453,1.0078,.98275,.9314,.95617,.91701,1.05993,.9446,.78367,.9553,1,.86832,1.0128,.95871,.99394,.87548,.96361,.86774,1.0078,.95871,.9446,.95871,.86774,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.94083,.97579,.94083,.97579,.94083,.97579,.90406,.94039,.96694,1,.89903,1,1,1,.93582,.93582,.93582,1,.908,.908,.918,.94219,.94219,.96544,1,1.285,1,1,.81079,.81079,1,1,.74854,1,1,1,1,.99793,1,1,1,.65,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.17173,1,.80535,.76169,1.02058,1.0732,1.05486,1,1,1.30692,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.16161,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],tn={lineHeight:1.2,lineGap:.2},an=[1.36898,1,1,.66227,.80779,.81625,.97276,.97276,.97733,.92222,.83266,.94292,.94292,1.16148,1.02058,.93582,.96694,.93582,1.17337,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.78076,.78076,1.02058,1.02058,1.02058,.71541,.76813,.85576,.80591,.80729,.94299,.77512,.83655,.86523,.92222,.98621,.71743,.81698,.79726,.98558,.92222,.90637,.83809,.90637,.80729,.76463,.86275,.90699,.91605,.9154,.85308,.85458,.90531,.94292,1.21296,.94292,1.02058,.89903,1.18616,.99613,.91677,.78216,.91677,.90083,.98796,.9135,.92168,.95381,.98981,.95298,.95381,.93459,.92168,.91513,.92004,.91677,.95077,.748,1.04502,.91677,.92061,.94236,.89544,.89364,.9,.80687,.8578,.80687,1.02058,.80779,.97276,.97276,.97276,.97276,.8578,.99973,1.18616,.91339,1.08074,.82891,1.02058,.55509,.71526,.89022,1.08595,1,1,1.18616,1,.96736,.93582,1.18616,1,1.04864,.82711,.99043,.99043,.99043,.71541,.85576,.85576,.85576,.85576,.85576,.85576,.845,.80729,.77512,.77512,.77512,.77512,.98621,.98621,.98621,.98621,.95961,.92222,.90637,.90637,.90637,.90637,.90637,1.02058,.90251,.90699,.90699,.90699,.90699,.85458,.83659,.94951,.99613,.99613,.99613,.99613,.99613,.99613,.85811,.78216,.90083,.90083,.90083,.90083,.95381,.95381,.95381,.95381,.9135,.92168,.91513,.91513,.91513,.91513,.91513,1.08595,.91677,.91677,.91677,.91677,.91677,.89364,.92332,.89364,.85576,.99613,.85576,.99613,.85576,.99613,.80729,.78216,.80729,.78216,.80729,.78216,.80729,.78216,.94299,.76783,.95961,.91677,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.86523,.9135,.86523,.9135,.86523,.9135,1,1,.92222,.92168,.92222,.92168,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.86036,.97096,.71743,.98981,1,1,.95298,.79726,.95381,1,1,.79726,.6894,.79726,.74321,.81691,1.0006,.92222,.92168,1,1,.92222,.92168,.79464,.92098,.92168,.90637,.91513,.90637,.91513,.90637,.91513,.909,.87514,.80729,.95077,1,1,.80729,.95077,.76463,.748,.76463,.748,1,1,.76463,.748,1,1,.86275,.72651,.86275,1.04502,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.9154,.94236,.85458,.89364,.85458,.90531,.9,.90531,.9,.90531,.9,1,.97276,.85576,.99613,.845,.85811,.90251,.91677,1,1,.86275,1.04502,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.00899,1.30628,.85576,.80178,.66862,.7927,.69323,.88127,.72459,.89711,.95381,.85576,.80591,.7805,.94729,.77512,.90531,.92222,.90637,.98621,.81698,.92655,.98558,.92222,.85359,.90637,.90976,.83809,.94523,.86275,.83509,.93157,.85308,.83392,.92346,.98621,.83509,.92886,.91324,.92168,.95381,.90646,.92886,.90557,.86847,.90276,.91324,.86842,.92168,.99531,.95381,.9224,.85408,.92699,.86847,1.0051,.91513,.80487,.93481,1,.88159,1.05214,.90646,.97355,.81539,.89398,.85923,.95381,.90646,.91513,.90646,.85923,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9154,.94236,.9154,.94236,.9154,.94236,.85458,.89364,.96694,1,.89903,1,1,1,.91782,.91782,.91782,1,.896,.896,.896,.9332,.9332,.95973,1,1.26,1,1,.80479,.80178,1,1,.85633,1,1,1,1,.97276,1,1,1,.698,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.14542,1,.79199,.78694,1.02058,1.03493,1.05486,1,1,1.23026,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.20006,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],rn={lineHeight:1.2,lineGap:.2},nn=[1.36898,1,1,.65507,.84943,.85639,.88465,.88465,.86936,.88307,.86948,.85283,.85283,1.06383,1.02058,.75945,.9219,.75945,1.17337,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.75945,.75945,1.02058,1.02058,1.02058,.69046,.70926,.85158,.77812,.76852,.89591,.70466,.76125,.80094,.86822,.83864,.728,.77212,.79475,.93637,.87514,.8588,.76013,.8588,.72421,.69866,.77598,.85991,.80811,.87832,.78112,.77512,.8562,1.0222,1.18417,1.0222,1.27014,.89903,1.15012,.93859,.94399,.846,.94399,.81453,1.0186,.94219,.96017,1.03075,1.02175,.912,1.03075,.96998,.96017,.93859,.94399,.94399,.95493,.746,1.12658,.94578,.91,.979,.882,.882,.83,.85034,.83537,.85034,1.02058,.70869,.88465,.88465,.88465,.88465,.83537,.90083,1.15012,.9161,.94565,.73541,1.02058,.53609,.69353,.79519,1.08595,1,1,1.15012,1,.91974,.75945,1.15012,1,.9446,.73361,.9005,.9005,.9005,.62864,.85158,.85158,.85158,.85158,.85158,.85158,.773,.76852,.70466,.70466,.70466,.70466,.83864,.83864,.83864,.83864,.90561,.87514,.8588,.8588,.8588,.8588,.8588,1.02058,.85751,.85991,.85991,.85991,.85991,.77512,.76013,.88075,.93859,.93859,.93859,.93859,.93859,.93859,.8075,.846,.81453,.81453,.81453,.81453,.82424,.82424,.82424,.82424,.9278,.96017,.93859,.93859,.93859,.93859,.93859,1.08595,.8562,.94578,.94578,.94578,.94578,.882,.94578,.882,.85158,.93859,.85158,.93859,.85158,.93859,.76852,.846,.76852,.846,.76852,.846,.76852,.846,.89591,.8544,.90561,.94399,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.80094,.94219,.80094,.94219,.80094,.94219,1,1,.86822,.96017,.86822,.96017,.83864,.82424,.83864,.82424,.83864,.82424,.83864,1.03075,.83864,.82424,.81402,1.02738,.728,1.02175,1,1,.912,.79475,1.03075,1,1,.79475,.83911,.79475,.66266,.80553,1.06676,.87514,.96017,1,1,.87514,.96017,.86865,.87396,.96017,.8588,.93859,.8588,.93859,.8588,.93859,.867,.84759,.72421,.95493,1,1,.72421,.95493,.69866,.746,.69866,.746,1,1,.69866,.746,1,1,.77598,.88417,.77598,1.12658,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.87832,.979,.77512,.882,.77512,.8562,.83,.8562,.83,.8562,.83,1,.88465,.85158,.93859,.773,.8075,.85751,.8562,1,1,.77598,1.12658,1.15012,1.15012,1.15012,1.15012,1.15012,1.15313,1.15012,1.15012,1.15012,1.08106,1.03901,.85158,.77025,.62264,.7646,.65351,.86026,.69461,.89947,1.03075,.85158,.77812,.76449,.88836,.70466,.8562,.86822,.8588,.83864,.77212,.85308,.93637,.87514,.82352,.8588,.85701,.76013,.89058,.77598,.8156,.82565,.78112,.77899,.89386,.83864,.8156,.9486,.92388,.96186,1.03075,.91123,.9486,.93298,.878,.93942,.92388,.84596,.96186,.95119,1.03075,.922,.88787,.95829,.88,.93559,.93859,.78815,.93758,1,.89217,1.03737,.91123,.93969,.77487,.85769,.86799,1.03075,.91123,.93859,.91123,.86799,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87832,.979,.87832,.979,.87832,.979,.77512,.882,.9219,1,.89903,1,1,1,.87321,.87321,.87321,1,1.027,1.027,1.027,.86847,.86847,.79121,1,1.124,1,1,.73572,.73572,1,1,.85034,1,1,1,1,.88465,1,1,1,.669,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.04828,1,.74948,.75187,1.02058,.98391,1.02119,1,1,1.06233,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05233,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],sn={lineHeight:1.2,lineGap:.2},on=[1.36898,1,1,.76305,.82784,.94935,.89364,.92241,.89073,.90706,.98472,.85283,.85283,1.0664,1.02058,.74505,.9219,.74505,1.23456,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.74505,.74505,1.02058,1.02058,1.02058,.73002,.72601,.91755,.8126,.80314,.92222,.73764,.79726,.83051,.90284,.86023,.74,.8126,.84869,.96518,.91115,.8858,.79761,.8858,.74498,.73914,.81363,.89591,.83659,.89633,.85608,.8111,.90531,1.0222,1.22736,1.0222,1.27014,.89903,.90088,.86667,1.0231,.896,1.01411,.90083,1.05099,1.00512,.99793,1.05326,1.09377,.938,1.06226,1.00119,.99793,.98714,1.0231,1.01231,.98196,.792,1.19137,.99074,.962,1.01915,.926,.942,.856,.85034,.92006,.85034,1.02058,.69067,.92241,.92241,.92241,.92241,.92006,.9332,.90088,.91882,.93484,.75339,1.02058,.56866,.54324,.79519,1.08595,1,1,.90088,1,.95325,.74505,.90088,1,.97198,.75339,.91009,.91009,.91009,.66466,.91755,.91755,.91755,.91755,.91755,.91755,.788,.80314,.73764,.73764,.73764,.73764,.86023,.86023,.86023,.86023,.92915,.91115,.8858,.8858,.8858,.8858,.8858,1.02058,.8858,.89591,.89591,.89591,.89591,.8111,.79611,.89713,.86667,.86667,.86667,.86667,.86667,.86667,.86936,.896,.90083,.90083,.90083,.90083,.84224,.84224,.84224,.84224,.97276,.99793,.98714,.98714,.98714,.98714,.98714,1.08595,.89876,.99074,.99074,.99074,.99074,.942,1.0231,.942,.91755,.86667,.91755,.86667,.91755,.86667,.80314,.896,.80314,.896,.80314,.896,.80314,.896,.92222,.93372,.92915,1.01411,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.83051,1.00512,.83051,1.00512,.83051,1.00512,1,1,.90284,.99793,.90976,.99793,.86023,.84224,.86023,.84224,.86023,.84224,.86023,1.05326,.86023,.84224,.82873,1.07469,.74,1.09377,1,1,.938,.84869,1.06226,1,1,.84869,.83704,.84869,.81441,.85588,1.08927,.91115,.99793,1,1,.91115,.99793,.91887,.90991,.99793,.8858,.98714,.8858,.98714,.8858,.98714,.894,.91434,.74498,.98196,1,1,.74498,.98196,.73914,.792,.73914,.792,1,1,.73914,.792,1,1,.81363,.904,.81363,1.19137,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89633,1.01915,.8111,.942,.8111,.90531,.856,.90531,.856,.90531,.856,1,.92241,.91755,.86667,.788,.86936,.8858,.89876,1,1,.81363,1.19137,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90388,1.03901,.92138,.78105,.7154,.86169,.80513,.94007,.82528,.98612,1.06226,.91755,.8126,.81884,.92819,.73764,.90531,.90284,.8858,.86023,.8126,.91172,.96518,.91115,.83089,.8858,.87791,.79761,.89297,.81363,.88157,.89992,.85608,.81992,.94307,.86023,.88157,.95308,.98699,.99793,1.06226,.95817,.95308,.97358,.928,.98088,.98699,.92761,.99793,.96017,1.06226,.986,.944,.95978,.938,.96705,.98714,.80442,.98972,1,.89762,1.04552,.95817,.99007,.87064,.91879,.88888,1.06226,.95817,.98714,.95817,.88888,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89633,1.01915,.89633,1.01915,.89633,1.01915,.8111,.942,.9219,1,.89903,1,1,1,.93173,.93173,.93173,1,1.06304,1.06304,1.06904,.89903,.89903,.80549,1,1.156,1,1,.76575,.76575,1,1,.72458,1,1,1,1,.92241,1,1,1,.619,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.07257,1,.74705,.71119,1.02058,1.024,1.02119,1,1,1.1536,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05638,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],cn={lineHeight:1.2,lineGap:.2},ln=[1.76738,1,1,.99297,.9824,1.04016,1.06497,1.03424,.97529,1.17647,1.23203,1.1085,1.1085,1.16939,1.2107,.9754,1.21408,.9754,1.59578,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,.81378,.81378,1.2107,1.2107,1.2107,.71703,.97847,.97363,.88776,.8641,1.02096,.79795,.85132,.914,1.06085,1.1406,.8007,.89858,.83693,1.14889,1.09398,.97489,.92094,.97489,.90399,.84041,.95923,1.00135,1,1.06467,.98243,.90996,.99361,1.1085,1.56942,1.1085,1.2107,.74627,.94282,.96752,1.01519,.86304,1.01359,.97278,1.15103,1.01359,.98561,1.02285,1.02285,1.00527,1.02285,1.0302,.99041,1.0008,1.01519,1.01359,1.02258,.79104,1.16862,.99041,.97454,1.02511,.99298,.96752,.95801,.94856,1.16579,.94856,1.2107,.9824,1.03424,1.03424,1,1.03424,1.16579,.8727,1.3871,1.18622,1.10818,1.04478,1.2107,1.18622,.75155,.94994,1.28826,1.21408,1.21408,.91056,1,.91572,.9754,.64663,1.18328,1.24866,1.04478,1.14169,1.15749,1.17389,.71703,.97363,.97363,.97363,.97363,.97363,.97363,.93506,.8641,.79795,.79795,.79795,.79795,1.1406,1.1406,1.1406,1.1406,1.02096,1.09398,.97426,.97426,.97426,.97426,.97426,1.2107,.97489,1.00135,1.00135,1.00135,1.00135,.90996,.92094,1.02798,.96752,.96752,.96752,.96752,.96752,.96752,.93136,.86304,.97278,.97278,.97278,.97278,1.02285,1.02285,1.02285,1.02285,.97122,.99041,1,1,1,1,1,1.28826,1.0008,.99041,.99041,.99041,.99041,.96752,1.01519,.96752,.97363,.96752,.97363,.96752,.97363,.96752,.8641,.86304,.8641,.86304,.8641,.86304,.8641,.86304,1.02096,1.03057,1.02096,1.03517,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.914,1.01359,.914,1.01359,.914,1.01359,1,1,1.06085,.98561,1.06085,1.00879,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,.97138,1.08692,.8007,1.02285,1,1,1.00527,.83693,1.02285,1,1,.83693,.9455,.83693,.90418,.83693,1.13005,1.09398,.99041,1,1,1.09398,.99041,.96692,1.09251,.99041,.97489,1.0008,.97489,1.0008,.97489,1.0008,.93994,.97931,.90399,1.02258,1,1,.90399,1.02258,.84041,.79104,.84041,.79104,.84041,.79104,.84041,.79104,1,1,.95923,1.07034,.95923,1.16862,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.06467,1.02511,.90996,.96752,.90996,.99361,.95801,.99361,.95801,.99361,.95801,1.07733,1.03424,.97363,.96752,.93506,.93136,.97489,1.0008,1,1,.95923,1.16862,1.15103,1.15103,1.01173,1.03959,.75953,.81378,.79912,1.15103,1.21994,.95161,.87815,1.01149,.81525,.7676,.98167,1.01134,1.02546,.84097,1.03089,1.18102,.97363,.88776,.85134,.97826,.79795,.99361,1.06085,.97489,1.1406,.89858,1.0388,1.14889,1.09398,.86039,.97489,1.0595,.92094,.94793,.95923,.90996,.99346,.98243,1.02112,.95493,1.1406,.90996,1.03574,1.02597,1.0008,1.18102,1.06628,1.03574,1.0192,1.01932,1.00886,.97531,1.0106,1.0008,1.13189,1.18102,1.02277,.98683,1.0016,.99561,1.07237,1.0008,.90434,.99921,.93803,.8965,1.23085,1.06628,1.04983,.96268,1.0499,.98439,1.18102,1.06628,1.0008,1.06628,.98439,.79795,1,1,1,1,1,1,1,1,1,1,1,1,1.09466,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.97278,1,1,1,1,1,1,1,1,1,1,1,1,1.02065,1,1,1,1,1,1,1.06467,1.02511,1.06467,1.02511,1.06467,1.02511,.90996,.96752,1,1.21408,.89903,1,1,.75155,1.04394,1.04394,1.04394,1.04394,.98633,.98633,.98633,.73047,.73047,1.20642,.91211,1.25635,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.12454,.93503,1.03424,1.19687,1.03424,1,1,1,.771,1,1,1.15749,1.15749,1.15749,1.10948,.86279,.94434,.86279,.94434,.86182,1,1,1.16897,1,.96085,.90137,1.2107,1.18416,1.13973,.69825,.9716,2.10339,1.29004,1.29004,1.21172,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18874,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.09193,1.09193,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],hn={lineHeight:1.33008,lineGap:0},un=[1.76738,1,1,.98946,1.03959,1.04016,1.02809,1.036,.97639,1.10953,1.23203,1.11144,1.11144,1.16939,1.21237,.9754,1.21261,.9754,1.59754,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,.81378,.81378,1.21237,1.21237,1.21237,.73541,.97847,.97363,.89723,.87897,1.0426,.79429,.85292,.91149,1.05815,1.1406,.79631,.90128,.83853,1.04396,1.10615,.97552,.94436,.97552,.88641,.80527,.96083,1.00135,1,1.06777,.9817,.91142,.99361,1.11144,1.57293,1.11144,1.21237,.74627,1.31818,1.06585,.97042,.83055,.97042,.93503,1.1261,.97042,.97922,1.14236,.94552,1.01054,1.14236,1.02471,.97922,.94165,.97042,.97042,1.0276,.78929,1.1261,.97922,.95874,1.02197,.98507,.96752,.97168,.95107,1.16579,.95107,1.21237,1.03959,1.036,1.036,1,1.036,1.16579,.87357,1.31818,1.18754,1.26781,1.05356,1.21237,1.18622,.79487,.94994,1.29004,1.24047,1.24047,1.31818,1,.91484,.9754,1.31818,1.1349,1.24866,1.05356,1.13934,1.15574,1.17389,.73541,.97363,.97363,.97363,.97363,.97363,.97363,.94385,.87897,.79429,.79429,.79429,.79429,1.1406,1.1406,1.1406,1.1406,1.0426,1.10615,.97552,.97552,.97552,.97552,.97552,1.21237,.97552,1.00135,1.00135,1.00135,1.00135,.91142,.94436,.98721,1.06585,1.06585,1.06585,1.06585,1.06585,1.06585,.96705,.83055,.93503,.93503,.93503,.93503,1.14236,1.14236,1.14236,1.14236,.93125,.97922,.94165,.94165,.94165,.94165,.94165,1.29004,.94165,.97922,.97922,.97922,.97922,.96752,.97042,.96752,.97363,1.06585,.97363,1.06585,.97363,1.06585,.87897,.83055,.87897,.83055,.87897,.83055,.87897,.83055,1.0426,1.0033,1.0426,.97042,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.91149,.97042,.91149,.97042,.91149,.97042,1,1,1.05815,.97922,1.05815,.97922,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,.97441,1.04302,.79631,1.01582,1,1,1.01054,.83853,1.14236,1,1,.83853,1.09125,.83853,.90418,.83853,1.19508,1.10615,.97922,1,1,1.10615,.97922,1.01034,1.10466,.97922,.97552,.94165,.97552,.94165,.97552,.94165,.91602,.91981,.88641,1.0276,1,1,.88641,1.0276,.80527,.78929,.80527,.78929,.80527,.78929,.80527,.78929,1,1,.96083,1.05403,.95923,1.16862,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.06777,1.02197,.91142,.96752,.91142,.99361,.97168,.99361,.97168,.99361,.97168,1.23199,1.036,.97363,1.06585,.94385,.96705,.97552,.94165,1,1,.96083,1.1261,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,.95161,1.27126,1.00811,.83284,.77702,.99137,.95253,1.0347,.86142,1.07205,1.14236,.97363,.89723,.86869,1.09818,.79429,.99361,1.05815,.97552,1.1406,.90128,1.06662,1.04396,1.10615,.84918,.97552,1.04694,.94436,.98015,.96083,.91142,1.00356,.9817,1.01945,.98999,1.1406,.91142,1.04961,.9898,1.00639,1.14236,1.07514,1.04961,.99607,1.02897,1.008,.9898,.95134,1.00639,1.11121,1.14236,1.00518,.97981,1.02186,1,1.08578,.94165,.99314,.98387,.93028,.93377,1.35125,1.07514,1.10687,.93491,1.04232,1.00351,1.14236,1.07514,.94165,1.07514,1.00351,.79429,1,1,1,1,1,1,1,1,1,1,1,1,1.09097,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.93503,1,1,1,1,1,1,1,1,1,1,1,1,.96609,1,1,1,1,1,1,1.06777,1.02197,1.06777,1.02197,1.06777,1.02197,.91142,.96752,1,1.21261,.89903,1,1,.75155,1.04745,1.04745,1.04745,1.04394,.98633,.98633,.98633,.72959,.72959,1.20502,.91406,1.26514,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.09125,.93327,1.03336,1.16541,1.036,1,1,1,.771,1,1,1.15574,1.15574,1.15574,1.15574,.86364,.94434,.86279,.94434,.86224,1,1,1.16798,1,.96085,.90068,1.21237,1.18416,1.13904,.69825,.9716,2.10339,1.29004,1.29004,1.21339,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18775,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.13269,1.13269,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],dn={lineHeight:1.33008,lineGap:0},fn=[1.76738,1,1,.98946,1.14763,1.05365,1.06234,.96927,.92586,1.15373,1.18414,.91349,.91349,1.07403,1.17308,.78383,1.20088,.78383,1.42531,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78383,.78383,1.17308,1.17308,1.17308,.77349,.94565,.94729,.85944,.88506,.9858,.74817,.80016,.88449,.98039,.95782,.69238,.89898,.83231,.98183,1.03989,.96924,.86237,.96924,.80595,.74524,.86091,.95402,.94143,.98448,.8858,.83089,.93285,1.0949,1.39016,1.0949,1.45994,.74627,1.04839,.97454,.97454,.87207,.97454,.87533,1.06151,.97454,1.00176,1.16484,1.08132,.98047,1.16484,1.02989,1.01054,.96225,.97454,.97454,1.06598,.79004,1.16344,1.00351,.94629,.9973,.91016,.96777,.9043,.91082,.92481,.91082,1.17308,.95748,.96927,.96927,1,.96927,.92481,.80597,1.04839,1.23393,1.1781,.9245,1.17308,1.20808,.63218,.94261,1.24822,1.09971,1.09971,1.04839,1,.85273,.78032,1.04839,1.09971,1.22326,.9245,1.09836,1.13525,1.15222,.70424,.94729,.94729,.94729,.94729,.94729,.94729,.85498,.88506,.74817,.74817,.74817,.74817,.95782,.95782,.95782,.95782,.9858,1.03989,.96924,.96924,.96924,.96924,.96924,1.17308,.96924,.95402,.95402,.95402,.95402,.83089,.86237,.88409,.97454,.97454,.97454,.97454,.97454,.97454,.92916,.87207,.87533,.87533,.87533,.87533,.93146,.93146,.93146,.93146,.93854,1.01054,.96225,.96225,.96225,.96225,.96225,1.24822,.8761,1.00351,1.00351,1.00351,1.00351,.96777,.97454,.96777,.94729,.97454,.94729,.97454,.94729,.97454,.88506,.87207,.88506,.87207,.88506,.87207,.88506,.87207,.9858,.95391,.9858,.97454,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.88449,.97454,.88449,.97454,.88449,.97454,1,1,.98039,1.00176,.98039,1.00176,.95782,.93146,.95782,.93146,.95782,.93146,.95782,1.16484,.95782,.93146,.84421,1.12761,.69238,1.08132,1,1,.98047,.83231,1.16484,1,1,.84723,1.04861,.84723,.78755,.83231,1.23736,1.03989,1.01054,1,1,1.03989,1.01054,.9857,1.03849,1.01054,.96924,.96225,.96924,.96225,.96924,.96225,.92383,.90171,.80595,1.06598,1,1,.80595,1.06598,.74524,.79004,.74524,.79004,.74524,.79004,.74524,.79004,1,1,.86091,1.02759,.85771,1.16344,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.98448,.9973,.83089,.96777,.83089,.93285,.9043,.93285,.9043,.93285,.9043,1.31868,.96927,.94729,.97454,.85498,.92916,.96924,.8761,1,1,.86091,1.16344,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,.81965,.81965,.94729,.78032,.71022,.90883,.84171,.99877,.77596,1.05734,1.2,.94729,.85944,.82791,.9607,.74817,.93285,.98039,.96924,.95782,.89898,.98316,.98183,1.03989,.78614,.96924,.97642,.86237,.86075,.86091,.83089,.90082,.8858,.97296,1.01284,.95782,.83089,1.0976,1.04,1.03342,1.2,1.0675,1.0976,.98205,1.03809,1.05097,1.04,.95364,1.03342,1.05401,1.2,1.02148,1.0119,1.04724,1.0127,1.02732,.96225,.8965,.97783,.93574,.94818,1.30679,1.0675,1.11826,.99821,1.0557,1.0326,1.2,1.0675,.96225,1.0675,1.0326,.74817,1,1,1,1,1,1,1,1,1,1,1,1,1.03754,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87533,1,1,1,1,1,1,1,1,1,1,1,1,.98705,1,1,1,1,1,1,.98448,.9973,.98448,.9973,.98448,.9973,.83089,.96777,1,1.20088,.89903,1,1,.75155,.94945,.94945,.94945,.94945,1.12317,1.12317,1.12317,.67603,.67603,1.15621,.73584,1.21191,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87709,.96927,1.01473,.96927,1,1,1,.77295,1,1,1.09836,1.09836,1.09836,1.01522,.86321,.94434,.8649,.94434,.86182,1,1,1.083,1,.91578,.86438,1.17308,1.18416,1.14589,.69825,.97622,1.96791,1.24822,1.24822,1.17308,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.17984,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10742,1.10742,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],gn={lineHeight:1.33008,lineGap:0},pn=[1.76738,1,1,.98594,1.02285,1.10454,1.06234,.96927,.92037,1.19985,1.2046,.90616,.90616,1.07152,1.1714,.78032,1.20088,.78032,1.40246,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78032,.78032,1.1714,1.1714,1.1714,.80597,.94084,.96706,.85944,.85734,.97093,.75842,.79936,.88198,.9831,.95782,.71387,.86969,.84636,1.07796,1.03584,.96924,.83968,.96924,.82826,.79649,.85771,.95132,.93119,.98965,.88433,.8287,.93365,1.08612,1.3638,1.08612,1.45786,.74627,.80499,.91484,1.05707,.92383,1.05882,.9403,1.12654,1.05882,1.01756,1.09011,1.09011,.99414,1.09011,1.034,1.01756,1.05356,1.05707,1.05882,1.04399,.84863,1.21968,1.01756,.95801,1.00068,.91797,.96777,.9043,.90351,.92105,.90351,1.1714,.85337,.96927,.96927,.99912,.96927,.92105,.80597,1.2434,1.20808,1.05937,.90957,1.1714,1.20808,.75155,.94261,1.24644,1.09971,1.09971,.84751,1,.85273,.78032,.61584,1.05425,1.17914,.90957,1.08665,1.11593,1.14169,.73381,.96706,.96706,.96706,.96706,.96706,.96706,.86035,.85734,.75842,.75842,.75842,.75842,.95782,.95782,.95782,.95782,.97093,1.03584,.96924,.96924,.96924,.96924,.96924,1.1714,.96924,.95132,.95132,.95132,.95132,.8287,.83968,.89049,.91484,.91484,.91484,.91484,.91484,.91484,.93575,.92383,.9403,.9403,.9403,.9403,.8717,.8717,.8717,.8717,1.00527,1.01756,1.05356,1.05356,1.05356,1.05356,1.05356,1.24644,.95923,1.01756,1.01756,1.01756,1.01756,.96777,1.05707,.96777,.96706,.91484,.96706,.91484,.96706,.91484,.85734,.92383,.85734,.92383,.85734,.92383,.85734,.92383,.97093,1.0969,.97093,1.05882,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.88198,1.05882,.88198,1.05882,.88198,1.05882,1,1,.9831,1.01756,.9831,1.01756,.95782,.8717,.95782,.8717,.95782,.8717,.95782,1.09011,.95782,.8717,.84784,1.11551,.71387,1.09011,1,1,.99414,.84636,1.09011,1,1,.84636,1.0536,.84636,.94298,.84636,1.23297,1.03584,1.01756,1,1,1.03584,1.01756,1.00323,1.03444,1.01756,.96924,1.05356,.96924,1.05356,.96924,1.05356,.93066,.98293,.82826,1.04399,1,1,.82826,1.04399,.79649,.84863,.79649,.84863,.79649,.84863,.79649,.84863,1,1,.85771,1.17318,.85771,1.21968,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.98965,1.00068,.8287,.96777,.8287,.93365,.9043,.93365,.9043,.93365,.9043,1.08571,.96927,.96706,.91484,.86035,.93575,.96924,.95923,1,1,.85771,1.21968,1.11437,1.11437,.93109,.91202,.60411,.84164,.55572,1.01173,.97361,.81818,.81818,.96635,.78032,.72727,.92366,.98601,1.03405,.77968,1.09799,1.2,.96706,.85944,.85638,.96491,.75842,.93365,.9831,.96924,.95782,.86969,.94152,1.07796,1.03584,.78437,.96924,.98715,.83968,.83491,.85771,.8287,.94492,.88433,.9287,1.0098,.95782,.8287,1.0625,.98248,1.03424,1.2,1.01071,1.0625,.95246,1.03809,1.04912,.98248,1.00221,1.03424,1.05443,1.2,1.04785,.99609,1.00169,1.05176,.99346,1.05356,.9087,1.03004,.95542,.93117,1.23362,1.01071,1.07831,1.02512,1.05205,1.03502,1.2,1.01071,1.05356,1.01071,1.03502,.75842,1,1,1,1,1,1,1,1,1,1,1,1,1.03719,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9403,1,1,1,1,1,1,1,1,1,1,1,1,1.04021,1,1,1,1,1,1,.98965,1.00068,.98965,1.00068,.98965,1.00068,.8287,.96777,1,1.20088,.89903,1,1,.75155,1.03077,1.03077,1.03077,1.03077,1.13196,1.13196,1.13196,.67428,.67428,1.16039,.73291,1.20996,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87796,.96927,1.01518,.96927,1,1,1,.77295,1,1,1.10539,1.10539,1.11358,1.06967,.86279,.94434,.86279,.94434,.86182,1,1,1.083,1,.91578,.86507,1.1714,1.18416,1.14589,.69825,.97622,1.9697,1.24822,1.24822,1.17238,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18083,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10938,1.10938,1,1,1,1.05425,1.09971,1.09971,1.09971,1,1,1,1,1,1,1,1,1,1,1],mn={lineHeight:1.33008,lineGap:0},bn=getLookupTableFactory((function(e){e["MyriadPro-Regular"]=e["PdfJS-Fallback-Regular"]={name:"LiberationSans-Regular",factors:on,baseWidths:Zi,baseMapping:Qi,metrics:cn};e["MyriadPro-Bold"]=e["PdfJS-Fallback-Bold"]={name:"LiberationSans-Bold",factors:en,baseWidths:$i,baseMapping:Gi,metrics:tn};e["MyriadPro-It"]=e["MyriadPro-Italic"]=e["PdfJS-Fallback-Italic"]={name:"LiberationSans-Italic",factors:nn,baseWidths:Ji,baseMapping:Yi,metrics:sn};e["MyriadPro-BoldIt"]=e["MyriadPro-BoldItalic"]=e["PdfJS-Fallback-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:an,baseWidths:Vi,baseMapping:Ki,metrics:rn};e.ArialMT=e.Arial=e["Arial-Regular"]={name:"LiberationSans-Regular",baseWidths:Zi,baseMapping:Qi};e["Arial-BoldMT"]=e["Arial-Bold"]={name:"LiberationSans-Bold",baseWidths:$i,baseMapping:Gi};e["Arial-ItalicMT"]=e["Arial-Italic"]={name:"LiberationSans-Italic",baseWidths:Ji,baseMapping:Yi};e["Arial-BoldItalicMT"]=e["Arial-BoldItalic"]={name:"LiberationSans-BoldItalic",baseWidths:Vi,baseMapping:Ki};e["Calibri-Regular"]={name:"LiberationSans-Regular",factors:Ni,baseWidths:Zi,baseMapping:Qi,metrics:Ei};e["Calibri-Bold"]={name:"LiberationSans-Bold",factors:Ti,baseWidths:$i,baseMapping:Gi,metrics:Oi};e["Calibri-Italic"]={name:"LiberationSans-Italic",factors:Bi,baseWidths:Ji,baseMapping:Yi,metrics:Ri};e["Calibri-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Mi,baseWidths:Vi,baseMapping:Ki,metrics:Di};e["Segoeui-Regular"]={name:"LiberationSans-Regular",factors:pn,baseWidths:Zi,baseMapping:Qi,metrics:mn};e["Segoeui-Bold"]={name:"LiberationSans-Bold",factors:ln,baseWidths:$i,baseMapping:Gi,metrics:hn};e["Segoeui-Italic"]={name:"LiberationSans-Italic",factors:fn,baseWidths:Ji,baseMapping:Yi,metrics:gn};e["Segoeui-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:un,baseWidths:Vi,baseMapping:Ki,metrics:dn};e["Helvetica-Regular"]=e.Helvetica={name:"LiberationSans-Regular",factors:Wi,baseWidths:Zi,baseMapping:Qi,metrics:zi};e["Helvetica-Bold"]={name:"LiberationSans-Bold",factors:Pi,baseWidths:$i,baseMapping:Gi,metrics:ji};e["Helvetica-Italic"]={name:"LiberationSans-Italic",factors:qi,baseWidths:Ji,baseMapping:Yi,metrics:Hi};e["Helvetica-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:_i,baseWidths:Vi,baseMapping:Ki,metrics:Xi}}));function getXfaFontName(e){const t=normalizeFontName(e);return bn()[t]}function getXfaFontDict(e){const t=function getXfaFontWidths(e){const t=getXfaFontName(e);if(!t)return null;const{baseWidths:a,baseMapping:r,factors:i}=t,n=i?a.map(((e,t)=>e*i[t])):a;let s,o=-2;const c=[];for(const[e,t]of r.map(((e,t)=>[e,t])).sort((([e],[t])=>e-t)))if(-1!==e)if(e===o+1){s.push(n[t]);o+=1}else{o=e;s=[n[t]];c.push(e,s)}return c}(e),a=new Dict(null);a.set("BaseFont",Name.get(e));a.set("Type",Name.get("Font"));a.set("Subtype",Name.get("CIDFontType2"));a.set("Encoding",Name.get("Identity-H"));a.set("CIDToGIDMap",Name.get("Identity"));a.set("W",t);a.set("FirstChar",t[0]);a.set("LastChar",t.at(-2)+t.at(-1).length-1);const r=new Dict(null);a.set("FontDescriptor",r);const i=new Dict(null);i.set("Ordering","Identity");i.set("Registry","Adobe");i.set("Supplement",0);a.set("CIDSystemInfo",i);return a}class PostScriptParser{constructor(e){this.lexer=e;this.operators=[];this.token=null;this.prev=null}nextToken(){this.prev=this.token;this.token=this.lexer.getToken()}accept(e){if(this.token.type===e){this.nextToken();return!0}return!1}expect(e){if(this.accept(e))return!0;throw new FormatError(`Unexpected symbol: found ${this.token.type} expected ${e}.`)}parse(){this.nextToken();this.expect(yn.LBRACE);this.parseBlock();this.expect(yn.RBRACE);return this.operators}parseBlock(){for(;;)if(this.accept(yn.NUMBER))this.operators.push(this.prev.value);else if(this.accept(yn.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(yn.LBRACE))return;this.parseCondition()}}parseCondition(){const e=this.operators.length;this.operators.push(null,null);this.parseBlock();this.expect(yn.RBRACE);if(this.accept(yn.IF)){this.operators[e]=this.operators.length;this.operators[e+1]="jz"}else{if(!this.accept(yn.LBRACE))throw new FormatError("PS Function: error parsing conditional.");{const t=this.operators.length;this.operators.push(null,null);const a=this.operators.length;this.parseBlock();this.expect(yn.RBRACE);this.expect(yn.IFELSE);this.operators[t]=this.operators.length;this.operators[t+1]="j";this.operators[e]=a;this.operators[e+1]="jz"}}}}const yn={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5};class PostScriptToken{static get opCache(){return shadow(this,"opCache",Object.create(null))}constructor(e,t){this.type=e;this.value=t}static getOperator(e){return PostScriptToken.opCache[e]||=new PostScriptToken(yn.OPERATOR,e)}static get LBRACE(){return shadow(this,"LBRACE",new PostScriptToken(yn.LBRACE,"{"))}static get RBRACE(){return shadow(this,"RBRACE",new PostScriptToken(yn.RBRACE,"}"))}static get IF(){return shadow(this,"IF",new PostScriptToken(yn.IF,"IF"))}static get IFELSE(){return shadow(this,"IFELSE",new PostScriptToken(yn.IFELSE,"IFELSE"))}}class PostScriptLexer{constructor(e){this.stream=e;this.nextChar();this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(t<0)return wa;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!isWhiteSpace(t))break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new PostScriptToken(yn.NUMBER,this.getNumber());case 123:this.nextChar();return PostScriptToken.LBRACE;case 125:this.nextChar();return PostScriptToken.RBRACE}const a=this.strBuf;a.length=0;a[0]=String.fromCharCode(t);for(;(t=this.nextChar())>=0&&(t>=65&&t<=90||t>=97&&t<=122);)a.push(String.fromCharCode(t));const r=a.join("");switch(r.toLowerCase()){case"if":return PostScriptToken.IF;case"ifelse":return PostScriptToken.IFELSE;default:return PostScriptToken.getOperator(r)}}getNumber(){let e=this.currentChar;const t=this.strBuf;t.length=0;t[0]=String.fromCharCode(e);for(;(e=this.nextChar())>=0&&(e>=48&&e<=57||45===e||46===e);)t.push(String.fromCharCode(e));const a=parseFloat(t.join(""));if(isNaN(a))throw new FormatError(`Invalid floating point number: ${a}`);return a}}class BaseLocalCache{constructor(e){this._onlyRefs=!0===e?.onlyRefs;if(!this._onlyRefs){this._nameRefMap=new Map;this._imageMap=new Map}this._imageCache=new RefSetCache}getByName(e){this._onlyRefs&&unreachable("Should not call `getByName` method.");const t=this._nameRefMap.get(e);return t?this.getByRef(t):this._imageMap.get(e)||null}getByRef(e){return this._imageCache.get(e)||null}set(e,t,a){unreachable("Abstract method `set` called.")}}class LocalImageCache extends BaseLocalCache{set(e,t=null,a){if("string"!=typeof e)throw new Error(\'LocalImageCache.set - expected "name" argument.\');if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}}class LocalColorSpaceCache extends BaseLocalCache{set(e=null,t=null,a){if("string"!=typeof e&&!t)throw new Error(\'LocalColorSpaceCache.set - expected "name" and/or "ref" argument.\');if(t){if(this._imageCache.has(t))return;null!==e&&this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}}class LocalFunctionCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error(\'LocalFunctionCache.set - expected "ref" argument.\');this._imageCache.has(t)||this._imageCache.put(t,a)}}class LocalGStateCache extends BaseLocalCache{set(e,t=null,a){if("string"!=typeof e)throw new Error(\'LocalGStateCache.set - expected "name" argument.\');if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}}class LocalTilingPatternCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error(\'LocalTilingPatternCache.set - expected "ref" argument.\');this._imageCache.has(t)||this._imageCache.put(t,a)}}class RegionalImageCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error(\'RegionalImageCache.set - expected "ref" argument.\');this._imageCache.has(t)||this._imageCache.put(t,a)}}class GlobalColorSpaceCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error(\'GlobalColorSpaceCache.set - expected "ref" argument.\');this._imageCache.has(t)||this._imageCache.put(t,a)}clear(){this._imageCache.clear()}}class GlobalImageCache{static NUM_PAGES_THRESHOLD=2;static MIN_IMAGES_TO_CACHE=10;static MAX_BYTE_SIZE=5e7;#H=new RefSet;constructor(){this._refCache=new RefSetCache;this._imageCache=new RefSetCache}get#W(){let e=0;for(const t of this._imageCache)e+=t.byteSize;return e}get#z(){return!(this._imageCache.size<GlobalImageCache.MIN_IMAGES_TO_CACHE)&&!(this.#W<GlobalImageCache.MAX_BYTE_SIZE)}shouldCache(e,t){let a=this._refCache.get(e);if(!a){a=new Set;this._refCache.put(e,a)}a.add(t);return!(a.size<GlobalImageCache.NUM_PAGES_THRESHOLD)&&!(!this._imageCache.has(e)&&this.#z)}addDecodeFailed(e){this.#H.put(e)}hasDecodeFailed(e){return this.#H.has(e)}addByteSize(e,t){const a=this._imageCache.get(e);a&&(a.byteSize||(a.byteSize=t))}getData(e,t){const a=this._refCache.get(e);if(!a)return null;if(a.size<GlobalImageCache.NUM_PAGES_THRESHOLD)return null;const r=this._imageCache.get(e);if(!r)return null;a.add(t);return r}setData(e,t){if(!this._refCache.has(e))throw new Error(\'GlobalImageCache.setData - expected "shouldCache" to have been called.\');this._imageCache.has(e)||(this.#z?warn("GlobalImageCache.setData - cache limit reached."):this._imageCache.put(e,t))}clear(e=!1){if(!e){this.#H.clear();this._refCache.clear()}this._imageCache.clear()}}class PDFFunctionFactory{constructor({xref:e,isEvalSupported:t=!0}){this.xref=e;this.isEvalSupported=!1!==t}create(e,t=!1){let a,r;e instanceof Ref?a=e:e instanceof Dict?a=e.objId:e instanceof BaseStream&&(a=e.dict?.objId);if(a){const e=this._localFunctionCache.getByRef(a);if(e)return e}const i=this.xref.fetchIfRef(e);if(Array.isArray(i)){if(!t)throw new Error(\'PDFFunctionFactory.create - expected "parseArray" argument.\');r=PDFFunction.parseArray(this,i)}else r=PDFFunction.parse(this,i);a&&this._localFunctionCache.set(null,a,r);return r}get _localFunctionCache(){return shadow(this,"_localFunctionCache",new LocalFunctionCache)}}function toNumberArray(e){return Array.isArray(e)?isNumberArray(e,null)?e:e.map((e=>+e)):null}class PDFFunction{static getSampleArray(e,t,a,r){let i,n,s=1;for(i=0,n=e.length;i<n;i++)s*=e[i];s*=t;const o=new Array(s);let c=0,l=0;const h=1/(2**a-1),u=r.getBytes((s*a+7)/8);let d=0;for(i=0;i<s;i++){for(;c<a;){l<<=8;l|=u[d++];c+=8}c-=a;o[i]=(l>>c)*h;l&=(1<<c)-1}return o}static parse(e,t){const a=t.dict||t;switch(a.get("FunctionType")){case 0:return this.constructSampled(e,t,a);case 1:break;case 2:return this.constructInterpolated(e,a);case 3:return this.constructStiched(e,a);case 4:return this.constructPostScript(e,t,a)}throw new FormatError("Unknown type of function")}static parseArray(e,t){const{xref:a}=e,r=[];for(const i of t)r.push(this.parse(e,a.fetchIfRef(i)));return function(e,t,a,i){for(let n=0,s=r.length;n<s;n++)r[n](e,t,a,i+n)}}static constructSampled(e,t,a){function toMultiArray(e){const t=e.length,a=[];let r=0;for(let i=0;i<t;i+=2)a[r++]=[e[i],e[i+1]];return a}function interpolate(e,t,a,r,i){return r+(i-r)/(a-t)*(e-t)}let r=toNumberArray(a.getArray("Domain")),i=toNumberArray(a.getArray("Range"));if(!r||!i)throw new FormatError("No domain or range");const n=r.length/2,s=i.length/2;r=toMultiArray(r);i=toMultiArray(i);const o=toNumberArray(a.getArray("Size")),c=a.get("BitsPerSample"),l=a.get("Order")||1;1!==l&&info("No support for cubic spline interpolation: "+l);let h=toNumberArray(a.getArray("Encode"));if(h)h=toMultiArray(h);else{h=[];for(let e=0;e<n;++e)h.push([0,o[e]-1])}let u=toNumberArray(a.getArray("Decode"));u=u?toMultiArray(u):i;const d=this.getSampleArray(o,s,c,t);return function constructSampledFn(e,t,a,c){const l=1<<n,f=new Float64Array(l).fill(1),g=new Uint32Array(l);let p,m,b=s,y=1;for(p=0;p<n;++p){const a=r[p][0],i=r[p][1];let n=interpolate(MathClamp(e[t+p],a,i),a,i,h[p][0],h[p][1]);const s=o[p];n=MathClamp(n,0,s-1);const c=n<s-1?Math.floor(n):n-1,u=c+1-n,d=n-c,w=c*b,x=w+b;for(m=0;m<l;m++)if(m&y){f[m]*=d;g[m]+=x}else{f[m]*=u;g[m]+=w}b*=s;y<<=1}for(m=0;m<s;++m){let e=0;for(p=0;p<l;p++)e+=d[g[p]+m]*f[p];e=interpolate(e,0,1,u[m][0],u[m][1]);a[c+m]=MathClamp(e,i[m][0],i[m][1])}}}static constructInterpolated(e,t){const a=toNumberArray(t.getArray("C0"))||[0],r=toNumberArray(t.getArray("C1"))||[1],i=t.get("N"),n=[];for(let e=0,t=a.length;e<t;++e)n.push(r[e]-a[e]);const s=n.length;return function constructInterpolatedFn(e,t,r,o){const c=1===i?e[t]:e[t]**i;for(let e=0;e<s;++e)r[o+e]=a[e]+c*n[e]}}static constructStiched(e,t){const a=toNumberArray(t.getArray("Domain"));if(!a)throw new FormatError("No domain");if(1!==a.length/2)throw new FormatError("Bad domain for stiched function");const{xref:r}=e,i=[];for(const a of t.get("Functions"))i.push(this.parse(e,r.fetchIfRef(a)));const n=toNumberArray(t.getArray("Bounds")),s=toNumberArray(t.getArray("Encode")),o=new Float32Array(1);return function constructStichedFn(e,t,r,c){const l=MathClamp(e[t],a[0],a[1]),h=n.length;let u;for(u=0;u<h&&!(l<n[u]);++u);let d=a[0];u>0&&(d=n[u-1]);let f=a[1];u<n.length&&(f=n[u]);const g=s[2*u],p=s[2*u+1];o[0]=d===f?g:g+(l-d)*(p-g)/(f-d);i[u](o,0,r,c)}}static constructPostScript(e,t,a){const r=toNumberArray(a.getArray("Domain")),i=toNumberArray(a.getArray("Range"));if(!r)throw new FormatError("No domain.");if(!i)throw new FormatError("No range.");const n=new PostScriptLexer(t),s=new PostScriptParser(n).parse();if(e.isEvalSupported&&FeatureTest.isEvalSupported){const e=(new PostScriptCompiler).compile(s,r,i);if(e)return new Function("src","srcOffset","dest","destOffset",e)}info("Unable to compile PS function");const o=i.length>>1,c=r.length>>1,l=new PostScriptEvaluator(s),h=Object.create(null);let u=8192;const d=new Float32Array(c);return function constructPostScriptFn(e,t,a,r){let n,s,f="";const g=d;for(n=0;n<c;n++){s=e[t+n];g[n]=s;f+=s+"_"}const p=h[f];if(void 0!==p){a.set(p,r);return}const m=new Float32Array(o),b=l.execute(g),y=b.length-o;for(n=0;n<o;n++){s=b[y+n];let e=i[2*n];if(s<e)s=e;else{e=i[2*n+1];s>e&&(s=e)}m[n]=s}if(u>0){u--;h[f]=m}a.set(m,r)}}}function isPDFFunction(e){let t;if(e instanceof Dict)t=e;else{if(!(e instanceof BaseStream))return!1;t=e.dict}return t.has("FunctionType")}class PostScriptStack{static MAX_STACK_SIZE=100;constructor(e){this.stack=e?Array.from(e):[]}push(e){if(this.stack.length>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");this.stack.push(e)}pop(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()}copy(e){if(this.stack.length+e>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");const t=this.stack;for(let a=t.length-e,r=e-1;r>=0;r--,a++)t.push(t[a])}index(e){this.push(this.stack[this.stack.length-e-1])}roll(e,t){const a=this.stack,r=a.length-e,i=a.length-1,n=r+(t-Math.floor(t/e)*e);for(let e=r,t=i;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}for(let e=r,t=n-1;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}for(let e=n,t=i;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}}}class PostScriptEvaluator{constructor(e){this.operators=e}execute(e){const t=new PostScriptStack(e);let a=0;const r=this.operators,i=r.length;let n,s,o;for(;a<i;){n=r[a++];if("number"!=typeof n)switch(n){case"jz":o=t.pop();s=t.pop();s||(a=o);break;case"j":s=t.pop();a=s;break;case"abs":s=t.pop();t.push(Math.abs(s));break;case"add":o=t.pop();s=t.pop();t.push(s+o);break;case"and":o=t.pop();s=t.pop();"boolean"==typeof s&&"boolean"==typeof o?t.push(s&&o):t.push(s&o);break;case"atan":o=t.pop();s=t.pop();s=Math.atan2(s,o)/Math.PI*180;s<0&&(s+=360);t.push(s);break;case"bitshift":o=t.pop();s=t.pop();s>0?t.push(s<<o):t.push(s>>o);break;case"ceiling":s=t.pop();t.push(Math.ceil(s));break;case"copy":s=t.pop();t.copy(s);break;case"cos":s=t.pop();t.push(Math.cos(s%360/180*Math.PI));break;case"cvi":s=0|t.pop();t.push(s);break;case"cvr":break;case"div":o=t.pop();s=t.pop();t.push(s/o);break;case"dup":t.copy(1);break;case"eq":o=t.pop();s=t.pop();t.push(s===o);break;case"exch":t.roll(2,1);break;case"exp":o=t.pop();s=t.pop();t.push(s**o);break;case"false":t.push(!1);break;case"floor":s=t.pop();t.push(Math.floor(s));break;case"ge":o=t.pop();s=t.pop();t.push(s>=o);break;case"gt":o=t.pop();s=t.pop();t.push(s>o);break;case"idiv":o=t.pop();s=t.pop();t.push(s/o|0);break;case"index":s=t.pop();t.index(s);break;case"le":o=t.pop();s=t.pop();t.push(s<=o);break;case"ln":s=t.pop();t.push(Math.log(s));break;case"log":s=t.pop();t.push(Math.log10(s));break;case"lt":o=t.pop();s=t.pop();t.push(s<o);break;case"mod":o=t.pop();s=t.pop();t.push(s%o);break;case"mul":o=t.pop();s=t.pop();t.push(s*o);break;case"ne":o=t.pop();s=t.pop();t.push(s!==o);break;case"neg":s=t.pop();t.push(-s);break;case"not":s=t.pop();"boolean"==typeof s?t.push(!s):t.push(~s);break;case"or":o=t.pop();s=t.pop();"boolean"==typeof s&&"boolean"==typeof o?t.push(s||o):t.push(s|o);break;case"pop":t.pop();break;case"roll":o=t.pop();s=t.pop();t.roll(s,o);break;case"round":s=t.pop();t.push(Math.round(s));break;case"sin":s=t.pop();t.push(Math.sin(s%360/180*Math.PI));break;case"sqrt":s=t.pop();t.push(Math.sqrt(s));break;case"sub":o=t.pop();s=t.pop();t.push(s-o);break;case"true":t.push(!0);break;case"truncate":s=t.pop();s=s<0?Math.ceil(s):Math.floor(s);t.push(s);break;case"xor":o=t.pop();s=t.pop();"boolean"==typeof s&&"boolean"==typeof o?t.push(s!==o):t.push(s^o);break;default:throw new FormatError(`Unknown operator ${n}`)}else t.push(n)}return t.stack}}class AstNode{constructor(e){this.type=e}visit(e){unreachable("abstract method")}}class AstArgument extends AstNode{constructor(e,t,a){super("args");this.index=e;this.min=t;this.max=a}visit(e){e.visitArgument(this)}}class AstLiteral extends AstNode{constructor(e){super("literal");this.number=e;this.min=e;this.max=e}visit(e){e.visitLiteral(this)}}class AstBinaryOperation extends AstNode{constructor(e,t,a,r,i){super("binary");this.op=e;this.arg1=t;this.arg2=a;this.min=r;this.max=i}visit(e){e.visitBinaryOperation(this)}}class AstMin extends AstNode{constructor(e,t){super("max");this.arg=e;this.min=e.min;this.max=t}visit(e){e.visitMin(this)}}class AstVariable extends AstNode{constructor(e,t,a){super("var");this.index=e;this.min=t;this.max=a}visit(e){e.visitVariable(this)}}class AstVariableDefinition extends AstNode{constructor(e,t){super("definition");this.variable=e;this.arg=t}visit(e){e.visitVariableDefinition(this)}}class ExpressionBuilderVisitor{constructor(){this.parts=[]}visitArgument(e){this.parts.push("Math.max(",e.min,", Math.min(",e.max,", src[srcOffset + ",e.index,"]))")}visitVariable(e){this.parts.push("v",e.index)}visitLiteral(e){this.parts.push(e.number)}visitBinaryOperation(e){this.parts.push("(");e.arg1.visit(this);this.parts.push(" ",e.op," ");e.arg2.visit(this);this.parts.push(")")}visitVariableDefinition(e){this.parts.push("var ");e.variable.visit(this);this.parts.push(" = ");e.arg.visit(this);this.parts.push(";")}visitMin(e){this.parts.push("Math.min(");e.arg.visit(this);this.parts.push(", ",e.max,")")}toString(){return this.parts.join("")}}function buildAddOperation(e,t){return"literal"===t.type&&0===t.number?e:"literal"===e.type&&0===e.number?t:"literal"===t.type&&"literal"===e.type?new AstLiteral(e.number+t.number):new AstBinaryOperation("+",e,t,e.min+t.min,e.max+t.max)}function buildMulOperation(e,t){if("literal"===t.type){if(0===t.number)return new AstLiteral(0);if(1===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number*t.number)}if("literal"===e.type){if(0===e.number)return new AstLiteral(0);if(1===e.number)return t}const a=Math.min(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max),r=Math.max(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max);return new AstBinaryOperation("*",e,t,a,r)}function buildSubOperation(e,t){if("literal"===t.type){if(0===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number-t.number)}return"binary"===t.type&&"-"===t.op&&"literal"===e.type&&1===e.number&&"literal"===t.arg1.type&&1===t.arg1.number?t.arg2:new AstBinaryOperation("-",e,t,e.min-t.max,e.max-t.min)}function buildMinOperation(e,t){return e.min>=t?new AstLiteral(t):e.max<=t?e:new AstMin(e,t)}class PostScriptCompiler{compile(e,t,a){const r=[],i=[],n=t.length>>1,s=a.length>>1;let o,c,l,h,u,d,f,g,p=0;for(let e=0;e<n;e++)r.push(new AstArgument(e,t[2*e],t[2*e+1]));for(let t=0,a=e.length;t<a;t++){g=e[t];if("number"!=typeof g)switch(g){case"add":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildAddOperation(l,h));break;case"cvr":if(r.length<1)return null;break;case"mul":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildMulOperation(l,h));break;case"sub":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildSubOperation(l,h));break;case"exch":if(r.length<2)return null;u=r.pop();d=r.pop();r.push(u,d);break;case"pop":if(r.length<1)return null;r.pop();break;case"index":if(r.length<1)return null;l=r.pop();if("literal"!==l.type)return null;o=l.number;if(o<0||!Number.isInteger(o)||r.length<o)return null;u=r[r.length-o-1];if("literal"===u.type||"var"===u.type){r.push(u);break}f=new AstVariable(p++,u.min,u.max);r[r.length-o-1]=f;r.push(f);i.push(new AstVariableDefinition(f,u));break;case"dup":if(r.length<1)return null;if("number"==typeof e[t+1]&&"gt"===e[t+2]&&e[t+3]===t+7&&"jz"===e[t+4]&&"pop"===e[t+5]&&e[t+6]===e[t+1]){l=r.pop();r.push(buildMinOperation(l,e[t+1]));t+=6;break}u=r.at(-1);if("literal"===u.type||"var"===u.type){r.push(u);break}f=new AstVariable(p++,u.min,u.max);r[r.length-1]=f;r.push(f);i.push(new AstVariableDefinition(f,u));break;case"roll":if(r.length<2)return null;h=r.pop();l=r.pop();if("literal"!==h.type||"literal"!==l.type)return null;c=h.number;o=l.number;if(o<=0||!Number.isInteger(o)||!Number.isInteger(c)||r.length<o)return null;c=(c%o+o)%o;if(0===c)break;r.push(...r.splice(r.length-o,o-c));break;default:return null}else r.push(new AstLiteral(g))}if(r.length!==s)return null;const m=[];for(const e of i){const t=new ExpressionBuilderVisitor;e.visit(t);m.push(t.toString())}for(let e=0,t=r.length;e<t;e++){const t=r[e],i=new ExpressionBuilderVisitor;t.visit(i);const n=a[2*e],s=a[2*e+1],o=[i.toString()];if(n>t.min){o.unshift("Math.max(",n,", ");o.push(")")}if(s<t.max){o.unshift("Math.min(",s,", ");o.push(")")}o.unshift("dest[destOffset + ",e,"] = ");o.push(";");m.push(o.join(""))}return m.join("\\n")}}const wn=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],xn=["AN","AN","AN","AN","AN","AN","ON","ON","AL","ET","ET","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL"];function isOdd(e){return!!(1&e)}function isEven(e){return!(1&e)}function findUnequal(e,t,a){let r,i;for(r=t,i=e.length;r<i;++r)if(e[r]!==a)return r;return r}function reverseValues(e,t,a){for(let r=t,i=a-1;r<i;++r,--i){const t=e[r];e[r]=e[i];e[i]=t}}function createBidiText(e,t,a=!1){let r="ltr";a?r="ttb":t||(r="rtl");return{str:e,dir:r}}const Sn=[],An=[];function bidi(e,t=-1,a=!1){let r=!0;const i=e.length;if(0===i||a)return createBidiText(e,r,a);Sn.length=i;An.length=i;let n,s,o=0;for(n=0;n<i;++n){Sn[n]=e.charAt(n);const t=e.charCodeAt(n);let a="L";if(t<=255)a=wn[t];else if(1424<=t&&t<=1524)a="R";else if(1536<=t&&t<=1791){a=xn[255&t];a||warn("Bidi: invalid Unicode character "+t.toString(16))}else(1792<=t&&t<=2220||64336<=t&&t<=65023||65136<=t&&t<=65279)&&(a="AL");"R"!==a&&"AL"!==a&&"AN"!==a||o++;An[n]=a}if(0===o){r=!0;return createBidiText(e,r)}if(-1===t)if(o/i<.3&&i>4){r=!0;t=0}else{r=!1;t=1}const c=[];for(n=0;n<i;++n)c[n]=t;const l=isOdd(t)?"R":"L",h=l,u=h;let d,f=h;for(n=0;n<i;++n)"NSM"===An[n]?An[n]=f:f=An[n];f=h;for(n=0;n<i;++n){d=An[n];"EN"===d?An[n]="AL"===f?"AN":"EN":"R"!==d&&"L"!==d&&"AL"!==d||(f=d)}for(n=0;n<i;++n){d=An[n];"AL"===d&&(An[n]="R")}for(n=1;n<i-1;++n){"ES"===An[n]&&"EN"===An[n-1]&&"EN"===An[n+1]&&(An[n]="EN");"CS"!==An[n]||"EN"!==An[n-1]&&"AN"!==An[n-1]||An[n+1]!==An[n-1]||(An[n]=An[n-1])}for(n=0;n<i;++n)if("EN"===An[n]){for(let e=n-1;e>=0&&"ET"===An[e];--e)An[e]="EN";for(let e=n+1;e<i&&"ET"===An[e];++e)An[e]="EN"}for(n=0;n<i;++n){d=An[n];"WS"!==d&&"ES"!==d&&"ET"!==d&&"CS"!==d||(An[n]="ON")}f=h;for(n=0;n<i;++n){d=An[n];"EN"===d?An[n]="L"===f?"L":"EN":"R"!==d&&"L"!==d||(f=d)}for(n=0;n<i;++n)if("ON"===An[n]){const e=findUnequal(An,n+1,"ON");let t=h;n>0&&(t=An[n-1]);let a=u;e+1<i&&(a=An[e+1]);"L"!==t&&(t="R");"L"!==a&&(a="R");t===a&&An.fill(t,n,e);n=e-1}for(n=0;n<i;++n)"ON"===An[n]&&(An[n]=l);for(n=0;n<i;++n){d=An[n];isEven(c[n])?"R"===d?c[n]+=1:"AN"!==d&&"EN"!==d||(c[n]+=2):"L"!==d&&"AN"!==d&&"EN"!==d||(c[n]+=1)}let g,p=-1,m=99;for(n=0,s=c.length;n<s;++n){g=c[n];p<g&&(p=g);m>g&&isOdd(g)&&(m=g)}for(g=p;g>=m;--g){let e=-1;for(n=0,s=c.length;n<s;++n)if(c[n]<g){if(e>=0){reverseValues(Sn,e,n);e=-1}}else e<0&&(e=n);e>=0&&reverseValues(Sn,e,c.length)}for(n=0,s=Sn.length;n<s;++n){const e=Sn[n];"<"!==e&&">"!==e||(Sn[n]="")}return createBidiText(Sn.join(""),r)}const kn={style:"normal",weight:"normal"},Cn={style:"normal",weight:"bold"},vn={style:"italic",weight:"normal"},Fn={style:"italic",weight:"bold"},In=new Map([["Times-Roman",{local:["Times New Roman","Times-Roman","Times","Liberation Serif","Nimbus Roman","Nimbus Roman L","Tinos","Thorndale","TeX Gyre Termes","FreeSerif","Linux Libertine O","Libertinus Serif","DejaVu Serif","Bitstream Vera Serif","Ubuntu"],style:kn,ultimate:"serif"}],["Times-Bold",{alias:"Times-Roman",style:Cn,ultimate:"serif"}],["Times-Italic",{alias:"Times-Roman",style:vn,ultimate:"serif"}],["Times-BoldItalic",{alias:"Times-Roman",style:Fn,ultimate:"serif"}],["Helvetica",{local:["Helvetica","Helvetica Neue","Arial","Arial Nova","Liberation Sans","Arimo","Nimbus Sans","Nimbus Sans L","A030","TeX Gyre Heros","FreeSans","DejaVu Sans","Albany","Bitstream Vera Sans","Arial Unicode MS","Microsoft Sans Serif","Apple Symbols","Cantarell"],path:"LiberationSans-Regular.ttf",style:kn,ultimate:"sans-serif"}],["Helvetica-Bold",{alias:"Helvetica",path:"LiberationSans-Bold.ttf",style:Cn,ultimate:"sans-serif"}],["Helvetica-Oblique",{alias:"Helvetica",path:"LiberationSans-Italic.ttf",style:vn,ultimate:"sans-serif"}],["Helvetica-BoldOblique",{alias:"Helvetica",path:"LiberationSans-BoldItalic.ttf",style:Fn,ultimate:"sans-serif"}],["Courier",{local:["Courier","Courier New","Liberation Mono","Nimbus Mono","Nimbus Mono L","Cousine","Cumberland","TeX Gyre Cursor","FreeMono","Linux Libertine Mono O","Libertinus Mono"],style:kn,ultimate:"monospace"}],["Courier-Bold",{alias:"Courier",style:Cn,ultimate:"monospace"}],["Courier-Oblique",{alias:"Courier",style:vn,ultimate:"monospace"}],["Courier-BoldOblique",{alias:"Courier",style:Fn,ultimate:"monospace"}],["ArialBlack",{local:["Arial Black"],style:{style:"normal",weight:"900"},fallback:"Helvetica-Bold"}],["ArialBlack-Bold",{alias:"ArialBlack"}],["ArialBlack-Italic",{alias:"ArialBlack",style:{style:"italic",weight:"900"},fallback:"Helvetica-BoldOblique"}],["ArialBlack-BoldItalic",{alias:"ArialBlack-Italic"}],["ArialNarrow",{local:["Arial Narrow","Liberation Sans Narrow","Helvetica Condensed","Nimbus Sans Narrow","TeX Gyre Heros Cn"],style:kn,fallback:"Helvetica"}],["ArialNarrow-Bold",{alias:"ArialNarrow",style:Cn,fallback:"Helvetica-Bold"}],["ArialNarrow-Italic",{alias:"ArialNarrow",style:vn,fallback:"Helvetica-Oblique"}],["ArialNarrow-BoldItalic",{alias:"ArialNarrow",style:Fn,fallback:"Helvetica-BoldOblique"}],["Calibri",{local:["Calibri","Carlito"],style:kn,fallback:"Helvetica"}],["Calibri-Bold",{alias:"Calibri",style:Cn,fallback:"Helvetica-Bold"}],["Calibri-Italic",{alias:"Calibri",style:vn,fallback:"Helvetica-Oblique"}],["Calibri-BoldItalic",{alias:"Calibri",style:Fn,fallback:"Helvetica-BoldOblique"}],["Wingdings",{local:["Wingdings","URW Dingbats"],style:kn}],["Wingdings-Regular",{alias:"Wingdings"}],["Wingdings-Bold",{alias:"Wingdings"}]]),Tn=new Map([["Arial-Black","ArialBlack"]]);function getFamilyName(e){const t=new Set(["thin","extralight","ultralight","demilight","semilight","light","book","regular","normal","medium","demibold","semibold","bold","extrabold","ultrabold","black","heavy","extrablack","ultrablack","roman","italic","oblique","ultracondensed","extracondensed","condensed","semicondensed","normal","semiexpanded","expanded","extraexpanded","ultraexpanded","bolditalic"]);return e.split(/[- ,+]+/g).filter((e=>!t.has(e.toLowerCase()))).join(" ")}function generateFont({alias:e,local:t,path:a,fallback:r,style:i,ultimate:n},s,o,c=!0,l=!0,h=""){const u={style:null,ultimate:null};if(t){const e=h?` ${h}`:"";for(const a of t)s.push(`local(${a}${e})`)}if(e){const t=In.get(e),n=h||function getStyleToAppend(e){switch(e){case Cn:return"Bold";case vn:return"Italic";case Fn:return"Bold Italic";default:if("bold"===e?.weight)return"Bold";if("italic"===e?.style)return"Italic"}return""}(i);Object.assign(u,generateFont(t,s,o,c&&!r,l&&!a,n))}i&&(u.style=i);n&&(u.ultimate=n);if(c&&r){const e=In.get(r),{ultimate:t}=generateFont(e,s,o,c,l&&!a,h);u.ultimate||=t}l&&a&&o&&s.push(`url(${o}${a})`);return u}function getFontSubstitution(e,t,a,r,i,n){if(r.startsWith("InvalidPDFjsFont_"))return null;"TrueType"!==n&&"Type1"!==n||!/^[A-Z]{6}\\+/.test(r)||(r=r.slice(7));const s=r=normalizeFontName(r);let o=e.get(s);if(o)return o;let c=In.get(r);if(!c)for(const[e,t]of Tn)if(r.startsWith(e)){r=`${t}${r.substring(e.length)}`;c=In.get(r);break}let l=!1;if(!c){c=In.get(i);l=!0}const h=`${t.getDocId()}_s${t.createFontId()}`;if(!c){if(!validateFontName(r)){warn(`Cannot substitute the font because of its name: ${r}`);e.set(s,null);return null}const t=/bold/gi.test(r),a=/oblique|italic/gi.test(r),i=t&&a&&Fn||t&&Cn||a&&vn||kn;o={css:`"${getFamilyName(r)}",${h}`,guessFallback:!0,loadedName:h,baseFontName:r,src:`local(${r})`,style:i};e.set(s,o);return o}const u=[];l&&validateFontName(r)&&u.push(`local(${r})`);const{style:d,ultimate:f}=generateFont(c,u,a),g=null===f,p=g?"":`,${f}`;o={css:`"${getFamilyName(r)}",${h}${p}`,guessFallback:g,loadedName:h,baseFontName:r,src:u.join(","),style:d};e.set(s,o);return o}const On=3285377520,Mn=4294901760,Dn=65535;class MurmurHash3_64{constructor(e){this.h1=e?4294967295&e:On;this.h2=e?4294967295&e:On}update(e){let t,a;if("string"==typeof e){t=new Uint8Array(2*e.length);a=0;for(let r=0,i=e.length;r<i;r++){const i=e.charCodeAt(r);if(i<=255)t[a++]=i;else{t[a++]=i>>>8;t[a++]=255&i}}}else{if(!ArrayBuffer.isView(e))throw new Error("Invalid data format, must be a string or TypedArray.");t=e.slice();a=t.byteLength}const r=a>>2,i=a-4*r,n=new Uint32Array(t.buffer,0,r);let s=0,o=0,c=this.h1,l=this.h2;const h=3432918353,u=461845907,d=11601,f=13715;for(let e=0;e<r;e++)if(1&e){s=n[e];s=s*h&Mn|s*d&Dn;s=s<<15|s>>>17;s=s*u&Mn|s*f&Dn;c^=s;c=c<<13|c>>>19;c=5*c+3864292196}else{o=n[e];o=o*h&Mn|o*d&Dn;o=o<<15|o>>>17;o=o*u&Mn|o*f&Dn;l^=o;l=l<<13|l>>>19;l=5*l+3864292196}s=0;switch(i){case 3:s^=t[4*r+2]<<16;case 2:s^=t[4*r+1]<<8;case 1:s^=t[4*r];s=s*h&Mn|s*d&Dn;s=s<<15|s>>>17;s=s*u&Mn|s*f&Dn;1&r?c^=s:l^=s}this.h1=c;this.h2=l}hexdigest(){let e=this.h1,t=this.h2;e^=t>>>1;e=3981806797*e&Mn|36045*e&Dn;t=4283543511*t&Mn|(2950163797*(t<<16|e>>>16)&Mn)>>>16;e^=t>>>1;e=444984403*e&Mn|60499*e&Dn;t=3301882366*t&Mn|(3120437893*(t<<16|e>>>16)&Mn)>>>16;e^=t>>>1;return(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}function resizeImageMask(e,t,a,r,i,n){const s=i*n;let o;o=t<=8?new Uint8Array(s):t<=16?new Uint16Array(s):new Uint32Array(s);const c=a/i,l=r/n;let h,u,d,f,g=0;const p=new Uint16Array(i),m=a;for(h=0;h<i;h++)p[h]=Math.floor(h*c);for(h=0;h<n;h++){d=Math.floor(h*l)*m;for(u=0;u<i;u++){f=d+p[u];o[g++]=e[f]}}return o}class PDFImage{constructor({xref:e,res:t,image:a,isInline:r=!1,smask:i=null,mask:n=null,isMask:s=!1,pdfFunctionFactory:o,globalColorSpaceCache:c,localColorSpaceCache:l}){this.image=a;const h=a.dict,u=h.get("F","Filter");let d;if(u instanceof Name)d=u.name;else if(Array.isArray(u)){const t=e.fetchIfRef(u[0]);t instanceof Name&&(d=t.name)}switch(d){case"JPXDecode":({width:a.width,height:a.height,componentsCount:a.numComps,bitsPerComponent:a.bitsPerComponent}=JpxImage.parseImageProperties(a.stream));a.stream.reset();const e=ImageResizer.getReducePowerForJPX(a.width,a.height,a.numComps);this.jpxDecoderOptions={numComponents:0,isIndexedColormap:!1,smaskInData:h.has("SMaskInData"),reducePower:e};if(e){const t=2**e;a.width=Math.ceil(a.width/t);a.height=Math.ceil(a.height/t)}break;case"JBIG2Decode":a.bitsPerComponent=1;a.numComps=1}let f=h.get("W","Width"),g=h.get("H","Height");if(Number.isInteger(a.width)&&a.width>0&&Number.isInteger(a.height)&&a.height>0&&(a.width!==f||a.height!==g)){warn("PDFImage - using the Width/Height of the image data, rather than the image dictionary.");f=a.width;g=a.height}else{const e="number"==typeof f&&f>0,t="number"==typeof g&&g>0;if(!e||!t){if(!a.fallbackDims)throw new FormatError(`Invalid image width: ${f} or height: ${g}`);warn("PDFImage - using the Width/Height of the parent image, for SMask/Mask data.");e||(f=a.fallbackDims.width);t||(g=a.fallbackDims.height)}}this.width=f;this.height=g;this.interpolate=h.get("I","Interpolate");this.imageMask=h.get("IM","ImageMask")||!1;this.matte=h.get("Matte")||!1;let p=a.bitsPerComponent;if(!p){p=h.get("BPC","BitsPerComponent");if(!p){if(!this.imageMask)throw new FormatError(`Bits per component missing in image: ${this.imageMask}`);p=1}}this.bpc=p;if(!this.imageMask){let i=h.getRaw("CS")||h.getRaw("ColorSpace");const n=!!i;if(n)this.jpxDecoderOptions?.smaskInData&&(i=Name.get("DeviceRGBA"));else if(this.jpxDecoderOptions)i=Name.get("DeviceRGBA");else switch(a.numComps){case 1:i=Name.get("DeviceGray");break;case 3:i=Name.get("DeviceRGB");break;case 4:i=Name.get("DeviceCMYK");break;default:throw new Error(`Images with ${a.numComps} color components not supported.`)}this.colorSpace=ColorSpaceUtils.parse({cs:i,xref:e,resources:r?t:null,pdfFunctionFactory:o,globalColorSpaceCache:c,localColorSpaceCache:l});this.numComps=this.colorSpace.numComps;if(this.jpxDecoderOptions){this.jpxDecoderOptions.numComponents=n?this.numComps:0;this.jpxDecoderOptions.isIndexedColormap="Indexed"===this.colorSpace.name}}this.decode=h.getArray("D","Decode");this.needsDecode=!1;if(this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,p)||s&&!ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=!0;const e=(1<<p)-1;this.decodeCoefficients=[];this.decodeAddends=[];const t="Indexed"===this.colorSpace?.name;for(let a=0,r=0;a<this.decode.length;a+=2,++r){const i=this.decode[a],n=this.decode[a+1];this.decodeCoefficients[r]=t?(n-i)/e:n-i;this.decodeAddends[r]=t?i:e*i}}if(i){i.fallbackDims??={width:f,height:g};this.smask=new PDFImage({xref:e,res:t,image:i,isInline:r,pdfFunctionFactory:o,globalColorSpaceCache:c,localColorSpaceCache:l})}else if(n)if(n instanceof BaseStream){if(n.dict.get("IM","ImageMask")){n.fallbackDims??={width:f,height:g};this.mask=new PDFImage({xref:e,res:t,image:n,isInline:r,isMask:!0,pdfFunctionFactory:o,globalColorSpaceCache:c,localColorSpaceCache:l})}else warn("Ignoring /Mask in image without /ImageMask.")}else this.mask=n}static async buildImage({xref:e,res:t,image:a,isInline:r=!1,pdfFunctionFactory:i,globalColorSpaceCache:n,localColorSpaceCache:s}){const o=a;let c=null,l=null;const h=a.dict.get("SMask"),u=a.dict.get("Mask");h?h instanceof BaseStream?c=h:warn("Unsupported /SMask format."):u&&(u instanceof BaseStream||Array.isArray(u)?l=u:warn("Unsupported /Mask format."));return new PDFImage({xref:e,res:t,image:o,isInline:r,smask:c,mask:l,pdfFunctionFactory:i,globalColorSpaceCache:n,localColorSpaceCache:s})}static async createMask({image:e,isOffscreenCanvasSupported:t=!1}){const{dict:a}=e,r=a.get("W","Width"),i=a.get("H","Height"),n=a.get("I","Interpolate"),s=a.getArray("D","Decode"),o=s?.[0]>0,c=(r+7>>3)*i,l=e.getBytes(c),h=1===r&&1===i&&o===(0===l.length||!!(128&l[0]));if(h)return{isSingleOpaquePixel:h};if(t){if(ImageResizer.needsToBeResized(r,i)){const e=new Uint8ClampedArray(r*i*4);convertBlackAndWhiteToRGBA({src:l,dest:e,width:r,height:i,nonBlackColor:0,inverseDecode:o});return ImageResizer.createImage({kind:v,data:e,width:r,height:i,interpolate:n})}const e=new OffscreenCanvas(r,i),t=e.getContext("2d"),a=t.createImageData(r,i);convertBlackAndWhiteToRGBA({src:l,dest:a.data,width:r,height:i,nonBlackColor:0,inverseDecode:o});t.putImageData(a,0,0);return{data:null,width:r,height:i,interpolate:n,bitmap:e.transferToImageBitmap()}}const u=l.byteLength;let d;if(e instanceof DecodeStream&&(!o||c===u))d=l;else if(o){d=new Uint8Array(c);d.set(l);d.fill(255,u)}else d=new Uint8Array(l);if(o)for(let e=0;e<u;e++)d[e]^=255;return{data:d,width:r,height:i,interpolate:n}}get drawWidth(){return Math.max(this.width,this.smask?.width||0,this.mask?.width||0)}get drawHeight(){return Math.max(this.height,this.smask?.height||0,this.mask?.height||0)}decodeBuffer(e){const t=this.bpc,a=this.numComps,r=this.decodeAddends,i=this.decodeCoefficients,n=(1<<t)-1;let s,o;if(1===t){for(s=0,o=e.length;s<o;s++)e[s]=+!e[s];return}let c=0;for(s=0,o=this.width*this.height;s<o;s++)for(let t=0;t<a;t++){e[c]=MathClamp(r[t]+e[c]*i[t],0,n);c++}}getComponents(e){const t=this.bpc;if(8===t)return e;const a=this.width,r=this.height,i=this.numComps,n=a*r*i;let s,o=0;s=t<=8?new Uint8Array(n):t<=16?new Uint16Array(n):new Uint32Array(n);const c=a*i,l=(1<<t)-1;let h,u,d=0;if(1===t){let t,a,i;for(let n=0;n<r;n++){a=d+(-8&c);i=d+c;for(;d<a;){u=e[o++];s[d]=u>>7&1;s[d+1]=u>>6&1;s[d+2]=u>>5&1;s[d+3]=u>>4&1;s[d+4]=u>>3&1;s[d+5]=u>>2&1;s[d+6]=u>>1&1;s[d+7]=1&u;d+=8}if(d<i){u=e[o++];t=128;for(;d<i;){s[d++]=+!!(u&t);t>>=1}}}}else{let a=0;u=0;for(d=0,h=n;d<h;++d){if(d%c==0){u=0;a=0}for(;a<t;){u=u<<8|e[o++];a+=8}const r=a-t;let i=u>>r;i<0?i=0:i>l&&(i=l);s[d]=i;u&=(1<<r)-1;a=r}}return s}async fillOpacity(e,t,a,r,i){const n=this.smask,s=this.mask;let o,c,l,h,u,d;if(n){c=n.width;l=n.height;o=new Uint8ClampedArray(c*l);await n.fillGrayBuffer(o);c===t&&l===a||(o=resizeImageMask(o,n.bpc,c,l,t,a))}else if(s)if(s instanceof PDFImage){c=s.width;l=s.height;o=new Uint8ClampedArray(c*l);s.numComps=1;await s.fillGrayBuffer(o);for(h=0,u=c*l;h<u;++h)o[h]=255-o[h];c===t&&l===a||(o=resizeImageMask(o,s.bpc,c,l,t,a))}else{if(!Array.isArray(s))throw new FormatError("Unknown mask format.");{o=new Uint8ClampedArray(t*a);const e=this.numComps;for(h=0,u=t*a;h<u;++h){let t=0;const a=h*e;for(d=0;d<e;++d){const e=i[a+d],r=2*d;if(e<s[r]||e>s[r+1]){t=255;break}}o[h]=t}}}if(o)for(h=0,d=3,u=t*r;h<u;++h,d+=4)e[d]=o[h];else for(h=0,d=3,u=t*r;h<u;++h,d+=4)e[d]=255}undoPreblend(e,t,a){const r=this.smask?.matte;if(!r)return;const i=this.colorSpace.getRgb(r,0),n=i[0],s=i[1],o=i[2],c=t*a*4;for(let t=0;t<c;t+=4){const a=e[t+3];if(0===a){e[t]=255;e[t+1]=255;e[t+2]=255;continue}const r=255/a;e[t]=(e[t]-n)*r+n;e[t+1]=(e[t+1]-s)*r+s;e[t+2]=(e[t+2]-o)*r+o}}async createImageData(e=!1,t=!1){const a=this.drawWidth,r=this.drawHeight,i={width:a,height:r,interpolate:this.interpolate,kind:0,data:null},n=this.numComps,s=this.width,o=this.height,c=this.bpc,l=s*n*c+7>>3,h=t&&ImageResizer.needsToBeResized(a,r);if(!this.smask&&!this.mask&&"DeviceRGBA"===this.colorSpace.name){i.kind=v;const e=i.data=await this.getImageBytes(o*s*4,{});return t?h?ImageResizer.createImage(i,!1):this.createBitmap(v,a,r,e):i}if(!e){let e;"DeviceGray"===this.colorSpace.name&&1===c?e=k:"DeviceRGB"!==this.colorSpace.name||8!==c||this.needsDecode||(e=C);if(e&&!this.smask&&!this.mask&&a===s&&r===o){const n=await this.#$(s,o);if(n)return n;const c=await this.getImageBytes(o*l,{});if(t)return h?ImageResizer.createImage({data:c,kind:e,width:a,height:r,interpolate:this.interpolate},this.needsDecode):this.createBitmap(e,s,o,c);i.kind=e;i.data=c;if(this.needsDecode){assert(e===k,"PDFImage.createImageData: The image must be grayscale.");const t=i.data;for(let e=0,a=t.length;e<a;e++)t[e]^=255}return i}if(this.image instanceof JpegStream&&!this.smask&&!this.mask&&!this.needsDecode){let e=o*l;if(t&&!h){let t=!1;switch(this.colorSpace.name){case"DeviceGray":e*=4;t=!0;break;case"DeviceRGB":e=e/3*4;t=!0;break;case"DeviceCMYK":t=!0}if(t){const t=await this.#$(a,r);if(t)return t;const i=await this.getImageBytes(e,{drawWidth:a,drawHeight:r,forceRGBA:!0});return this.createBitmap(v,a,r,i)}}else switch(this.colorSpace.name){case"DeviceGray":e*=3;case"DeviceRGB":case"DeviceCMYK":i.kind=C;i.data=await this.getImageBytes(e,{drawWidth:a,drawHeight:r,forceRGB:!0});return h?ImageResizer.createImage(i):i}}}const u=await this.getImageBytes(o*l,{internal:!0}),d=0|u.length/l*r/o,f=this.getComponents(u);let g,p,m,b,y,w;if(t&&!h){m=new OffscreenCanvas(a,r);b=m.getContext("2d");y=b.createImageData(a,r);w=y.data}i.kind=v;if(e||this.smask||this.mask){t&&!h||(w=new Uint8ClampedArray(a*r*4));g=1;p=!0;await this.fillOpacity(w,a,r,d,f)}else{if(!t||h){i.kind=C;w=new Uint8ClampedArray(a*r*3);g=0}else{new Uint32Array(w.buffer).fill(FeatureTest.isLittleEndian?4278190080:255);g=1}p=!1}this.needsDecode&&this.decodeBuffer(f);this.colorSpace.fillRgb(w,s,o,a,r,d,c,f,g);p&&this.undoPreblend(w,a,d);if(t&&!h){b.putImageData(y,0,0);return{data:null,width:a,height:r,bitmap:m.transferToImageBitmap(),interpolate:this.interpolate}}i.data=w;return h?ImageResizer.createImage(i):i}async fillGrayBuffer(e){const t=this.numComps;if(1!==t)throw new FormatError(`Reading gray scale from a color image: ${t}`);const a=this.width,r=this.height,i=this.bpc,n=a*t*i+7>>3,s=await this.getImageBytes(r*n,{internal:!0}),o=this.getComponents(s);let c,l;if(1===i){l=a*r;if(this.needsDecode)for(c=0;c<l;++c)e[c]=o[c]-1&255;else for(c=0;c<l;++c)e[c]=255&-o[c];return}this.needsDecode&&this.decodeBuffer(o);l=a*r;const h=255/((1<<i)-1);for(c=0;c<l;++c)e[c]=h*o[c]}createBitmap(e,t,a,r){const i=new OffscreenCanvas(t,a),n=i.getContext("2d");let s;if(e===v)s=new ImageData(r,t,a);else{s=n.createImageData(t,a);convertToRGBA({kind:e,src:r,dest:new Uint32Array(s.data.buffer),width:t,height:a,inverseDecode:this.needsDecode})}n.putImageData(s,0,0);return{data:null,width:t,height:a,bitmap:i.transferToImageBitmap(),interpolate:this.interpolate}}async#$(e,t){const a=await this.image.getTransferableImage();return a?{data:null,width:e,height:t,bitmap:a,interpolate:this.interpolate}:null}async getImageBytes(e,{drawWidth:t,drawHeight:a,forceRGBA:r=!1,forceRGB:i=!1,internal:n=!1}){this.image.reset();this.image.drawWidth=t||this.width;this.image.drawHeight=a||this.height;this.image.forceRGBA=!!r;this.image.forceRGB=!!i;const s=await this.image.getImageData(e,this.jpxDecoderOptions);if(n||this.image instanceof DecodeStream)return s;assert(s instanceof Uint8Array,\'PDFImage.getImageBytes: Unsupported "imageBytes" type.\');return new Uint8Array(s)}}const Bn=Object.freeze({maxImageSize:-1,disableFontFace:!1,ignoreErrors:!1,isEvalSupported:!0,isOffscreenCanvasSupported:!1,isImageDecoderSupported:!1,canvasMaxAreaInBytes:-1,fontExtraProperties:!1,useSystemFonts:!0,useWasm:!0,useWorkerFetch:!0,cMapUrl:null,iccUrl:null,standardFontDataUrl:null,wasmUrl:null}),Rn=1,Nn=2,En=Promise.resolve();function normalizeBlendMode(e,t=!1){if(Array.isArray(e)){for(const t of e){const e=normalizeBlendMode(t,!0);if(e)return e}warn(`Unsupported blend mode Array: ${e}`);return"source-over"}if(!(e instanceof Name))return t?null:"source-over";switch(e.name){case"Normal":case"Compatible":return"source-over";case"Multiply":return"multiply";case"Screen":return"screen";case"Overlay":return"overlay";case"Darken":return"darken";case"Lighten":return"lighten";case"ColorDodge":return"color-dodge";case"ColorBurn":return"color-burn";case"HardLight":return"hard-light";case"SoftLight":return"soft-light";case"Difference":return"difference";case"Exclusion":return"exclusion";case"Hue":return"hue";case"Saturation":return"saturation";case"Color":return"color";case"Luminosity":return"luminosity"}if(t)return null;warn(`Unsupported blend mode: ${e.name}`);return"source-over"}function addCachedImageOps(e,{objId:t,fn:a,args:r,optionalContent:i,hasMask:n}){t&&e.addDependency(t);e.addImageOps(a,r,i,n);a===Vt&&r[0]?.count>0&&r[0].count++}class TimeSlotManager{static TIME_SLOT_DURATION_MS=20;static CHECK_TIME_EVERY=100;constructor(){this.reset()}check(){if(++this.checked<TimeSlotManager.CHECK_TIME_EVERY)return!1;this.checked=0;return this.endTime<=Date.now()}reset(){this.endTime=Date.now()+TimeSlotManager.TIME_SLOT_DURATION_MS;this.checked=0}}class PartialEvaluator{constructor({xref:e,handler:t,pageIndex:a,idFactory:r,fontCache:i,builtInCMapCache:n,standardFontDataCache:s,globalColorSpaceCache:o,globalImageCache:c,systemFontCache:l,options:h=null}){this.xref=e;this.handler=t;this.pageIndex=a;this.idFactory=r;this.fontCache=i;this.builtInCMapCache=n;this.standardFontDataCache=s;this.globalColorSpaceCache=o;this.globalImageCache=c;this.systemFontCache=l;this.options=h||Bn;this.type3FontRefs=null;this._regionalImageCache=new RegionalImageCache;this._fetchBuiltInCMapBound=this.fetchBuiltInCMap.bind(this)}get _pdfFunctionFactory(){return shadow(this,"_pdfFunctionFactory",new PDFFunctionFactory({xref:this.xref,isEvalSupported:this.options.isEvalSupported}))}get parsingType3Font(){return!!this.type3FontRefs}clone(e=null){const t=Object.create(this);t.options=Object.assign(Object.create(null),this.options,e);return t}hasBlendModes(e,t){if(!(e instanceof Dict))return!1;if(e.objId&&t.has(e.objId))return!1;const a=new RefSet(t);e.objId&&a.put(e.objId);const r=[e],i=this.xref;for(;r.length;){const e=r.shift(),t=e.get("ExtGState");if(t instanceof Dict)for(let e of t.getRawValues()){if(e instanceof Ref){if(a.has(e))continue;try{e=i.fetch(e)}catch(t){a.put(e);info(`hasBlendModes - ignoring ExtGState: "${t}".`);continue}}if(!(e instanceof Dict))continue;e.objId&&a.put(e.objId);const t=e.get("BM");if(t instanceof Name){if("Normal"!==t.name)return!0}else if(void 0!==t&&Array.isArray(t))for(const e of t)if(e instanceof Name&&"Normal"!==e.name)return!0}const n=e.get("XObject");if(n instanceof Dict)for(let e of n.getRawValues()){if(e instanceof Ref){if(a.has(e))continue;try{e=i.fetch(e)}catch(t){a.put(e);info(`hasBlendModes - ignoring XObject: "${t}".`);continue}}if(!(e instanceof BaseStream))continue;e.dict.objId&&a.put(e.dict.objId);const t=e.dict.get("Resources");if(t instanceof Dict&&(!t.objId||!a.has(t.objId))){r.push(t);t.objId&&a.put(t.objId)}}}for(const e of a)t.put(e);return!1}async fetchBuiltInCMap(e){const t=this.builtInCMapCache.get(e);if(t)return t;let a;a=this.options.useWorkerFetch?{cMapData:await fetchBinaryData(`${this.options.cMapUrl}${e}.bcmap`),isCompressed:!0}:await this.handler.sendWithPromise("FetchBinaryData",{type:"cMapReaderFactory",name:e});this.builtInCMapCache.set(e,a);return a}async fetchStandardFontData(e){const t=this.standardFontDataCache.get(e);if(t)return new Stream(t);if(this.options.useSystemFonts&&"Symbol"!==e&&"ZapfDingbats"!==e)return null;const a=Yr()[e];let r;try{r=this.options.useWorkerFetch?await fetchBinaryData(`${this.options.standardFontDataUrl}${a}`):await this.handler.sendWithPromise("FetchBinaryData",{type:"standardFontDataFactory",filename:a})}catch(e){warn(e);return null}this.standardFontDataCache.set(e,r);return new Stream(r)}async buildFormXObject(e,t,a,r,i,n,s,o){const{dict:c}=t,l=lookupMatrix(c.getArray("Matrix"),null),h=lookupNormalRect(c.getArray("BBox"),null);let u,d;c.has("OC")&&(u=await this.parseMarkedContentProps(c.get("OC"),e));void 0!==u&&r.addOp(jt,["OC",u]);const f=c.get("Group");if(f){d={matrix:l,bbox:h,smask:a,isolated:!1,knockout:!1};let t=null;if(isName(f.get("S"),"Transparency")){d.isolated=f.get("I")||!1;d.knockout=f.get("K")||!1;if(f.has("CS")){const a=this._getColorSpace(f.getRaw("CS"),e,s);t=a instanceof ColorSpace?a:await this._handleColorSpace(a)}}if(a?.backdrop){t||=ColorSpaceUtils.rgb;a.backdrop=t.getRgbHex(a.backdrop,0)}r.addOp(Wt,[d])}const g=[l&&new Float32Array(l),!f&&h&&new Float32Array(h)||null];r.addOp(qt,g);const p=c.get("Resources");await this.getOperatorList({stream:t,task:i,resources:p instanceof Dict?p:e,operatorList:r,initialState:n,prevRefs:o});r.addOp(Ht,[]);f&&r.addOp(zt,[d]);void 0!==u&&r.addOp(_t,[])}_sendImgData(e,t,a=!1){const r=t?[t.bitmap||t.data.buffer]:null;return this.parsingType3Font||a?this.handler.send("commonobj",[e,"Image",t],r):this.handler.send("obj",[e,this.pageIndex,"Image",t],r)}async buildPaintImageXObject({resources:e,image:t,isInline:a=!1,operatorList:r,cacheKey:i,localImageCache:n,localColorSpaceCache:s}){const{maxImageSize:o,ignoreErrors:c,isOffscreenCanvasSupported:l}=this.options,{dict:h}=t,u=h.objId,d=h.get("W","Width"),f=h.get("H","Height");if(!d||"number"!=typeof d||!f||"number"!=typeof f){warn("Image dimensions are missing, or not numbers.");return}if(-1!==o&&d*f>o){const e="Image exceeded maximum allowed size and was removed.";if(!c)throw new Error(e);warn(e);return}let g;h.has("OC")&&(g=await this.parseMarkedContentProps(h.get("OC"),e));let p,m,b;if(h.get("IM","ImageMask")||!1){p=await PDFImage.createMask({image:t,isOffscreenCanvasSupported:l&&!this.parsingType3Font});if(p.isSingleOpaquePixel){m=ta;b=[];r.addImageOps(m,b,g);if(i){const e={fn:m,args:b,optionalContent:g};n.set(i,u,e);u&&this._regionalImageCache.set(null,u,e)}return}if(this.parsingType3Font){b=function compileType3Glyph({data:e,width:t,height:a}){if(t>1e3||a>1e3)return null;const r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=t+1,n=new Uint8Array(i*(a+1));let s,o,c;const l=t+7&-8,h=new Uint8Array(l*a);let u=0;for(const t of e){let e=128;for(;e>0;){h[u++]=t&e?0:255;e>>=1}}let d=0;u=0;if(0!==h[u]){n[0]=1;++d}for(o=1;o<t;o++){if(h[u]!==h[u+1]){n[o]=h[u]?2:1;++d}u++}if(0!==h[u]){n[o]=2;++d}for(s=1;s<a;s++){u=s*l;c=s*i;if(h[u-l]!==h[u]){n[c]=h[u]?1:8;++d}let e=(h[u]?4:0)+(h[u-l]?8:0);for(o=1;o<t;o++){e=(e>>2)+(h[u+1]?4:0)+(h[u-l+1]?8:0);if(r[e]){n[c+o]=r[e];++d}u++}if(h[u-l]!==h[u]){n[c+o]=h[u]?2:4;++d}if(d>1e3)return null}u=l*(a-1);c=s*i;if(0!==h[u]){n[c]=8;++d}for(o=1;o<t;o++){if(h[u]!==h[u+1]){n[c+o]=h[u]?4:8;++d}u++}if(0!==h[u]){n[c+o]=4;++d}if(d>1e3)return null;const f=new Int32Array([0,i,-1,0,-i,0,0,0,1]),g=[],{a:p,b:m,c:b,d:y,e:w,f:x}=(new DOMMatrix).scaleSelf(1/t,-1/a).translateSelf(0,-a);for(s=0;d&&s<=a;s++){let e=s*i;const a=e+t;for(;e<a&&!n[e];)e++;if(e===a)continue;let r=e%i,o=s;g.push(sa,p*r+b*o+w,m*r+y*o+x);const c=e;let l=n[e];do{const t=f[l];do{e+=t}while(!n[e]);const a=n[e];if(5!==a&&10!==a){l=a;n[e]=0}else{l=a&51*l>>4;n[e]&=l>>2|l<<2}r=e%i;o=e/i|0;g.push(oa,p*r+b*o+w,m*r+y*o+x);n[e]||--d}while(c!==e);--s}return[na,[new Float32Array(g)],new Float32Array([0,0,t,a])]}(p);if(b){r.addImageOps(aa,b,g);return}warn("Cannot compile Type3 glyph.");r.addImageOps(Vt,[p],g);return}const e=`mask_${this.idFactory.createObjId()}`;r.addDependency(e);p.dataLen=p.bitmap?p.width*p.height*4:p.data.length;this._sendImgData(e,p);m=Vt;b=[{data:e,width:p.width,height:p.height,interpolate:p.interpolate,count:1}];r.addImageOps(m,b,g);if(i){const t={objId:e,fn:m,args:b,optionalContent:g};n.set(i,u,t);u&&this._regionalImageCache.set(null,u,t)}return}const y=h.has("SMask")||h.has("Mask");if(a&&d+f<200&&!y){try{const i=new PDFImage({xref:this.xref,res:e,image:t,isInline:a,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:s});p=await i.createImageData(!0,!1);r.addImageOps(Yt,[p],g)}catch(e){const t=`Unable to decode inline image: "${e}".`;if(!c)throw new Error(t);warn(t)}return}let w=`img_${this.idFactory.createObjId()}`,x=!1,S=null;if(this.parsingType3Font)w=`${this.idFactory.getDocId()}_type3_${w}`;else if(i&&u){x=this.globalImageCache.shouldCache(u,this.pageIndex);if(x){assert(!a,"Cannot cache an inline image globally.");w=`${this.idFactory.getDocId()}_${w}`}}r.addDependency(w);m=Jt;b=[w,d,f];r.addImageOps(m,b,g,y);if(x){S={objId:w,fn:m,args:b,optionalContent:g,hasMask:y,byteSize:0};if(this.globalImageCache.hasDecodeFailed(u)){this.globalImageCache.setData(u,S);this._sendImgData(w,null,x);return}if(d*f>25e4||y){const e=await this.handler.sendWithPromise("commonobj",[w,"CopyLocalImage",{imageRef:u}]);if(e){this.globalImageCache.setData(u,S);this.globalImageCache.addByteSize(u,e);return}}}PDFImage.buildImage({xref:this.xref,res:e,image:t,isInline:a,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:s}).then((async e=>{p=await e.createImageData(!1,l);p.dataLen=p.bitmap?p.width*p.height*4:p.data.length;p.ref=u;x&&this.globalImageCache.addByteSize(u,p.dataLen);return this._sendImgData(w,p,x)})).catch((e=>{warn(`Unable to decode image "${w}": "${e}".`);u&&this.globalImageCache.addDecodeFailed(u);return this._sendImgData(w,null,x)}));if(i){const e={objId:w,fn:m,args:b,optionalContent:g,hasMask:y};n.set(i,u,e);if(u){this._regionalImageCache.set(null,u,e);if(x){assert(S,"The global cache-data must be available.");this.globalImageCache.setData(u,S)}}}}handleSMask(e,t,a,r,i,n,s){const o=e.get("G"),c={subtype:e.get("S").name,backdrop:e.get("BC")},l=e.get("TR");if(isPDFFunction(l)){const e=this._pdfFunctionFactory.create(l),t=new Uint8Array(256),a=new Float32Array(1);for(let r=0;r<256;r++){a[0]=r/255;e(a,0,a,0);t[r]=255*a[0]|0}c.transferMap=t}return this.buildFormXObject(t,o,c,a,r,i.state.clone({newPath:!0}),n,s)}handleTransferFunction(e){let t;if(Array.isArray(e))t=e;else{if(!isPDFFunction(e))return null;t=[e]}const a=[];let r=0,i=0;for(const e of t){const t=this.xref.fetchIfRef(e);r++;if(isName(t,"Identity")){a.push(null);continue}if(!isPDFFunction(t))return null;const n=this._pdfFunctionFactory.create(t),s=new Uint8Array(256),o=new Float32Array(1);for(let e=0;e<256;e++){o[0]=e/255;n(o,0,o,0);s[e]=255*o[0]|0}a.push(s);i++}return 1!==r&&4!==r||0===i?null:a}handleTilingType(e,t,a,r,i,n,s,o){const c=new OperatorList,l=Dict.merge({xref:this.xref,dictArray:[i.get("Resources"),a]});return this.getOperatorList({stream:r,task:s,resources:l,operatorList:c}).then((function(){const a=c.getIR(),r=getTilingPatternIR(a,i,t);n.addDependencies(c.dependencies);n.addOp(e,r);i.objId&&o.set(null,i.objId,{operatorListIR:a,dict:i})})).catch((e=>{if(!(e instanceof AbortException)){if(!this.options.ignoreErrors)throw e;warn(`handleTilingType - ignoring pattern: "${e}".`)}}))}async handleSetFont(e,t,a,r,i,n,s=null,o=null){const c=t?.[0]instanceof Name?t[0].name:null,l=await this.loadFont(c,a,e,i,s,o);l.font.isType3Font&&r.addDependencies(l.type3Dependencies);n.font=l.font;l.send(this.handler);return l.loadedName}handleText(e,t){const a=t.font,r=a.charsToGlyphs(e);if(a.data){(!!(t.textRenderingMode&S)||"Pattern"===t.fillColorSpace.name||a.disableFontFace)&&PartialEvaluator.buildFontPaths(a,r,this.handler,this.options)}return r}ensureStateFont(e){if(e.font)return;const t=new FormatError("Missing setFont (Tf) operator before text rendering operator.");if(!this.options.ignoreErrors)throw t;warn(`ensureStateFont: "${t}".`)}async setGState({resources:e,gState:t,operatorList:a,cacheKey:r,task:i,stateManager:n,localGStateCache:s,localColorSpaceCache:o,seenRefs:c}){const l=t.objId;let h=!0;const u=[];let d=Promise.resolve();for(const[r,s]of t)switch(r){case"Type":break;case"LW":if("number"!=typeof s){warn(`Invalid LW (line width): ${s}`);break}u.push([r,Math.abs(s)]);break;case"LC":case"LJ":case"ML":case"D":case"RI":case"FL":case"CA":case"ca":u.push([r,s]);break;case"Font":h=!1;d=d.then((()=>this.handleSetFont(e,null,s[0],a,i,n.state).then((function(e){a.addDependency(e);u.push([r,[e,s[1]]])}))));break;case"BM":u.push([r,normalizeBlendMode(s)]);break;case"SMask":if(isName(s,"None")){u.push([r,!1]);break}if(s instanceof Dict){h=!1;d=d.then((()=>this.handleSMask(s,e,a,i,n,o,c)));u.push([r,!0])}else warn("Unsupported SMask type");break;case"TR":const t=this.handleTransferFunction(s);u.push([r,t]);break;case"OP":case"op":case"OPM":case"BG":case"BG2":case"UCR":case"UCR2":case"TR2":case"HT":case"SM":case"SA":case"AIS":case"TK":info("graphic state operator "+r);break;default:info("Unknown graphic state operator "+r)}await d;u.length>0&&a.addOp(De,[u]);h&&s.set(r,l,u)}loadFont(e,t,a,r,i=null,n=null){const errorFont=async()=>new TranslatedFont({loadedName:"g_font_error",font:new ErrorFont(`Font "${e}" is not available.`),dict:t});let s;if(t)t instanceof Ref&&(s=t);else{const t=a.get("Font");t&&(s=t.getRaw(e))}if(s){if(this.type3FontRefs?.has(s))return errorFont();if(this.fontCache.has(s))return this.fontCache.get(s);try{t=this.xref.fetchIfRef(s)}catch(e){warn(`loadFont - lookup failed: "${e}".`)}}if(!(t instanceof Dict)){if(!this.options.ignoreErrors&&!this.parsingType3Font){warn(`Font "${e}" is not available.`);return errorFont()}warn(`Font "${e}" is not available -- attempting to fallback to a default font.`);t=i||PartialEvaluator.fallbackFontDict}if(t.cacheKey&&this.fontCache.has(t.cacheKey))return this.fontCache.get(t.cacheKey);const{promise:o,resolve:c}=Promise.withResolvers();let l;try{l=this.preEvaluateFont(t);l.cssFontInfo=n}catch(e){warn(`loadFont - preEvaluateFont failed: "${e}".`);return errorFont()}const{descriptor:h,hash:u}=l,d=s instanceof Ref;let f;if(u&&h instanceof Dict){const e=h.fontAliases||=Object.create(null);if(e[u]){const t=e[u].aliasRef;if(d&&t&&this.fontCache.has(t)){this.fontCache.putAlias(s,t);return this.fontCache.get(s)}}else e[u]={fontID:this.idFactory.createFontId()};d&&(e[u].aliasRef=s);f=e[u].fontID}else f=this.idFactory.createFontId();assert(f?.startsWith("f"),\'The "fontID" must be (correctly) defined.\');if(d)this.fontCache.put(s,o);else{t.cacheKey=`cacheKey_${f}`;this.fontCache.put(t.cacheKey,o)}t.loadedName=`${this.idFactory.getDocId()}_${f}`;this.translateFont(l).then((async e=>{const i=new TranslatedFont({loadedName:t.loadedName,font:e,dict:t});if(e.isType3Font)try{await i.loadType3Data(this,a,r)}catch(e){throw new Error(`Type3 font load error: ${e}`)}c(i)})).catch((e=>{warn(`loadFont - translateFont failed: "${e}".`);c(new TranslatedFont({loadedName:t.loadedName,font:new ErrorFont(e?.message),dict:t}))}));return o}buildPath(e,t,a){const{pathMinMax:r,pathBuffer:i}=a;switch(0|e){case Xe:{const e=a.currentPointX=t[0],n=a.currentPointY=t[1],s=t[2],o=t[3],c=e+s,l=n+o;0===s||0===o?i.push(sa,e,n,oa,c,l,la):i.push(sa,e,n,oa,c,n,oa,c,l,oa,e,l,la);Util.rectBoundingBox(e,n,c,l,r);break}case Ee:{const e=a.currentPointX=t[0],n=a.currentPointY=t[1];i.push(sa,e,n);Util.pointBoundingBox(e,n,r);break}case Pe:{const e=a.currentPointX=t[0],n=a.currentPointY=t[1];i.push(oa,e,n);Util.pointBoundingBox(e,n,r);break}case Le:{const e=a.currentPointX,n=a.currentPointY,[s,o,c,l,h,u]=t;a.currentPointX=h;a.currentPointY=u;i.push(ca,s,o,c,l,h,u);Util.bezierBoundingBox(e,n,s,o,c,l,h,u,r);break}case je:{const e=a.currentPointX,n=a.currentPointY,[s,o,c,l]=t;a.currentPointX=c;a.currentPointY=l;i.push(ca,e,n,s,o,c,l);Util.bezierBoundingBox(e,n,e,n,s,o,c,l,r);break}case _e:{const e=a.currentPointX,n=a.currentPointY,[s,o,c,l]=t;a.currentPointX=c;a.currentPointY=l;i.push(ca,s,o,c,l,c,l);Util.bezierBoundingBox(e,n,s,o,c,l,c,l,r);break}case Ue:i.push(la)}}_getColorSpace(e,t,a){return ColorSpaceUtils.parse({cs:e,xref:this.xref,resources:t,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:a,asyncIfNotCached:!0})}async _handleColorSpace(e){try{return await e}catch(e){if(e instanceof AbortException)return null;if(this.options.ignoreErrors){warn(`_handleColorSpace - ignoring ColorSpace: "${e}".`);return null}throw e}}parseShading({shading:e,resources:t,localColorSpaceCache:a,localShadingPatternCache:r}){let i,n=r.get(e);if(n)return n;try{i=Pattern.parseShading(e,this.xref,t,this._pdfFunctionFactory,this.globalColorSpaceCache,a).getIR()}catch(t){if(t instanceof AbortException)return null;if(this.options.ignoreErrors){warn(`parseShading - ignoring shading: "${t}".`);r.set(e,null);return null}throw t}n=`pattern_${this.idFactory.createObjId()}`;this.parsingType3Font&&(n=`${this.idFactory.getDocId()}_type3_${n}`);r.set(e,n);this.parsingType3Font?this.handler.send("commonobj",[n,"Pattern",i]):this.handler.send("obj",[n,this.pageIndex,"Pattern",i]);return n}handleColorN(e,t,a,r,i,n,s,o,c,l){const h=a.pop();if(h instanceof Name){const u=i.getRaw(h.name),d=u instanceof Ref&&c.getByRef(u);if(d)try{const i=r.base?r.base.getRgbHex(a,0):null,n=getTilingPatternIR(d.operatorListIR,d.dict,i);e.addOp(t,n);return}catch{}const f=this.xref.fetchIfRef(u);if(f){const i=f instanceof BaseStream?f.dict:f,h=i.get("PatternType");if(h===Rn){const o=r.base?r.base.getRgbHex(a,0):null;return this.handleTilingType(t,o,n,f,i,e,s,c)}if(h===Nn){const a=i.get("Shading"),r=this.parseShading({shading:a,resources:n,localColorSpaceCache:o,localShadingPatternCache:l});if(r){const a=lookupMatrix(i.getArray("Matrix"),null);e.addOp(t,["Shading",r,a])}return}throw new FormatError(`Unknown PatternType: ${h}`)}}throw new FormatError(`Unknown PatternName: ${h}`)}_parseVisibilityExpression(e,t,a){if(++t>10){warn("Visibility expression is too deeply nested");return}const r=e.length,i=this.xref.fetchIfRef(e[0]);if(!(r<2)&&i instanceof Name){switch(i.name){case"And":case"Or":case"Not":a.push(i.name);break;default:warn(`Invalid operator ${i.name} in visibility expression`);return}for(let i=1;i<r;i++){const r=e[i],n=this.xref.fetchIfRef(r);if(Array.isArray(n)){const e=[];a.push(e);this._parseVisibilityExpression(n,t,e)}else r instanceof Ref&&a.push(r.toString())}}else warn("Invalid visibility expression")}async parseMarkedContentProps(e,t){let a;if(e instanceof Name){a=t.get("Properties").get(e.name)}else{if(!(e instanceof Dict))throw new FormatError("Optional content properties malformed.");a=e}const r=a.get("Type")?.name;if("OCG"===r)return{type:r,id:a.objId};if("OCMD"===r){const e=a.get("VE");if(Array.isArray(e)){const t=[];this._parseVisibilityExpression(e,0,t);if(t.length>0)return{type:"OCMD",expression:t}}const t=a.get("OCGs");if(Array.isArray(t)||t instanceof Dict){const e=[];if(Array.isArray(t))for(const a of t)e.push(a.toString());else e.push(t.objId);return{type:r,ids:e,policy:a.get("P")instanceof Name?a.get("P").name:null,expression:null}}if(t instanceof Ref)return{type:r,id:t.toString()}}return null}getOperatorList({stream:e,task:t,resources:a,operatorList:r,initialState:i=null,fallbackFontDict:n=null,prevRefs:s=null}){const o=e.dict?.objId,c=new RefSet(s);if(o){if(s?.has(o))throw new Error(`getOperatorList - ignoring circular reference: ${o}`);c.put(o)}a||=Dict.empty;i||=new EvalState;if(!r)throw new Error(\'getOperatorList: missing "operatorList" parameter\');const l=this,h=this.xref,u=new LocalImageCache,d=new LocalColorSpaceCache,f=new LocalGStateCache,g=new LocalTilingPatternCache,p=new Map,m=a.get("XObject")||Dict.empty,b=a.get("Pattern")||Dict.empty,y=new StateManager(i),w=new EvaluatorPreprocessor(e,h,y),x=new TimeSlotManager;function closePendingRestoreOPS(e){for(let e=0,t=w.savedStatesDepth;e<t;e++)r.addOp(Re,[])}return new Promise((function promiseBody(e,i){const next=function(t){Promise.all([t,r.ready]).then((function(){try{promiseBody(e,i)}catch(e){i(e)}}),i)};t.ensureNotTerminated();x.reset();const s={};let o,S,k,C,v,F;for(;!(o=x.check());){s.args=null;if(!w.read(s))break;let e=s.args,i=s.fn;switch(0|i){case Nt:F=e[0]instanceof Name;v=e[0].name;if(F){const t=u.getByName(v);if(t){addCachedImageOps(r,t);e=null;continue}}next(new Promise((function(e,i){if(!F)throw new FormatError("XObject must be referred to by name.");let n=m.getRaw(v);if(n instanceof Ref){const t=u.getByRef(n)||l._regionalImageCache.getByRef(n)||l.globalImageCache.getData(n,l.pageIndex);if(t){addCachedImageOps(r,t);e();return}n=h.fetch(n)}if(!(n instanceof BaseStream))throw new FormatError("XObject should be a stream");const s=n.dict.get("Subtype");if(!(s instanceof Name))throw new FormatError("XObject should have a Name subtype");if("Form"!==s.name)if("Image"!==s.name){if("PS"!==s.name)throw new FormatError(`Unhandled XObject subtype ${s.name}`);info("Ignored XObject subtype PS");e()}else l.buildPaintImageXObject({resources:a,image:n,operatorList:r,cacheKey:v,localImageCache:u,localColorSpaceCache:d}).then(e,i);else{y.save();l.buildFormXObject(a,n,null,r,t,y.state.clone({newPath:!0}),d,c).then((function(){y.restore();e()}),i)}})).catch((function(e){if(!(e instanceof AbortException)){if(!l.options.ignoreErrors)throw e;warn(`getOperatorList - ignoring XObject: "${e}".`)}})));return;case nt:const s=e[1];next(l.handleSetFont(a,e,null,r,t,y.state,n).then((function(e){r.addDependency(e);r.addOp(nt,[e,s])})));return;case Rt:const o=e[0].cacheKey;if(o){const t=u.getByName(o);if(t){addCachedImageOps(r,t);e=null;continue}}next(l.buildPaintImageXObject({resources:a,image:e[0],isInline:!0,operatorList:r,cacheKey:o,localImageCache:u,localColorSpaceCache:d}));return;case dt:if(!y.state.font){l.ensureStateFont(y.state);continue}e[0]=l.handleText(e[0],y.state);break;case ft:if(!y.state.font){l.ensureStateFont(y.state);continue}const w=[],x=y.state;for(const t of e[0])"string"==typeof t?w.push(...l.handleText(t,x)):"number"==typeof t&&w.push(t);e[0]=w;i=dt;break;case gt:if(!y.state.font){l.ensureStateFont(y.state);continue}r.addOp(ut);e[0]=l.handleText(e[0],y.state);i=dt;break;case pt:if(!y.state.font){l.ensureStateFont(y.state);continue}r.addOp(ut);r.addOp(at,[e.shift()]);r.addOp(tt,[e.shift()]);e[0]=l.handleText(e[0],y.state);i=dt;break;case st:y.state.textRenderingMode=e[0];break;case wt:{const t=l._getColorSpace(e[0],a,d);if(t instanceof ColorSpace){y.state.fillColorSpace=t;continue}next(l._handleColorSpace(t).then((e=>{y.state.fillColorSpace=e||ColorSpaceUtils.gray})));return}case yt:{const t=l._getColorSpace(e[0],a,d);if(t instanceof ColorSpace){y.state.strokeColorSpace=t;continue}next(l._handleColorSpace(t).then((e=>{y.state.strokeColorSpace=e||ColorSpaceUtils.gray})));return}case At:C=y.state.fillColorSpace;e=[C.getRgbHex(e,0)];i=It;break;case xt:C=y.state.strokeColorSpace;e=[C.getRgbHex(e,0)];i=Ft;break;case vt:y.state.fillColorSpace=ColorSpaceUtils.gray;e=[ColorSpaceUtils.gray.getRgbHex(e,0)];i=It;break;case Ct:y.state.strokeColorSpace=ColorSpaceUtils.gray;e=[ColorSpaceUtils.gray.getRgbHex(e,0)];i=Ft;break;case Ot:y.state.fillColorSpace=ColorSpaceUtils.cmyk;e=[ColorSpaceUtils.cmyk.getRgbHex(e,0)];i=It;break;case Tt:y.state.strokeColorSpace=ColorSpaceUtils.cmyk;e=[ColorSpaceUtils.cmyk.getRgbHex(e,0)];i=Ft;break;case It:y.state.fillColorSpace=ColorSpaceUtils.rgb;e=[ColorSpaceUtils.rgb.getRgbHex(e,0)];break;case Ft:y.state.strokeColorSpace=ColorSpaceUtils.rgb;e=[ColorSpaceUtils.rgb.getRgbHex(e,0)];break;case kt:C=y.state.patternFillColorSpace;if(!C){if(isNumberArray(e,null)){e=[ColorSpaceUtils.gray.getRgbHex(e,0)];i=It;break}e=[];i=ia;break}if("Pattern"===C.name){next(l.handleColorN(r,kt,e,C,b,a,t,d,g,p));return}e=[C.getRgbHex(e,0)];i=It;break;case St:C=y.state.patternStrokeColorSpace;if(!C){if(isNumberArray(e,null)){e=[ColorSpaceUtils.gray.getRgbHex(e,0)];i=Ft;break}e=[];i=ra;break}if("Pattern"===C.name){next(l.handleColorN(r,St,e,C,b,a,t,d,g,p));return}e=[C.getRgbHex(e,0)];i=Ft;break;case Mt:let T;try{const t=a.get("Shading");if(!t)throw new FormatError("No shading resource found");T=t.get(e[0].name);if(!T)throw new FormatError("No shading object found")}catch(e){if(e instanceof AbortException)continue;if(l.options.ignoreErrors){warn(`getOperatorList - ignoring Shading: "${e}".`);continue}throw e}const O=l.parseShading({shading:T,resources:a,localColorSpaceCache:d,localShadingPatternCache:p});if(!O)continue;e=[O];i=Mt;break;case De:F=e[0]instanceof Name;v=e[0].name;if(F){const t=f.getByName(v);if(t){t.length>0&&r.addOp(De,[t]);e=null;continue}}next(new Promise((function(e,i){if(!F)throw new FormatError("GState must be referred to by name.");const n=a.get("ExtGState");if(!(n instanceof Dict))throw new FormatError("ExtGState should be a dictionary.");const s=n.get(v);if(!(s instanceof Dict))throw new FormatError("GState should be a dictionary.");l.setGState({resources:a,gState:s,operatorList:r,cacheKey:v,task:t,stateManager:y,localGStateCache:f,localColorSpaceCache:d,seenRefs:c}).then(e,i)})).catch((function(e){if(!(e instanceof AbortException)){if(!l.options.ignoreErrors)throw e;warn(`getOperatorList - ignoring ExtGState: "${e}".`)}})));return;case Ce:{const[t]=e;if("number"!=typeof t){warn(`Invalid setLineWidth: ${t}`);continue}e[0]=Math.abs(t);break}case Ee:case Pe:case Le:case je:case _e:case Ue:case Xe:l.buildPath(i,e,y.state);continue;case qe:case He:case We:case ze:case $e:case Ge:case Ve:case Ke:case Je:{const{state:{pathBuffer:e,pathMinMax:t}}=y;i!==He&&i!==Ve&&i!==Ke||e.push(la);if(0===e.length)r.addOp(aa,[i,[null],null]);else{r.addOp(aa,[i,[new Float32Array(e)],t.slice()]);e.length=0;t.set([1/0,1/0,-1/0,-1/0],0)}continue}case ht:r.addOp(i,[new Float32Array(e)]);continue;case Et:case Pt:case Ut:case Xt:continue;case jt:if(!(e[0]instanceof Name)){warn(`Expected name for beginMarkedContentProps arg0=${e[0]}`);r.addOp(jt,["OC",null]);continue}if("OC"===e[0].name){next(l.parseMarkedContentProps(e[1],a).then((e=>{r.addOp(jt,["OC",e])})).catch((e=>{if(!(e instanceof AbortException)){if(!l.options.ignoreErrors)throw e;warn(`getOperatorList - ignoring beginMarkedContentProps: "${e}".`);r.addOp(jt,["OC",null])}})));return}e=[e[0].name,e[1]instanceof Dict?e[1].get("MCID"):null];break;default:if(null!==e){for(S=0,k=e.length;S<k&&!(e[S]instanceof Dict);S++);if(S<k){warn("getOperatorList - ignoring operator: "+i);continue}}}r.addOp(i,e)}if(o)next(En);else{closePendingRestoreOPS();e()}})).catch((e=>{if(!(e instanceof AbortException)){if(!this.options.ignoreErrors)throw e;warn(`getOperatorList - ignoring errors during "${t.name}" task: "${e}".`);closePendingRestoreOPS()}}))}getTextContent({stream:e,task:a,resources:r,stateManager:i=null,includeMarkedContent:n=!1,sink:s,seenStyles:o=new Set,viewBox:c,lang:l=null,markedContentData:h=null,disableNormalization:u=!1,keepWhiteSpace:d=!1,prevRefs:f=null,intersector:g=null}){const p=e.dict?.objId,m=new RefSet(f);if(p){if(f?.has(p))throw new Error(`getTextContent - ignoring circular reference: ${p}`);m.put(p)}r||=Dict.empty;i||=new StateManager(new TextState);n&&(h||={level:0});const b={items:[],styles:Object.create(null),lang:l},y={initialized:!1,str:[],totalWidth:0,totalHeight:0,width:0,height:0,vertical:!1,prevTransform:null,textAdvanceScale:0,spaceInFlowMin:0,spaceInFlowMax:0,trackingSpaceMin:1/0,negativeSpaceMax:-1/0,notASpace:-1/0,transform:null,fontName:null,hasEOL:!1},w=[" "," "];let x=0;function saveLastChar(e){const t=(x+1)%2,a=" "!==w[x]&&" "===w[t];w[x]=e;x=t;return!d&&a}function shouldAddWhitepsace(){return!d&&" "!==w[x]&&" "===w[(x+1)%2]}function resetLastChars(){w[0]=w[1]=" ";x=0}const S=this,k=this.xref,C=[];let v=null;const F=new LocalImageCache,T=new LocalGStateCache,O=new EvaluatorPreprocessor(e,k,i);let M;function pushWhitespace({width:e=0,height:t=0,transform:a=y.prevTransform,fontName:r=y.fontName}){g?.addExtraChar(" ");b.items.push({str:" ",dir:"ltr",width:e,height:t,transform:a,fontName:r,hasEOL:!1})}function getCurrentTextTransform(){const e=M.font,a=[M.fontSize*M.textHScale,0,0,M.fontSize,0,M.textRise];if(e.isType3Font&&(M.fontSize<=1||e.isCharBBox)&&!isArrayEqual(M.fontMatrix,t)){const t=e.bbox[3]-e.bbox[1];t>0&&(a[3]*=t*M.fontMatrix[3])}return Util.transform(M.ctm,Util.transform(M.textMatrix,a))}function ensureTextContentItem(){if(y.initialized)return y;const{font:e,loadedName:t}=M;if(!o.has(t)){o.add(t);b.styles[t]={fontFamily:e.fallbackName,ascent:e.ascent,descent:e.descent,vertical:e.vertical};if(S.options.fontExtraProperties&&e.systemFontInfo){const a=b.styles[t];a.fontSubstitution=e.systemFontInfo.css;a.fontSubstitutionLoadedName=e.systemFontInfo.loadedName}}y.fontName=t;const a=y.transform=getCurrentTextTransform();if(e.vertical){y.width=y.totalWidth=Math.hypot(a[0],a[1]);y.height=y.totalHeight=0;y.vertical=!0}else{y.width=y.totalWidth=0;y.height=y.totalHeight=Math.hypot(a[2],a[3]);y.vertical=!1}const r=Math.hypot(M.textLineMatrix[0],M.textLineMatrix[1]),i=Math.hypot(M.ctm[0],M.ctm[1]);y.textAdvanceScale=i*r;const{fontSize:n}=M;y.trackingSpaceMin=.102*n;y.notASpace=.03*n;y.negativeSpaceMax=-.2*n;y.spaceInFlowMin=.102*n;y.spaceInFlowMax=.6*n;y.hasEOL=!1;y.initialized=!0;return y}function updateAdvanceScale(){if(!y.initialized)return;const e=Math.hypot(M.textLineMatrix[0],M.textLineMatrix[1]),t=Math.hypot(M.ctm[0],M.ctm[1])*e;if(t!==y.textAdvanceScale){if(y.vertical){y.totalHeight+=y.height*y.textAdvanceScale;y.height=0}else{y.totalWidth+=y.width*y.textAdvanceScale;y.width=0}y.textAdvanceScale=t}}function runBidiTransform(e){let t=e.str.join("");u||(t=function normalizeUnicode(e){if(!ma){ma=/([\\u00a0\\u00b5\\u037e\\u0eb3\\u2000-\\u200a\\u202f\\u2126\\ufb00-\\ufb04\\ufb06\\ufb20-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufba1\\ufba4-\\ufba9\\ufbae-\\ufbb1\\ufbd3-\\ufbdc\\ufbde-\\ufbe7\\ufbea-\\ufbf8\\ufbfc-\\ufbfd\\ufc00-\\ufc5d\\ufc64-\\ufcf1\\ufcf5-\\ufd3d\\ufd88\\ufdf4\\ufdfa-\\ufdfb\\ufe71\\ufe77\\ufe79\\ufe7b\\ufe7d]+)|(\\ufb05+)/gu;ba=new Map([["ſt","ſt"]])}return e.replaceAll(ma,((e,t,a)=>t?t.normalize("NFKC"):ba.get(a)))}(t));const a=bidi(t,-1,e.vertical);return{str:a.str,dir:a.dir,width:Math.abs(e.totalWidth),height:Math.abs(e.totalHeight),transform:e.transform,fontName:e.fontName,hasEOL:e.hasEOL}}async function handleSetFont(e,i){const n=await S.loadFont(e,i,r,a);M.loadedName=n.loadedName;M.font=n.font;M.fontMatrix=n.font.fontMatrix||t}function applyInverseRotation(e,t,a){const r=Math.hypot(a[0],a[1]);return[(a[0]*e+a[1]*t)/r,(a[2]*e+a[3]*t)/r]}function compareWithLastPosition(e){const t=getCurrentTextTransform();let a=t[4],r=t[5];if(M.font?.vertical){if(a<c[0]||a>c[2]||r+e<c[1]||r>c[3])return!1}else if(a+e<c[0]||a>c[2]||r<c[1]||r>c[3])return!1;if(!M.font||!y.prevTransform)return!0;let i=y.prevTransform[4],n=y.prevTransform[5];if(i===a&&n===r)return!0;let s=-1;t[0]&&0===t[1]&&0===t[2]?s=t[0]>0?0:180:t[1]&&0===t[0]&&0===t[3]&&(s=t[1]>0?90:270);switch(s){case 0:break;case 90:[a,r]=[r,a];[i,n]=[n,i];break;case 180:[a,r,i,n]=[-a,-r,-i,-n];break;case 270:[a,r]=[-r,-a];[i,n]=[-n,-i];break;default:[a,r]=applyInverseRotation(a,r,t);[i,n]=applyInverseRotation(i,n,y.prevTransform)}if(M.font.vertical){const e=(n-r)/y.textAdvanceScale,t=a-i,s=Math.sign(y.height);if(e<s*y.negativeSpaceMax){if(Math.abs(t)>.5*y.width){appendEOL();return!0}resetLastChars();flushTextContentItem();return!0}if(Math.abs(t)>y.width){appendEOL();return!0}e<=s*y.notASpace&&resetLastChars();if(e<=s*y.trackingSpaceMin)if(shouldAddWhitepsace()){resetLastChars();flushTextContentItem();pushWhitespace({height:Math.abs(e)})}else y.height+=e;else if(!addFakeSpaces(e,y.prevTransform,s))if(0===y.str.length){resetLastChars();pushWhitespace({height:Math.abs(e)})}else y.height+=e;Math.abs(t)>.25*y.width&&flushTextContentItem();return!0}const o=(a-i)/y.textAdvanceScale,l=r-n,h=Math.sign(y.width);if(o<h*y.negativeSpaceMax){if(Math.abs(l)>.5*y.height){appendEOL();return!0}resetLastChars();flushTextContentItem();return!0}if(Math.abs(l)>y.height){appendEOL();return!0}o<=h*y.notASpace&&resetLastChars();if(o<=h*y.trackingSpaceMin)if(shouldAddWhitepsace()){resetLastChars();flushTextContentItem();pushWhitespace({width:Math.abs(o)})}else y.width+=o;else if(!addFakeSpaces(o,y.prevTransform,h))if(0===y.str.length){resetLastChars();pushWhitespace({width:Math.abs(o)})}else y.width+=o;Math.abs(l)>.25*y.height&&flushTextContentItem();return!0}function buildTextContentItem({chars:e,extraSpacing:t}){const a=M.font;if(!e){const e=M.charSpacing+t;e&&(a.vertical?M.translateTextMatrix(0,-e):M.translateTextMatrix(e*M.textHScale,0));d&&compareWithLastPosition(0);return}const r=a.charsToGlyphs(e),i=M.fontMatrix[0]*M.fontSize;for(let e=0,n=r.length;e<n;e++){const s=r[e],{category:o}=s;if(o.isInvisibleFormatMark)continue;let c=M.charSpacing+(e+1===n?t:0),l=s.width;a.vertical&&(l=s.vmetric?s.vmetric[0]:-l);let h=l*i;if(!d&&o.isWhitespace){if(a.vertical){c+=-h+M.wordSpacing;M.translateTextMatrix(0,-c)}else{c+=h+M.wordSpacing;M.translateTextMatrix(c*M.textHScale,0)}saveLastChar(" ");continue}if(!o.isZeroWidthDiacritic&&!compareWithLastPosition(h)){a.vertical?M.translateTextMatrix(0,h):M.translateTextMatrix(h*M.textHScale,0);continue}const u=ensureTextContentItem();o.isZeroWidthDiacritic&&(h=0);if(a.vertical){g?.addGlyph(getCurrentTextTransform(),0,h,s.unicode);M.translateTextMatrix(0,h);h=Math.abs(h);u.height+=h}else{h*=M.textHScale;g?.addGlyph(getCurrentTextTransform(),h,0,s.unicode);M.translateTextMatrix(h,0);u.width+=h}h&&(u.prevTransform=getCurrentTextTransform());const f=s.unicode;if(saveLastChar(f)){u.str.push(" ");g?.addExtraChar(" ")}g||u.str.push(f);c&&(a.vertical?M.translateTextMatrix(0,-c):M.translateTextMatrix(c*M.textHScale,0))}}function appendEOL(){g?.addExtraChar("\\n");resetLastChars();if(y.initialized){y.hasEOL=!0;flushTextContentItem()}else b.items.push({str:"",dir:"ltr",width:0,height:0,transform:getCurrentTextTransform(),fontName:M.loadedName,hasEOL:!0})}function addFakeSpaces(e,t,a){if(a*y.spaceInFlowMin<=e&&e<=a*y.spaceInFlowMax){if(y.initialized){resetLastChars();y.str.push(" ");g?.addExtraChar(" ")}return!1}const r=y.fontName;let i=0;if(y.vertical){i=e;e=0}flushTextContentItem();resetLastChars();pushWhitespace({width:Math.abs(e),height:Math.abs(i),transform:t||getCurrentTextTransform(),fontName:r});return!0}function flushTextContentItem(){if(y.initialized&&y.str){y.vertical?y.totalHeight+=y.height*y.textAdvanceScale:y.totalWidth+=y.width*y.textAdvanceScale;b.items.push(runBidiTransform(y));y.initialized=!1;y.str.length=0}}function enqueueChunk(e=!1){const t=b.items.length;if(0!==t&&!(e&&t<10)){s?.enqueue(b,t);b.items=[];b.styles=Object.create(null)}}const D=new TimeSlotManager;return new Promise((function promiseBody(e,t){const next=function(a){enqueueChunk(!0);Promise.all([a,s?.ready]).then((function(){try{promiseBody(e,t)}catch(e){t(e)}}),t)};a.ensureNotTerminated();D.reset();const f={};let g,p,y,w=[];for(;!(g=D.check());){w.length=0;f.args=w;if(!O.read(f))break;const e=M;M=i.state;const t=f.fn;w=f.args;switch(0|t){case nt:const t=w[0].name,f=w[1];if(M.font&&t===M.fontName&&f===M.fontSize)break;flushTextContentItem();M.fontName=t;M.fontSize=f;next(handleSetFont(t,null));return;case ot:M.textRise=w[0];break;case rt:M.textHScale=w[0]/100;break;case it:M.leading=w[0];break;case ct:M.translateTextLineMatrix(w[0],w[1]);M.textMatrix=M.textLineMatrix.slice();break;case lt:M.leading=-w[1];M.translateTextLineMatrix(w[0],w[1]);M.textMatrix=M.textLineMatrix.slice();break;case ut:M.carriageReturn();break;case ht:M.setTextMatrix(w[0],w[1],w[2],w[3],w[4],w[5]);M.setTextLineMatrix(w[0],w[1],w[2],w[3],w[4],w[5]);updateAdvanceScale();break;case tt:M.charSpacing=w[0];break;case at:M.wordSpacing=w[0];break;case Qe:M.textMatrix=Fa.slice();M.textLineMatrix=Fa.slice();break;case ft:if(!i.state.font){S.ensureStateFont(i.state);continue}const g=(M.font.vertical?1:-1)*M.fontSize/1e3,x=w[0];for(let e=0,t=x.length;e<t;e++){const t=x[e];if("string"==typeof t)C.push(t);else if("number"==typeof t&&0!==t){const e=C.join("");C.length=0;buildTextContentItem({chars:e,extraSpacing:t*g})}}if(C.length>0){const e=C.join("");C.length=0;buildTextContentItem({chars:e,extraSpacing:0})}break;case dt:if(!i.state.font){S.ensureStateFont(i.state);continue}buildTextContentItem({chars:w[0],extraSpacing:0});break;case gt:if(!i.state.font){S.ensureStateFont(i.state);continue}M.carriageReturn();buildTextContentItem({chars:w[0],extraSpacing:0});break;case pt:if(!i.state.font){S.ensureStateFont(i.state);continue}M.wordSpacing=w[0];M.charSpacing=w[1];M.carriageReturn();buildTextContentItem({chars:w[2],extraSpacing:0});break;case Nt:flushTextContentItem();v??=r.get("XObject")||Dict.empty;y=w[0]instanceof Name;p=w[0].name;if(y&&F.getByName(p))break;next(new Promise((function(e,t){if(!y)throw new FormatError("XObject must be referred to by name.");let f=v.getRaw(p);if(f instanceof Ref){if(F.getByRef(f)){e();return}if(S.globalImageCache.getData(f,S.pageIndex)){e();return}f=k.fetch(f)}if(!(f instanceof BaseStream))throw new FormatError("XObject should be a stream");const{dict:g}=f,b=g.get("Subtype");if(!(b instanceof Name))throw new FormatError("XObject should have a Name subtype");if("Form"!==b.name){F.set(p,g.objId,!0);e();return}const w=i.state.clone(),x=new StateManager(w),C=lookupMatrix(g.getArray("Matrix"),null);C&&x.transform(C);const T=g.get("Resources");enqueueChunk();const O={enqueueInvoked:!1,enqueue(e,t){this.enqueueInvoked=!0;s.enqueue(e,t)},get desiredSize(){return s.desiredSize??0},get ready(){return s.ready}};S.getTextContent({stream:f,task:a,resources:T instanceof Dict?T:r,stateManager:x,includeMarkedContent:n,sink:s&&O,seenStyles:o,viewBox:c,lang:l,markedContentData:h,disableNormalization:u,keepWhiteSpace:d,prevRefs:m}).then((function(){O.enqueueInvoked||F.set(p,g.objId,!0);e()}),t)})).catch((function(e){if(!(e instanceof AbortException)){if(!S.options.ignoreErrors)throw e;warn(`getTextContent - ignoring XObject: "${e}".`)}})));return;case De:y=w[0]instanceof Name;p=w[0].name;if(y&&T.getByName(p))break;next(new Promise((function(e,t){if(!y)throw new FormatError("GState must be referred to by name.");const a=r.get("ExtGState");if(!(a instanceof Dict))throw new FormatError("ExtGState should be a dictionary.");const i=a.get(p);if(!(i instanceof Dict))throw new FormatError("GState should be a dictionary.");const n=i.get("Font");if(n){flushTextContentItem();M.fontName=null;M.fontSize=n[1];handleSetFont(null,n[0]).then(e,t)}else{T.set(p,i.objId,!0);e()}})).catch((function(e){if(!(e instanceof AbortException)){if(!S.options.ignoreErrors)throw e;warn(`getTextContent - ignoring ExtGState: "${e}".`)}})));return;case Lt:flushTextContentItem();if(n){h.level++;b.items.push({type:"beginMarkedContent",tag:w[0]instanceof Name?w[0].name:null})}break;case jt:flushTextContentItem();if(n){h.level++;let e=null;w[1]instanceof Dict&&(e=w[1].get("MCID"));b.items.push({type:"beginMarkedContentProps",id:Number.isInteger(e)?`${S.idFactory.getPageObjId()}_mc${e}`:null,tag:w[0]instanceof Name?w[0].name:null})}break;case _t:flushTextContentItem();if(n){if(0===h.level)break;h.level--;b.items.push({type:"endMarkedContent"})}break;case Re:!e||e.font===M.font&&e.fontSize===M.fontSize&&e.fontName===M.fontName||flushTextContentItem()}if(b.items.length>=(s?.desiredSize??1)){g=!0;break}}if(g)next(En);else{flushTextContentItem();enqueueChunk();e()}})).catch((e=>{if(!(e instanceof AbortException)){if(!this.options.ignoreErrors)throw e;warn(`getTextContent - ignoring errors during "${a.name}" task: "${e}".`);flushTextContentItem();enqueueChunk()}}))}async extractDataStructures(e,t){const a=this.xref;let r;const i=this.readToUnicode(t.toUnicode);if(t.composite){const a=e.get("CIDSystemInfo");a instanceof Dict&&(t.cidSystemInfo={registry:stringToPDFString(a.get("Registry")),ordering:stringToPDFString(a.get("Ordering")),supplement:a.get("Supplement")});try{const t=e.get("CIDToGIDMap");t instanceof BaseStream&&(r=t.getBytes())}catch(e){if(!this.options.ignoreErrors)throw e;warn(`extractDataStructures - ignoring CIDToGIDMap data: "${e}".`)}}const n=[];let s,o=null;if(e.has("Encoding")){s=e.get("Encoding");if(s instanceof Dict){o=s.get("BaseEncoding");o=o instanceof Name?o.name:null;if(s.has("Differences")){const e=s.get("Differences");let t=0;for(const r of e){const e=a.fetchIfRef(r);if("number"==typeof e)t=e;else{if(!(e instanceof Name))throw new FormatError(`Invalid entry in \'Differences\' array: ${e}`);n[t++]=e.name}}}}else if(s instanceof Name)o=s.name;else{const e="Encoding is not a Name nor a Dict";if(!this.options.ignoreErrors)throw new FormatError(e);warn(e)}"MacRomanEncoding"!==o&&"MacExpertEncoding"!==o&&"WinAnsiEncoding"!==o&&(o=null)}const c=!t.file||t.isInternalFont,l=ei()[t.name];o&&c&&l&&(o=null);if(o)t.defaultEncoding=getEncoding(o);else{const e=!!(t.flags&Pr),a=!!(t.flags&Lr);s=Ar;"TrueType"!==t.type||a||(s=kr);if(e||l){s=Sr;c&&(/Symbol/i.test(t.name)?s=Cr:/Dingbats/i.test(t.name)?s=vr:/Wingdings/i.test(t.name)&&(s=kr))}t.defaultEncoding=s}t.differences=n;t.baseEncodingName=o;t.hasEncoding=!!o||n.length>0;t.dict=e;t.toUnicode=await i;const h=await this.buildToUnicode(t);t.toUnicode=h;r&&(t.cidToGidMap=this.readCidToGidMap(r,h));return t}_simpleFontToUnicode(e,t=!1){assert(!e.composite,"Must be a simple font.");const a=[],r=e.defaultEncoding.slice(),i=e.baseEncodingName,n=e.differences;for(const e in n){const t=n[e];".notdef"!==t&&(r[e]=t)}const s=Fr();for(const n in r){let o=r[n];if(""===o)continue;let c=s[o];if(void 0!==c){a[n]=String.fromCharCode(c);continue}let l=0;switch(o[0]){case"G":3===o.length&&(l=parseInt(o.substring(1),16));break;case"g":5===o.length&&(l=parseInt(o.substring(1),16));break;case"C":case"c":if(o.length>=3&&o.length<=4){const a=o.substring(1);if(t){l=parseInt(a,16);break}l=+a;if(Number.isNaN(l)&&Number.isInteger(parseInt(a,16)))return this._simpleFontToUnicode(e,!0)}break;case"u":c=getUnicodeForGlyph(o,s);-1!==c&&(l=c);break;default:switch(o){case"f_h":case"f_t":case"T_h":a[n]=o.replaceAll("_","");continue}}if(l>0&&l<=1114111&&Number.isInteger(l)){if(i&&l===+n){const e=getEncoding(i);if(e&&(o=e[n])){a[n]=String.fromCharCode(s[o]);continue}}a[n]=String.fromCodePoint(l)}}return a}async buildToUnicode(e){e.hasIncludedToUnicodeMap=e.toUnicode?.length>0;if(e.hasIncludedToUnicodeMap){!e.composite&&e.hasEncoding&&(e.fallbackToUnicode=this._simpleFontToUnicode(e));return e.toUnicode}if(!e.composite)return new ToUnicodeMap(this._simpleFontToUnicode(e));if(e.composite&&(e.cMap.builtInCMap&&!(e.cMap instanceof IdentityCMap)||"Adobe"===e.cidSystemInfo?.registry&&("GB1"===e.cidSystemInfo.ordering||"CNS1"===e.cidSystemInfo.ordering||"Japan1"===e.cidSystemInfo.ordering||"Korea1"===e.cidSystemInfo.ordering))){const{registry:t,ordering:a}=e.cidSystemInfo,r=Name.get(`${t}-${a}-UCS2`),i=await CMapFactory.create({encoding:r,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),n=[],s=[];e.cMap.forEach((function(e,t){if(t>65535)throw new FormatError("Max size of CID is 65,535");const a=i.lookup(t);if(a){s.length=0;for(let e=0,t=a.length;e<t;e+=2)s.push((a.charCodeAt(e)<<8)+a.charCodeAt(e+1));n[e]=String.fromCharCode(...s)}}));return new ToUnicodeMap(n)}return new IdentityToUnicodeMap(e.firstChar,e.lastChar)}async readToUnicode(e){if(!e)return null;if(e instanceof Name){const t=await CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});return t instanceof IdentityCMap?new IdentityToUnicodeMap(0,65535):new ToUnicodeMap(t.getMap())}if(e instanceof BaseStream)try{const t=await CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});if(t instanceof IdentityCMap)return new IdentityToUnicodeMap(0,65535);const a=new Array(t.length);t.forEach((function(e,t){if("number"==typeof t){a[e]=String.fromCodePoint(t);return}t.length%2!=0&&(t="\\0"+t);const r=[];for(let e=0;e<t.length;e+=2){const a=t.charCodeAt(e)<<8|t.charCodeAt(e+1);if(55296!=(63488&a)){r.push(a);continue}e+=2;const i=t.charCodeAt(e)<<8|t.charCodeAt(e+1);r.push(((1023&a)<<10)+(1023&i)+65536)}a[e]=String.fromCodePoint(...r)}));return new ToUnicodeMap(a)}catch(e){if(e instanceof AbortException)return null;if(this.options.ignoreErrors){warn(`readToUnicode - ignoring ToUnicode data: "${e}".`);return null}throw e}return null}readCidToGidMap(e,t){const a=[];for(let r=0,i=e.length;r<i;r++){const i=e[r++]<<8|e[r],n=r>>1;(0!==i||t.has(n))&&(a[n]=i)}return a}extractWidths(e,t,a){const r=this.xref;let i=[],n=0;const s=[];let o;if(a.composite){const t=e.get("DW");n="number"==typeof t?Math.ceil(t):1e3;const c=e.get("W");if(Array.isArray(c))for(let e=0,t=c.length;e<t;e++){let t=r.fetchIfRef(c[e++]);if(!Number.isInteger(t))break;const a=r.fetchIfRef(c[e]);if(Array.isArray(a))for(const e of a){const a=r.fetchIfRef(e);"number"==typeof a&&(i[t]=a);t++}else{if(!Number.isInteger(a))break;{const n=r.fetchIfRef(c[++e]);if("number"!=typeof n)continue;for(let e=t;e<=a;e++)i[e]=n}}}if(a.vertical){const t=e.getArray("DW2");let a=isNumberArray(t,2)?t:[880,-1e3];o=[a[1],.5*n,a[0]];a=e.get("W2");if(Array.isArray(a))for(let e=0,t=a.length;e<t;e++){let t=r.fetchIfRef(a[e++]);if(!Number.isInteger(t))break;const i=r.fetchIfRef(a[e]);if(Array.isArray(i))for(let e=0,a=i.length;e<a;e++){const a=[r.fetchIfRef(i[e++]),r.fetchIfRef(i[e++]),r.fetchIfRef(i[e])];isNumberArray(a,null)&&(s[t]=a);t++}else{if(!Number.isInteger(i))break;{const n=[r.fetchIfRef(a[++e]),r.fetchIfRef(a[++e]),r.fetchIfRef(a[++e])];if(!isNumberArray(n,null))continue;for(let e=t;e<=i;e++)s[e]=n}}}}}else{const s=e.get("Widths");if(Array.isArray(s)){let e=a.firstChar;for(const t of s){const a=r.fetchIfRef(t);"number"==typeof a&&(i[e]=a);e++}const o=t.get("MissingWidth");n="number"==typeof o?o:0}else{const t=e.get("BaseFont");if(t instanceof Name){const e=this.getBaseFontMetrics(t.name);i=this.buildCharCodeToWidth(e.widths,a);n=e.defaultWidth}}}let c=!0,l=n;for(const e in i){const t=i[e];if(t)if(l){if(l!==t){c=!1;break}}else l=t}c?a.flags|=Nr:a.flags&=~Nr;a.defaultWidth=n;a.widths=i;a.defaultVMetrics=o;a.vmetrics=s}isSerifFont(e){const t=e.split("-",1)[0];return t in Qr()||/serif/gi.test(t)}getBaseFontMetrics(e){let t=0,a=Object.create(null),r=!1;let i=Jr()[e]||e;const n=ii();i in n||(i=this.isSerifFont(e)?"Times-Roman":"Helvetica");const s=n[i];if("number"==typeof s){t=s;r=!0}else a=s();return{defaultWidth:t,monospace:r,widths:a}}buildCharCodeToWidth(e,t){const a=Object.create(null),r=t.differences,i=t.defaultEncoding;for(let t=0;t<256;t++)t in r&&e[r[t]]?a[t]=e[r[t]]:t in i&&e[i[t]]&&(a[t]=e[i[t]]);return a}preEvaluateFont(e){const t=e;let a=e.get("Subtype");if(!(a instanceof Name))throw new FormatError("invalid font Subtype");let r,i=!1;if("Type0"===a.name){const t=e.get("DescendantFonts");if(!t)throw new FormatError("Descendant fonts are not specified");if(!((e=Array.isArray(t)?this.xref.fetchIfRef(t[0]):t)instanceof Dict))throw new FormatError("Descendant font is not a dictionary.");a=e.get("Subtype");if(!(a instanceof Name))throw new FormatError("invalid font Subtype");i=!0}let n=e.get("FirstChar");Number.isInteger(n)||(n=0);let s=e.get("LastChar");Number.isInteger(s)||(s=i?65535:255);const o=e.get("FontDescriptor"),c=e.get("ToUnicode")||t.get("ToUnicode");if(o){r=new MurmurHash3_64;const a=t.getRaw("Encoding");if(a instanceof Name)r.update(a.name);else if(a instanceof Ref)r.update(a.toString());else if(a instanceof Dict)for(const e of a.getRawValues())if(e instanceof Name)r.update(e.name);else if(e instanceof Ref)r.update(e.toString());else if(Array.isArray(e)){const t=e.length,a=new Array(t);for(let r=0;r<t;r++){const t=e[r];t instanceof Name?a[r]=t.name:("number"==typeof t||t instanceof Ref)&&(a[r]=t.toString())}r.update(a.join())}r.update(`${n}-${s}`);if(c instanceof BaseStream){const e=c.str||c,t=e.buffer?new Uint8Array(e.buffer.buffer,0,e.bufferLength):new Uint8Array(e.bytes.buffer,e.start,e.end-e.start);r.update(t)}else c instanceof Name&&r.update(c.name);const o=e.get("Widths")||t.get("Widths");if(Array.isArray(o)){const e=[];for(const t of o)("number"==typeof t||t instanceof Ref)&&e.push(t.toString());r.update(e.join())}if(i){r.update("compositeFont");const a=e.get("W")||t.get("W");if(Array.isArray(a)){const e=[];for(const t of a)if("number"==typeof t||t instanceof Ref)e.push(t.toString());else if(Array.isArray(t)){const a=[];for(const e of t)("number"==typeof e||e instanceof Ref)&&a.push(e.toString());e.push(`[${a.join()}]`)}r.update(e.join())}const i=e.getRaw("CIDToGIDMap")||t.getRaw("CIDToGIDMap");i instanceof Name?r.update(i.name):i instanceof Ref?r.update(i.toString()):i instanceof BaseStream&&r.update(i.peekBytes())}}return{descriptor:o,dict:e,baseDict:t,composite:i,type:a.name,firstChar:n,lastChar:s,toUnicode:c,hash:r?r.hexdigest():""}}async translateFont({descriptor:e,dict:a,baseDict:r,composite:i,type:n,firstChar:s,lastChar:o,toUnicode:c,cssFontInfo:l}){const h="Type3"===n;if(!e){if(!h){let e=a.get("BaseFont");if(!(e instanceof Name))throw new FormatError("Base font is not specified");e=e.name.replaceAll(/[,_]/g,"-");const t=this.getBaseFontMetrics(e),i=e.split("-",1)[0],l=(this.isSerifFont(i)?Er:0)|(t.monospace?Nr:0)|(ei()[i]?Pr:Lr),u={type:n,name:e,loadedName:r.loadedName,systemFontInfo:null,widths:t.widths,defaultWidth:t.defaultWidth,isSimulatedFlags:!0,flags:l,firstChar:s,lastChar:o,toUnicode:c,xHeight:0,capHeight:0,italicAngle:0,isType3Font:h},d=a.get("Widths"),f=getStandardFontName(e);let g=null;if(f){g=await this.fetchStandardFontData(f);u.isInternalFont=!!g}!u.isInternalFont&&this.options.useSystemFonts&&(u.systemFontInfo=getFontSubstitution(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,e,f,n));const p=await this.extractDataStructures(a,u);if(Array.isArray(d)){const e=[];let t=s;for(const a of d){const r=this.xref.fetchIfRef(a);"number"==typeof r&&(e[t]=r);t++}p.widths=e}else p.widths=this.buildCharCodeToWidth(t.widths,p);return new Font(e,g,p,this.options)}e=Dict.empty}let u=e.get("FontName"),d=a.get("BaseFont");"string"==typeof u&&(u=Name.get(u));"string"==typeof d&&(d=Name.get(d));const f=u?.name,g=d?.name;if(h)f||(u=Name.get(n));else if(f!==g){info(`The FontDescriptor\'s FontName is "${f}" but should be the same as the Font\'s BaseFont "${g}".`);f&&g&&(g.startsWith(f)||!isKnownFontName(f)&&isKnownFontName(g))&&(u=null);u||=d}if(!(u instanceof Name))throw new FormatError("invalid font name");let p,m,b,y,w;try{p=e.get("FontFile","FontFile2","FontFile3");if(p){if(!(p instanceof BaseStream))throw new FormatError("FontFile should be a stream");if(p.isEmpty)throw new FormatError("FontFile is empty")}}catch(e){if(!this.options.ignoreErrors)throw e;warn(`translateFont - fetching "${u.name}" font file: "${e}".`);p=null}let x=!1,S=null,k=null;if(p){if(p.dict){const e=p.dict.get("Subtype");e instanceof Name&&(m=e.name);b=p.dict.get("Length1");y=p.dict.get("Length2");w=p.dict.get("Length3")}}else if(l){const e=getXfaFontName(u.name);if(e){l.fontFamily=`${l.fontFamily}-PdfJS-XFA`;l.metrics=e.metrics||null;S=e.factors||null;p=await this.fetchStandardFontData(e.name);x=!!p;r=a=getXfaFontDict(u.name);i=!0}}else if(!h){const e=getStandardFontName(u.name);if(e){p=await this.fetchStandardFontData(e);x=!!p}!x&&this.options.useSystemFonts&&(k=getFontSubstitution(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,u.name,e,n))}const C=lookupMatrix(a.getArray("FontMatrix"),t),v=lookupNormalRect(e.getArray("FontBBox")||a.getArray("FontBBox"),h?[0,0,0,0]:void 0);let F=e.get("Ascent");"number"!=typeof F&&(F=void 0);let T=e.get("Descent");"number"!=typeof T&&(T=void 0);let O=e.get("XHeight");"number"!=typeof O&&(O=0);let M=e.get("CapHeight");"number"!=typeof M&&(M=0);let D=e.get("Flags");Number.isInteger(D)||(D=0);let R=e.get("ItalicAngle");"number"!=typeof R&&(R=0);const N={type:n,name:u.name,subtype:m,file:p,length1:b,length2:y,length3:w,isInternalFont:x,loadedName:r.loadedName,composite:i,fixedPitch:!1,fontMatrix:C,firstChar:s,lastChar:o,toUnicode:c,bbox:v,ascent:F,descent:T,xHeight:O,capHeight:M,flags:D,italicAngle:R,isType3Font:h,cssFontInfo:l,scaleFactors:S,systemFontInfo:k};if(i){const e=r.get("Encoding");e instanceof Name&&(N.cidEncoding=e.name);const t=await CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});N.cMap=t;N.vertical=N.cMap.vertical}const E=await this.extractDataStructures(a,N);this.extractWidths(a,e,E);return new Font(u.name,p,E,this.options)}static buildFontPaths(e,t,a,r){function buildPath(t){const i=`${e.loadedName}_path_${t}`;try{if(e.renderer.hasBuiltPath(t))return;a.send("commonobj",[i,"FontPath",e.renderer.getPathJs(t)])}catch(e){if(r.ignoreErrors){warn(`buildFontPaths - ignoring ${i} glyph: "${e}".`);return}throw e}}for(const e of t){buildPath(e.fontChar);const t=e.accent;t?.fontChar&&buildPath(t.fontChar)}}static get fallbackFontDict(){const e=new Dict;e.set("BaseFont",Name.get("Helvetica"));e.set("Type",Name.get("FallbackType"));e.set("Subtype",Name.get("FallbackType"));e.set("Encoding",Name.get("WinAnsiEncoding"));return shadow(this,"fallbackFontDict",e)}}class TranslatedFont{#G=!1;#V=null;constructor({loadedName:e,font:t,dict:a}){this.loadedName=e;this.font=t;this.dict=a;this.type3Dependencies=t.isType3Font?new Set:null}send(e){if(!this.#G){this.#G=!0;e.send("commonobj",[this.loadedName,"Font",this.font.exportData()])}}fallback(e,t){if(this.font.data){this.font.disableFontFace=!0;PartialEvaluator.buildFontPaths(this.font,this.font.glyphCacheValues,e,t)}}loadType3Data(e,t,a){if(this.#V)return this.#V;const{font:r,type3Dependencies:i}=this;assert(r.isType3Font,"Must be a Type3 font.");const n=e.clone({ignoreErrors:!1}),s=new RefSet(e.type3FontRefs);this.dict.objId&&!s.has(this.dict.objId)&&s.put(this.dict.objId);n.type3FontRefs=s;let o=Promise.resolve();const c=this.dict.get("CharProcs"),l=this.dict.get("Resources")||t,h=Object.create(null),[u,d,f,g]=r.bbox,p=f-u,m=g-d,b=Math.hypot(p,m);for(const e of c.getKeys())o=o.then((()=>{const t=c.get(e),r=new OperatorList;return n.getOperatorList({stream:t,task:a,resources:l,operatorList:r}).then((()=>{switch(r.fnArray[0]){case bt:this.#K(r,b);break;case mt:b||this.#J(r)}h[e]=r.getIR();for(const e of r.dependencies)i.add(e)})).catch((function(t){warn(`Type3 font resource "${e}" is not available.`);const a=new OperatorList;h[e]=a.getIR()}))}));this.#V=o.then((()=>{r.charProcOperatorList=h;if(this._bbox){r.isCharBBox=!0;r.bbox=this._bbox}}));return this.#V}#K(e,t=NaN){const a=Util.normalizeRect(e.argsArray[0].slice(2)),r=a[2]-a[0],i=a[3]-a[1],n=Math.hypot(r,i);if(0===r||0===i){e.fnArray.splice(0,1);e.argsArray.splice(0,1)}else if(0===t||Math.round(n/t)>=10){this._bbox??=[1/0,1/0,-1/0,-1/0];Util.rectBoundingBox(...a,this._bbox)}let s=0,o=e.length;for(;s<o;){switch(e.fnArray[s]){case bt:break;case yt:case wt:case xt:case St:case At:case kt:case Ct:case vt:case Ft:case It:case Tt:case Ot:case Mt:case Oe:e.fnArray.splice(s,1);e.argsArray.splice(s,1);o--;continue;case De:const[t]=e.argsArray[s];let a=0,r=t.length;for(;a<r;){const[e]=t[a];switch(e){case"TR":case"TR2":case"HT":case"BG":case"BG2":case"UCR":case"UCR2":t.splice(a,1);r--;continue}a++}}s++}}#J(e){let t=1;const a=e.length;for(;t<a;){if(e.fnArray[t]===aa){const a=e.argsArray[t][2];this._bbox??=[1/0,1/0,-1/0,-1/0];Util.rectBoundingBox(...a,this._bbox)}t++}}}class StateManager{constructor(e=new EvalState){this.state=e;this.stateStack=[]}save(){const e=this.state;this.stateStack.push(this.state);this.state=e.clone()}restore(){const e=this.stateStack.pop();e&&(this.state=e)}transform(e){this.state.ctm=Util.transform(this.state.ctm,e)}}class TextState{constructor(){this.ctm=new Float32Array(Fa);this.fontName=null;this.fontSize=0;this.loadedName=null;this.font=null;this.fontMatrix=t;this.textMatrix=Fa.slice();this.textLineMatrix=Fa.slice();this.charSpacing=0;this.wordSpacing=0;this.leading=0;this.textHScale=1;this.textRise=0}setTextMatrix(e,t,a,r,i,n){const s=this.textMatrix;s[0]=e;s[1]=t;s[2]=a;s[3]=r;s[4]=i;s[5]=n}setTextLineMatrix(e,t,a,r,i,n){const s=this.textLineMatrix;s[0]=e;s[1]=t;s[2]=a;s[3]=r;s[4]=i;s[5]=n}translateTextMatrix(e,t){const a=this.textMatrix;a[4]=a[0]*e+a[2]*t+a[4];a[5]=a[1]*e+a[3]*t+a[5]}translateTextLineMatrix(e,t){const a=this.textLineMatrix;a[4]=a[0]*e+a[2]*t+a[4];a[5]=a[1]*e+a[3]*t+a[5]}carriageReturn(){this.translateTextLineMatrix(0,-this.leading);this.textMatrix=this.textLineMatrix.slice()}clone(){const e=Object.create(this);e.textMatrix=this.textMatrix.slice();e.textLineMatrix=this.textLineMatrix.slice();e.fontMatrix=this.fontMatrix.slice();return e}}class EvalState{constructor(){this.ctm=new Float32Array(Fa);this.font=null;this.textRenderingMode=x;this._fillColorSpace=this._strokeColorSpace=ColorSpaceUtils.gray;this.patternFillColorSpace=null;this.patternStrokeColorSpace=null;this.currentPointX=this.currentPointY=0;this.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0]);this.pathBuffer=[]}get fillColorSpace(){return this._fillColorSpace}set fillColorSpace(e){this._fillColorSpace=this.patternFillColorSpace=e}get strokeColorSpace(){return this._strokeColorSpace}set strokeColorSpace(e){this._strokeColorSpace=this.patternStrokeColorSpace=e}clone({newPath:e=!1}={}){const t=Object.create(this);if(e){t.pathBuffer=[];t.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0])}return t}}class EvaluatorPreprocessor{static get opMap(){return shadow(this,"opMap",Object.assign(Object.create(null),{w:{id:Ce,numArgs:1,variableArgs:!1},J:{id:ve,numArgs:1,variableArgs:!1},j:{id:Fe,numArgs:1,variableArgs:!1},M:{id:Ie,numArgs:1,variableArgs:!1},d:{id:Te,numArgs:2,variableArgs:!1},ri:{id:Oe,numArgs:1,variableArgs:!1},i:{id:Me,numArgs:1,variableArgs:!1},gs:{id:De,numArgs:1,variableArgs:!1},q:{id:Be,numArgs:0,variableArgs:!1},Q:{id:Re,numArgs:0,variableArgs:!1},cm:{id:Ne,numArgs:6,variableArgs:!1},m:{id:Ee,numArgs:2,variableArgs:!1},l:{id:Pe,numArgs:2,variableArgs:!1},c:{id:Le,numArgs:6,variableArgs:!1},v:{id:je,numArgs:4,variableArgs:!1},y:{id:_e,numArgs:4,variableArgs:!1},h:{id:Ue,numArgs:0,variableArgs:!1},re:{id:Xe,numArgs:4,variableArgs:!1},S:{id:qe,numArgs:0,variableArgs:!1},s:{id:He,numArgs:0,variableArgs:!1},f:{id:We,numArgs:0,variableArgs:!1},F:{id:We,numArgs:0,variableArgs:!1},"f*":{id:ze,numArgs:0,variableArgs:!1},B:{id:$e,numArgs:0,variableArgs:!1},"B*":{id:Ge,numArgs:0,variableArgs:!1},b:{id:Ve,numArgs:0,variableArgs:!1},"b*":{id:Ke,numArgs:0,variableArgs:!1},n:{id:Je,numArgs:0,variableArgs:!1},W:{id:Ye,numArgs:0,variableArgs:!1},"W*":{id:Ze,numArgs:0,variableArgs:!1},BT:{id:Qe,numArgs:0,variableArgs:!1},ET:{id:et,numArgs:0,variableArgs:!1},Tc:{id:tt,numArgs:1,variableArgs:!1},Tw:{id:at,numArgs:1,variableArgs:!1},Tz:{id:rt,numArgs:1,variableArgs:!1},TL:{id:it,numArgs:1,variableArgs:!1},Tf:{id:nt,numArgs:2,variableArgs:!1},Tr:{id:st,numArgs:1,variableArgs:!1},Ts:{id:ot,numArgs:1,variableArgs:!1},Td:{id:ct,numArgs:2,variableArgs:!1},TD:{id:lt,numArgs:2,variableArgs:!1},Tm:{id:ht,numArgs:6,variableArgs:!1},"T*":{id:ut,numArgs:0,variableArgs:!1},Tj:{id:dt,numArgs:1,variableArgs:!1},TJ:{id:ft,numArgs:1,variableArgs:!1},"\'":{id:gt,numArgs:1,variableArgs:!1},\'"\':{id:pt,numArgs:3,variableArgs:!1},d0:{id:mt,numArgs:2,variableArgs:!1},d1:{id:bt,numArgs:6,variableArgs:!1},CS:{id:yt,numArgs:1,variableArgs:!1},cs:{id:wt,numArgs:1,variableArgs:!1},SC:{id:xt,numArgs:4,variableArgs:!0},SCN:{id:St,numArgs:33,variableArgs:!0},sc:{id:At,numArgs:4,variableArgs:!0},scn:{id:kt,numArgs:33,variableArgs:!0},G:{id:Ct,numArgs:1,variableArgs:!1},g:{id:vt,numArgs:1,variableArgs:!1},RG:{id:Ft,numArgs:3,variableArgs:!1},rg:{id:It,numArgs:3,variableArgs:!1},K:{id:Tt,numArgs:4,variableArgs:!1},k:{id:Ot,numArgs:4,variableArgs:!1},sh:{id:Mt,numArgs:1,variableArgs:!1},BI:{id:Dt,numArgs:0,variableArgs:!1},ID:{id:Bt,numArgs:0,variableArgs:!1},EI:{id:Rt,numArgs:1,variableArgs:!1},Do:{id:Nt,numArgs:1,variableArgs:!1},MP:{id:Et,numArgs:1,variableArgs:!1},DP:{id:Pt,numArgs:2,variableArgs:!1},BMC:{id:Lt,numArgs:1,variableArgs:!1},BDC:{id:jt,numArgs:2,variableArgs:!1},EMC:{id:_t,numArgs:0,variableArgs:!1},BX:{id:Ut,numArgs:0,variableArgs:!1},EX:{id:Xt,numArgs:0,variableArgs:!1},BM:null,BD:null,true:null,fa:null,fal:null,fals:null,false:null,nu:null,nul:null,null:null}))}static MAX_INVALID_PATH_OPS=10;constructor(e,t,a=new StateManager){this.parser=new Parser({lexer:new Lexer(e,EvaluatorPreprocessor.opMap),xref:t});this.stateManager=a;this.nonProcessedArgs=[];this._isPathOp=!1;this._numInvalidPathOPS=0}get savedStatesDepth(){return this.stateManager.stateStack.length}read(e){let t=e.args;for(;;){const a=this.parser.getObj();if(a instanceof Cmd){const r=a.cmd,i=EvaluatorPreprocessor.opMap[r];if(!i){warn(`Unknown command "${r}".`);continue}const n=i.id,s=i.numArgs;let o=null!==t?t.length:0;this._isPathOp||(this._numInvalidPathOPS=0);this._isPathOp=n>=Ee&&n<=Je;if(i.variableArgs)o>s&&info(`Command ${r}: expected [0, ${s}] args, but received ${o} args.`);else{if(o!==s){const e=this.nonProcessedArgs;for(;o>s;){e.push(t.shift());o--}for(;o<s&&0!==e.length;){null===t&&(t=[]);t.unshift(e.pop());o++}}if(o<s){const e=`command ${r}: expected ${s} args, but received ${o} args.`;if(this._isPathOp&&++this._numInvalidPathOPS>EvaluatorPreprocessor.MAX_INVALID_PATH_OPS)throw new FormatError(`Invalid ${e}`);warn(`Skipping ${e}`);null!==t&&(t.length=0);continue}}this.preprocessCommand(n,t);e.fn=n;e.args=t;return!0}if(a===wa)return!1;if(null!==a){null===t&&(t=[]);t.push(a);if(t.length>33)throw new FormatError("Too many arguments")}}}preprocessCommand(e,t){switch(0|e){case Be:this.stateManager.save();break;case Re:this.stateManager.restore();break;case Ne:this.stateManager.transform(t)}}}class DefaultAppearanceEvaluator extends EvaluatorPreprocessor{constructor(e){super(new StringStream(e))}parse(){const e={fn:0,args:[]},t={fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3)};try{for(;;){e.args.length=0;if(!this.read(e))break;if(0!==this.savedStatesDepth)continue;const{fn:a,args:r}=e;switch(0|a){case nt:const[e,a]=r;e instanceof Name&&(t.fontName=e.name);"number"==typeof a&&a>0&&(t.fontSize=a);break;case It:ColorSpaceUtils.rgb.getRgbItem(r,0,t.fontColor,0);break;case vt:ColorSpaceUtils.gray.getRgbItem(r,0,t.fontColor,0);break;case Ot:ColorSpaceUtils.cmyk.getRgbItem(r,0,t.fontColor,0)}}}catch(e){warn(`parseDefaultAppearance - ignoring errors: "${e}".`)}return t}}function parseDefaultAppearance(e){return new DefaultAppearanceEvaluator(e).parse()}class AppearanceStreamEvaluator extends EvaluatorPreprocessor{constructor(e,t,a,r){super(e);this.stream=e;this.evaluatorOptions=t;this.xref=a;this.globalColorSpaceCache=r;this.resources=e.dict?.get("Resources")}parse(){const e={fn:0,args:[]};let t={scaleFactor:1,fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3),fillColorSpace:ColorSpaceUtils.gray},a=!1;const r=[];try{for(;;){e.args.length=0;if(a||!this.read(e))break;const{fn:i,args:n}=e;switch(0|i){case Be:r.push({scaleFactor:t.scaleFactor,fontSize:t.fontSize,fontName:t.fontName,fontColor:t.fontColor.slice(),fillColorSpace:t.fillColorSpace});break;case Re:t=r.pop()||t;break;case ht:t.scaleFactor*=Math.hypot(n[0],n[1]);break;case nt:const[e,i]=n;e instanceof Name&&(t.fontName=e.name);"number"==typeof i&&i>0&&(t.fontSize=i*t.scaleFactor);break;case wt:t.fillColorSpace=ColorSpaceUtils.parse({cs:n[0],xref:this.xref,resources:this.resources,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:this._localColorSpaceCache});break;case At:t.fillColorSpace.getRgbItem(n,0,t.fontColor,0);break;case It:ColorSpaceUtils.rgb.getRgbItem(n,0,t.fontColor,0);break;case vt:ColorSpaceUtils.gray.getRgbItem(n,0,t.fontColor,0);break;case Ot:ColorSpaceUtils.cmyk.getRgbItem(n,0,t.fontColor,0);break;case dt:case ft:case gt:case pt:a=!0}}}catch(e){warn(`parseAppearanceStream - ignoring errors: "${e}".`)}this.stream.reset();delete t.scaleFactor;delete t.fillColorSpace;return t}get _localColorSpaceCache(){return shadow(this,"_localColorSpaceCache",new LocalColorSpaceCache)}get _pdfFunctionFactory(){return shadow(this,"_pdfFunctionFactory",new PDFFunctionFactory({xref:this.xref,isEvalSupported:this.evaluatorOptions.isEvalSupported}))}}function getPdfColor(e,t){if(e[0]===e[1]&&e[1]===e[2]){return`${numberToString(e[0]/255)} ${t?"g":"G"}`}return Array.from(e,(e=>numberToString(e/255))).join(" ")+" "+(t?"rg":"RG")}class FakeUnicodeFont{constructor(e,t){this.xref=e;this.widths=null;this.firstChar=1/0;this.lastChar=-1/0;this.fontFamily=t;const a=new OffscreenCanvas(1,1);this.ctxMeasure=a.getContext("2d",{willReadFrequently:!0});FakeUnicodeFont._fontNameId||(FakeUnicodeFont._fontNameId=1);this.fontName=Name.get(`InvalidPDFjsFont_${t}_${FakeUnicodeFont._fontNameId++}`)}get fontDescriptorRef(){if(!FakeUnicodeFont._fontDescriptorRef){const e=new Dict(this.xref);e.setIfName("Type","FontDescriptor");e.set("FontName",this.fontName);e.set("FontFamily","MyriadPro Regular");e.set("FontBBox",[0,0,0,0]);e.setIfName("FontStretch","Normal");e.set("FontWeight",400);e.set("ItalicAngle",0);FakeUnicodeFont._fontDescriptorRef=this.xref.getNewPersistentRef(e)}return FakeUnicodeFont._fontDescriptorRef}get descendantFontRef(){const e=new Dict(this.xref);e.set("BaseFont",this.fontName);e.setIfName("Type","Font");e.setIfName("Subtype","CIDFontType0");e.setIfName("CIDToGIDMap","Identity");e.set("FirstChar",this.firstChar);e.set("LastChar",this.lastChar);e.set("FontDescriptor",this.fontDescriptorRef);e.set("DW",1e3);const t=[],a=[...this.widths.entries()].sort();let r=null,i=null;for(const[e,n]of a)if(r)if(e===r+i.length)i.push(n);else{t.push(r,i);r=e;i=[n]}else{r=e;i=[n]}r&&t.push(r,i);e.set("W",t);const n=new Dict(this.xref);n.set("Ordering","Identity");n.set("Registry","Adobe");n.set("Supplement",0);e.set("CIDSystemInfo",n);return this.xref.getNewPersistentRef(e)}get baseFontRef(){const e=new Dict(this.xref);e.set("BaseFont",this.fontName);e.setIfName("Type","Font");e.setIfName("Subtype","Type0");e.setIfName("Encoding","Identity-H");e.set("DescendantFonts",[this.descendantFontRef]);e.setIfName("ToUnicode","Identity-H");return this.xref.getNewPersistentRef(e)}get resources(){const e=new Dict(this.xref),t=new Dict(this.xref);t.set(this.fontName.name,this.baseFontRef);e.set("Font",t);return e}_createContext(){this.widths=new Map;this.ctxMeasure.font=`1000px ${this.fontFamily}`;return this.ctxMeasure}createFontResources(e){const t=this._createContext();for(const a of e.split(/\\r\\n?|\\n/))for(const e of a.split("")){const a=e.charCodeAt(0);if(this.widths.has(a))continue;const r=t.measureText(e),i=Math.ceil(r.width);this.widths.set(a,i);this.firstChar=Math.min(a,this.firstChar);this.lastChar=Math.max(a,this.lastChar)}return this.resources}static getFirstPositionInfo(e,t,i){const[n,s,o,c]=e;let l=o-n,h=c-s;t%180!=0&&([l,h]=[h,l]);const u=a*i;return{coords:[0,h+r*i-u],bbox:[0,0,l,h],matrix:0!==t?getRotationMatrix(t,h,u):void 0}}createAppearance(e,t,i,n,s,o){const c=this._createContext(),l=[];let h=-1/0;for(const t of e.split(/\\r\\n?|\\n/)){l.push(t);const e=c.measureText(t).width;h=Math.max(h,e);for(const e of codePointIter(t)){const t=String.fromCodePoint(e);let a=this.widths.get(e);if(void 0===a){const r=c.measureText(t);a=Math.ceil(r.width);this.widths.set(e,a);this.firstChar=Math.min(e,this.firstChar);this.lastChar=Math.max(e,this.lastChar)}}}h*=n/1e3;const[u,d,f,g]=t;let p=f-u,m=g-d;i%180!=0&&([p,m]=[m,p]);let b=1;h>p&&(b=p/h);let y=1;const w=a*n,x=r*n,S=w*l.length;S>m&&(y=m/S);const k=n*Math.min(b,y),C=["q",`0 0 ${numberToString(p)} ${numberToString(m)} re W n`,"BT",`1 0 0 1 0 ${numberToString(m+x)} Tm 0 Tc ${getPdfColor(s,!0)}`,`/${this.fontName.name} ${numberToString(k)} Tf`],{resources:v}=this;if(1!==(o="number"==typeof o&&o>=0&&o<=1?o:1)){C.push("/R0 gs");const e=new Dict(this.xref),t=new Dict(this.xref);t.set("ca",o);t.set("CA",o);t.setIfName("Type","ExtGState");e.set("R0",t);v.set("ExtGState",e)}const F=numberToString(w);for(const e of l)C.push(`0 -${F} Td <${stringToUTF16HexString(e)}> Tj`);C.push("ET","Q");const T=C.join("\\n"),O=new Dict(this.xref);O.setIfName("Subtype","Form");O.setIfName("Type","XObject");O.set("BBox",[0,0,p,m]);O.set("Length",T.length);O.set("Resources",v);if(i){const e=getRotationMatrix(i,p,m);O.set("Matrix",e)}const M=new StringStream(T);M.dict=O;return M}}const Pn=["m/d","m/d/yy","mm/dd/yy","mm/yy","d-mmm","d-mmm-yy","dd-mmm-yy","yy-mm-dd","mmm-yy","mmmm-yy","mmm d, yyyy","mmmm d, yyyy","m/d/yy h:MM tt","m/d/yy HH:MM"],Ln=["HH:MM","h:MM tt","HH:MM:ss","h:MM:ss tt"];class NameOrNumberTree{constructor(e,t,a){this.root=e;this.xref=t;this._type=a}getAll(){const e=new Map;if(!this.root)return e;const t=this.xref,a=new RefSet;a.put(this.root);const r=[this.root];for(;r.length>0;){const i=t.fetchIfRef(r.shift());if(!(i instanceof Dict))continue;if(i.has("Kids")){const e=i.get("Kids");if(!Array.isArray(e))continue;for(const t of e){if(a.has(t))throw new FormatError(`Duplicate entry in "${this._type}" tree.`);r.push(t);a.put(t)}continue}const n=i.get(this._type);if(Array.isArray(n))for(let a=0,r=n.length;a<r;a+=2)e.set(t.fetchIfRef(n[a]),t.fetchIfRef(n[a+1]))}return e}getRaw(e){if(!this.root)return null;const t=this.xref;let a=t.fetchIfRef(this.root),r=0;for(;a.has("Kids");){if(++r>10){warn(`Search depth limit reached for "${this._type}" tree.`);return null}const i=a.get("Kids");if(!Array.isArray(i))return null;let n=0,s=i.length-1;for(;n<=s;){const r=n+s>>1,o=t.fetchIfRef(i[r]),c=o.get("Limits");if(e<t.fetchIfRef(c[0]))s=r-1;else{if(!(e>t.fetchIfRef(c[1]))){a=o;break}n=r+1}}if(n>s)return null}const i=a.get(this._type);if(Array.isArray(i)){let a=0,r=i.length-2;for(;a<=r;){const n=a+r>>1,s=n+(1&n),o=t.fetchIfRef(i[s]);if(e<o)r=s-2;else{if(!(e>o))return i[s+1];a=s+2}}}return null}get(e){return this.xref.fetchIfRef(this.getRaw(e))}}class NameTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Names")}}class NumberTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Nums")}}function clearGlobalCaches(){!function clearPatternCaches(){Ii=Object.create(null)}();!function clearPrimitiveCaches(){xa=Object.create(null);Sa=Object.create(null);Aa=Object.create(null)}();!function clearUnicodeCaches(){Dr.clear()}();JpxImage.cleanup()}function pickPlatformItem(e){return e instanceof Dict?e.has("UF")?e.get("UF"):e.has("F")?e.get("F"):e.has("Unix")?e.get("Unix"):e.has("Mac")?e.get("Mac"):e.has("DOS")?e.get("DOS"):null:null}class FileSpec{#Y=!1;constructor(e,t,a=!1){if(e instanceof Dict){this.xref=t;this.root=e;e.has("FS")&&(this.fs=e.get("FS"));e.has("RF")&&warn("Related file specifications are not supported");a||(e.has("EF")?this.#Y=!0:warn("Non-embedded file specifications are not supported"))}}get filename(){let e="";const t=pickPlatformItem(this.root);t&&"string"==typeof t&&(e=stringToPDFString(t,!0).replaceAll("\\\\\\\\","\\\\").replaceAll("\\\\/","/").replaceAll("\\\\","/"));return shadow(this,"filename",e||"unnamed")}get content(){if(!this.#Y)return null;this._contentRef||=pickPlatformItem(this.root?.get("EF"));let e=null;if(this._contentRef){const t=this.xref.fetchIfRef(this._contentRef);t instanceof BaseStream?e=t.getBytes():warn("Embedded file specification points to non-existing/invalid content")}else warn("Embedded file specification does not have any content");return e}get description(){let e="";const t=this.root?.get("Desc");t&&"string"==typeof t&&(e=stringToPDFString(t));return shadow(this,"description",e)}get serializable(){return{rawFilename:this.filename,filename:(e=this.filename,e.substring(e.lastIndexOf("/")+1)),content:this.content,description:this.description};var e}}const jn=0,_n=-2,Un=-3,Xn=-4,qn=-5,Hn=-6,Wn=-9;function isWhitespace(e,t){const a=e[t];return" "===a||"\\n"===a||"\\r"===a||"\\t"===a}class XMLParserBase{_resolveEntities(e){return e.replaceAll(/&([^;]+);/g,((e,t)=>{if("#x"===t.substring(0,2))return String.fromCodePoint(parseInt(t.substring(2),16));if("#"===t.substring(0,1))return String.fromCodePoint(parseInt(t.substring(1),10));switch(t){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return\'"\';case"apos":return"\'"}return this.onResolveEntity(t)}))}_parseContent(e,t){const a=[];let r=t;function skipWs(){for(;r<e.length&&isWhitespace(e,r);)++r}for(;r<e.length&&!isWhitespace(e,r)&&">"!==e[r]&&"/"!==e[r];)++r;const i=e.substring(t,r);skipWs();for(;r<e.length&&">"!==e[r]&&"/"!==e[r]&&"?"!==e[r];){skipWs();let t="",i="";for(;r<e.length&&!isWhitespace(e,r)&&"="!==e[r];){t+=e[r];++r}skipWs();if("="!==e[r])return null;++r;skipWs();const n=e[r];if(\'"\'!==n&&"\'"!==n)return null;const s=e.indexOf(n,++r);if(s<0)return null;i=e.substring(r,s);a.push({name:t,value:this._resolveEntities(i)});r=s+1;skipWs()}return{name:i,attributes:a,parsed:r-t}}_parseProcessingInstruction(e,t){let a=t;for(;a<e.length&&!isWhitespace(e,a)&&">"!==e[a]&&"?"!==e[a]&&"/"!==e[a];)++a;const r=e.substring(t,a);!function skipWs(){for(;a<e.length&&isWhitespace(e,a);)++a}();const i=a;for(;a<e.length&&("?"!==e[a]||">"!==e[a+1]);)++a;return{name:r,value:e.substring(i,a),parsed:a-t}}parseXml(e){let t=0;for(;t<e.length;){let a=t;if("<"===e[t]){++a;let t;switch(e[a]){case"/":++a;t=e.indexOf(">",a);if(t<0){this.onError(Wn);return}this.onEndElement(e.substring(a,t));a=t+1;break;case"?":++a;const r=this._parseProcessingInstruction(e,a);if("?>"!==e.substring(a+r.parsed,a+r.parsed+2)){this.onError(Un);return}this.onPi(r.name,r.value);a+=r.parsed+2;break;case"!":if("--"===e.substring(a+1,a+3)){t=e.indexOf("--\\x3e",a+3);if(t<0){this.onError(qn);return}this.onComment(e.substring(a+3,t));a=t+3}else if("[CDATA["===e.substring(a+1,a+8)){t=e.indexOf("]]>",a+8);if(t<0){this.onError(_n);return}this.onCdata(e.substring(a+8,t));a=t+3}else{if("DOCTYPE"!==e.substring(a+1,a+8)){this.onError(Hn);return}{const r=e.indexOf("[",a+8);let i=!1;t=e.indexOf(">",a+8);if(t<0){this.onError(Xn);return}if(r>0&&t>r){t=e.indexOf("]>",a+8);if(t<0){this.onError(Xn);return}i=!0}const n=e.substring(a+8,t+(i?1:0));this.onDoctype(n);a=t+(i?2:1)}}break;default:const i=this._parseContent(e,a);if(null===i){this.onError(Hn);return}let n=!1;if("/>"===e.substring(a+i.parsed,a+i.parsed+2))n=!0;else if(">"!==e.substring(a+i.parsed,a+i.parsed+1)){this.onError(Wn);return}this.onBeginElement(i.name,i.attributes,n);a+=i.parsed+(n?2:1)}}else{for(;a<e.length&&"<"!==e[a];)a++;const r=e.substring(t,a);this.onText(this._resolveEntities(r))}t=a}}onResolveEntity(e){return`&${e};`}onPi(e,t){}onComment(e){}onCdata(e){}onDoctype(e){}onText(e){}onBeginElement(e,t,a){}onEndElement(e){}onError(e){}}class SimpleDOMNode{constructor(e,t){this.nodeName=e;this.nodeValue=t;Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes?.[0]}get nextSibling(){const e=this.parentNode.childNodes;if(!e)return;const t=e.indexOf(this);return-1!==t?e[t+1]:void 0}get textContent(){return this.childNodes?this.childNodes.map((e=>e.textContent)).join(""):this.nodeValue||""}get children(){return this.childNodes||[]}hasChildNodes(){return this.childNodes?.length>0}searchNode(e,t){if(t>=e.length)return this;const a=e[t];if(a.name.startsWith("#")&&t<e.length-1)return this.searchNode(e,t+1);const r=[];let i=this;for(;;){if(a.name===i.nodeName){if(0!==a.pos){if(0===r.length)return null;{const[n]=r.pop();let s=0;for(const r of n.childNodes)if(a.name===r.nodeName){if(s===a.pos)return r.searchNode(e,t+1);s++}return i.searchNode(e,t+1)}}{const a=i.searchNode(e,t+1);if(null!==a)return a}}if(i.childNodes?.length>0){r.push([i,0]);i=i.childNodes[0]}else{if(0===r.length)return null;for(;0!==r.length;){const[e,t]=r.pop(),a=t+1;if(a<e.childNodes.length){r.push([e,a]);i=e.childNodes[a];break}}if(0===r.length)return null}}}dump(e){if("#text"!==this.nodeName){e.push(`<${this.nodeName}`);if(this.attributes)for(const t of this.attributes)e.push(` ${t.name}="${encodeToXmlString(t.value)}"`);if(this.hasChildNodes()){e.push(">");for(const t of this.childNodes)t.dump(e);e.push(`</${this.nodeName}>`)}else this.nodeValue?e.push(`>${encodeToXmlString(this.nodeValue)}</${this.nodeName}>`):e.push("/>")}else e.push(encodeToXmlString(this.nodeValue))}}class SimpleXMLParser extends XMLParserBase{constructor({hasAttributes:e=!1,lowerCaseName:t=!1}){super();this._currentFragment=null;this._stack=null;this._errorCode=jn;this._hasAttributes=e;this._lowerCaseName=t}parseFromString(e){this._currentFragment=[];this._stack=[];this._errorCode=jn;this.parseXml(e);if(this._errorCode!==jn)return;const[t]=this._currentFragment;return t?{documentElement:t}:void 0}onText(e){if(function isWhitespaceString(e){for(let t=0,a=e.length;t<a;t++)if(!isWhitespace(e,t))return!1;return!0}(e))return;const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onCdata(e){const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onBeginElement(e,t,a){this._lowerCaseName&&(e=e.toLowerCase());const r=new SimpleDOMNode(e);r.childNodes=[];this._hasAttributes&&(r.attributes=t);this._currentFragment.push(r);if(!a){this._stack.push(this._currentFragment);this._currentFragment=r.childNodes}}onEndElement(e){this._currentFragment=this._stack.pop()||[];const t=this._currentFragment.at(-1);if(!t)return null;for(const e of t.childNodes)e.parentNode=t;return t}onError(e){this._errorCode=e}}class MetadataParser{constructor(e){e=this._repair(e);const t=new SimpleXMLParser({lowerCaseName:!0}).parseFromString(e);this._metadataMap=new Map;this._data=e;t&&this._parse(t)}_repair(e){return e.replace(/^[^<]+/,"").replaceAll(/>\\\\376\\\\377([^<]+)/g,(function(e,t){const a=t.replaceAll(/\\\\([0-3])([0-7])([0-7])/g,(function(e,t,a,r){return String.fromCharCode(64*t+8*a+1*r)})).replaceAll(/&(amp|apos|gt|lt|quot);/g,(function(e,t){switch(t){case"amp":return"&";case"apos":return"\'";case"gt":return">";case"lt":return"<";case"quot":return\'"\'}throw new Error(`_repair: ${t} isn\'t defined.`)})),r=[">"];for(let e=0,t=a.length;e<t;e+=2){const t=256*a.charCodeAt(e)+a.charCodeAt(e+1);t>=32&&t<127&&60!==t&&62!==t&&38!==t?r.push(String.fromCharCode(t)):r.push("&#x"+(65536+t).toString(16).substring(1)+";")}return r.join("")}))}_getSequence(e){const t=e.nodeName;return"rdf:bag"!==t&&"rdf:seq"!==t&&"rdf:alt"!==t?null:e.childNodes.filter((e=>"rdf:li"===e.nodeName))}_parseArray(e){if(!e.hasChildNodes())return;const[t]=e.childNodes,a=this._getSequence(t)||[];this._metadataMap.set(e.nodeName,a.map((e=>e.textContent.trim())))}_parse(e){let t=e.documentElement;if("rdf:rdf"!==t.nodeName){t=t.firstChild;for(;t&&"rdf:rdf"!==t.nodeName;)t=t.nextSibling}if(t&&"rdf:rdf"===t.nodeName&&t.hasChildNodes())for(const e of t.childNodes)if("rdf:description"===e.nodeName)for(const t of e.childNodes){const e=t.nodeName;switch(e){case"#text":continue;case"dc:creator":case"dc:subject":this._parseArray(t);continue}this._metadataMap.set(e,t.textContent.trim())}}get serializable(){return{parsedData:this._metadataMap,rawData:this._data}}}const zn=1,$n=2,Gn=3,Vn=4,Kn=5;class StructTreeRoot{constructor(e,t,a){this.xref=e;this.dict=t;this.ref=a instanceof Ref?a:null;this.roleMap=new Map;this.structParentIds=null}init(){this.readRoleMap()}#Z(e,t,a){if(!(e instanceof Ref)||t<0)return;this.structParentIds||=new RefSetCache;let r=this.structParentIds.get(e);if(!r){r=[];this.structParentIds.put(e,r)}r.push([t,a])}addAnnotationIdToPage(e,t){this.#Z(e,t,Vn)}readRoleMap(){const e=this.dict.get("RoleMap");if(e instanceof Dict)for(const[t,a]of e)a instanceof Name&&this.roleMap.set(t,a.name)}static async canCreateStructureTree({catalogRef:e,pdfManager:t,newAnnotationsByPage:a}){if(!(e instanceof Ref)){warn("Cannot save the struct tree: no catalog reference.");return!1}let r=0,i=!0;for(const[e,n]of a){const{ref:a}=await t.getPage(e);if(!(a instanceof Ref)){warn(`Cannot save the struct tree: page ${e} has no ref.`);i=!0;break}for(const e of n)if(e.accessibilityData?.type){e.parentTreeId=r++;i=!1}}if(i){for(const e of a.values())for(const t of e)delete t.parentTreeId;return!1}return!0}static async createStructureTree({newAnnotationsByPage:e,xref:t,catalogRef:a,pdfManager:r,changes:i}){const n=await r.ensureCatalog("cloneDict"),s=new RefSetCache;s.put(a,n);const o=t.getNewTemporaryRef();n.set("StructTreeRoot",o);const c=new Dict(t);c.set("Type",Name.get("StructTreeRoot"));const l=t.getNewTemporaryRef();c.set("ParentTree",l);const h=[];c.set("K",h);s.put(o,c);const u=new Dict(t),d=[];u.set("Nums",d);const f=await this.#Q({newAnnotationsByPage:e,structTreeRootRef:o,structTreeRoot:null,kids:h,nums:d,xref:t,pdfManager:r,changes:i,cache:s});c.set("ParentTreeNextKey",f);s.put(l,u);for(const[e,t]of s.items())i.put(e,{data:t})}async canUpdateStructTree({pdfManager:e,newAnnotationsByPage:t}){if(!this.ref){warn("Cannot update the struct tree: no root reference.");return!1}let a=this.dict.get("ParentTreeNextKey");if(!Number.isInteger(a)||a<0){warn("Cannot update the struct tree: invalid next key.");return!1}const r=this.dict.get("ParentTree");if(!(r instanceof Dict)){warn("Cannot update the struct tree: ParentTree isn\'t a dict.");return!1}const i=r.get("Nums");if(!Array.isArray(i)){warn("Cannot update the struct tree: nums isn\'t an array.");return!1}const n=new NumberTree(r,this.xref);for(const a of t.keys()){const{pageDict:t}=await e.getPage(a);if(!t.has("StructParents"))continue;const r=t.get("StructParents");if(!Number.isInteger(r)||!Array.isArray(n.get(r))){warn(`Cannot save the struct tree: page ${a} has a wrong id.`);return!1}}let s=!0;for(const[r,i]of t){const{pageDict:t}=await e.getPage(r);StructTreeRoot.#ee({elements:i,xref:this.xref,pageDict:t,numberTree:n});for(const e of i)if(e.accessibilityData?.type){e.accessibilityData.structParent>=0||(e.parentTreeId=a++);s=!1}}if(s){for(const e of t.values())for(const t of e){delete t.parentTreeId;delete t.structTreeParent}return!1}return!0}async updateStructureTree({newAnnotationsByPage:e,pdfManager:t,changes:a}){const{ref:r,xref:i}=this,n=this.dict.clone(),s=new RefSetCache;s.put(r,n);let o,c=n.getRaw("ParentTree");if(c instanceof Ref)o=i.fetch(c);else{o=c;c=i.getNewTemporaryRef();n.set("ParentTree",c)}o=o.clone();s.put(c,o);let l=o.getRaw("Nums"),h=null;if(l instanceof Ref){h=l;l=i.fetch(h)}l=l.slice();h||o.set("Nums",l);const u=await StructTreeRoot.#Q({newAnnotationsByPage:e,structTreeRootRef:r,structTreeRoot:this,kids:null,nums:l,xref:i,pdfManager:t,changes:a,cache:s});if(-1!==u){n.set("ParentTreeNextKey",u);h&&s.put(h,l);for(const[e,t]of s.items())a.put(e,{data:t})}}static async#Q({newAnnotationsByPage:e,structTreeRootRef:t,structTreeRoot:a,kids:r,nums:i,xref:n,pdfManager:s,changes:o,cache:c}){const l=Name.get("OBJR");let h,u=-1;for(const[d,f]of e){const e=await s.getPage(d),{ref:g}=e,p=g instanceof Ref;for(const{accessibilityData:s,ref:m,parentTreeId:b,structTreeParent:y}of f){if(!s?.type)continue;const{structParent:f}=s;if(a&&Number.isInteger(f)&&f>=0){let t=(h||=new Map).get(d);if(void 0===t){t=new StructTreePage(a,e.pageDict).collectObjects(g);h.set(d,t)}const r=t?.get(f);if(r){const e=n.fetch(r).clone();StructTreeRoot.#te(e,s);o.put(r,{data:e});continue}}u=Math.max(u,b);const w=n.getNewTemporaryRef(),x=new Dict(n);StructTreeRoot.#te(x,s);await this.#ae({structTreeParent:y,tagDict:x,newTagRef:w,structTreeRootRef:t,fallbackKids:r,xref:n,cache:c});const S=new Dict(n);x.set("K",S);S.set("Type",l);p&&S.set("Pg",g);S.set("Obj",m);c.put(w,x);i.push(b,w)}}return u+1}static#te(e,{type:t,title:a,lang:r,alt:i,expanded:n,actualText:s}){e.set("S",Name.get(t));a&&e.set("T",stringToAsciiOrUTF16BE(a));r&&e.set("Lang",stringToAsciiOrUTF16BE(r));i&&e.set("Alt",stringToAsciiOrUTF16BE(i));n&&e.set("E",stringToAsciiOrUTF16BE(n));s&&e.set("ActualText",stringToAsciiOrUTF16BE(s))}static#ee({elements:e,xref:t,pageDict:a,numberTree:r}){const i=new Map;for(const t of e)if(t.structTreeParentId){const e=parseInt(t.structTreeParentId.split("_mc")[1],10);let a=i.get(e);if(!a){a=[];i.set(e,a)}a.push(t)}const n=a.get("StructParents");if(!Number.isInteger(n))return;const s=r.get(n),updateElement=(e,a,r)=>{const n=i.get(e);if(n){const e=a.getRaw("P"),i=t.fetchIfRef(e);if(e instanceof Ref&&i instanceof Dict){const e={ref:r,dict:a};for(const t of n)t.structTreeParent=e}return!0}return!1};for(const e of s){if(!(e instanceof Ref))continue;const a=t.fetch(e),r=a.get("K");if(Number.isInteger(r))updateElement(r,a,e);else if(Array.isArray(r))for(let i of r){i=t.fetchIfRef(i);if(Number.isInteger(i)&&updateElement(i,a,e))break;if(!(i instanceof Dict))continue;if(!isName(i.get("Type"),"MCR"))break;const r=i.get("MCID");if(Number.isInteger(r)&&updateElement(r,a,e))break}}}static async#ae({structTreeParent:e,tagDict:t,newTagRef:a,structTreeRootRef:r,fallbackKids:i,xref:n,cache:s}){let o,c=null;if(e){({ref:c}=e);o=e.dict.getRaw("P")||r}else o=r;t.set("P",o);const l=n.fetchIfRef(o);if(!l){i.push(a);return}let h=s.get(o);if(!h){h=l.clone();s.put(o,h)}const u=h.getRaw("K");let d=u instanceof Ref?s.get(u):null;if(!d){d=n.fetchIfRef(u);d=Array.isArray(d)?d.slice():[u];const e=n.getNewTemporaryRef();h.set("K",e);s.put(e,d)}const f=d.indexOf(c);d.splice(f>=0?f+1:d.length,0,a)}}class StructElementNode{constructor(e,t){this.tree=e;this.xref=e.xref;this.dict=t;this.kids=[];this.parseKids()}get role(){const e=this.dict.get("S"),t=e instanceof Name?e.name:"",{root:a}=this.tree;return a.roleMap.get(t)??t}parseKids(){let e=null;const t=this.dict.getRaw("Pg");t instanceof Ref&&(e=t.toString());const a=this.dict.get("K");if(Array.isArray(a))for(const t of a){const a=this.parseKid(e,this.xref.fetchIfRef(t));a&&this.kids.push(a)}else{const t=this.parseKid(e,a);t&&this.kids.push(t)}}parseKid(e,t){if(Number.isInteger(t))return this.tree.pageDict.objId!==e?null:new StructElement({type:zn,mcid:t,pageObjId:e});if(!(t instanceof Dict))return null;const a=t.getRaw("Pg");a instanceof Ref&&(e=a.toString());const r=t.get("Type")instanceof Name?t.get("Type").name:null;if("MCR"===r){if(this.tree.pageDict.objId!==e)return null;const a=t.getRaw("Stm");return new StructElement({type:$n,refObjId:a instanceof Ref?a.toString():null,pageObjId:e,mcid:t.get("MCID")})}if("OBJR"===r){if(this.tree.pageDict.objId!==e)return null;const a=t.getRaw("Obj");return new StructElement({type:Gn,refObjId:a instanceof Ref?a.toString():null,pageObjId:e})}return new StructElement({type:Kn,dict:t})}}class StructElement{constructor({type:e,dict:t=null,mcid:a=null,pageObjId:r=null,refObjId:i=null}){this.type=e;this.dict=t;this.mcid=a;this.pageObjId=r;this.refObjId=i;this.parentNode=null}}class StructTreePage{constructor(e,t){this.root=e;this.xref=e?.xref??null;this.rootDict=e?.dict??null;this.pageDict=t;this.nodes=[]}collectObjects(e){if(!(this.root&&this.rootDict&&e instanceof Ref))return null;const t=this.rootDict.get("ParentTree");if(!t)return null;const a=this.root.structParentIds?.get(e);if(!a)return null;const r=new Map,i=new NumberTree(t,this.xref);for(const[e]of a){const t=i.getRaw(e);t instanceof Ref&&r.set(e,t)}return r}parse(e){if(!(this.root&&this.rootDict&&e instanceof Ref))return;const t=this.rootDict.get("ParentTree");if(!t)return;const a=this.pageDict.get("StructParents"),r=this.root.structParentIds?.get(e);if(!Number.isInteger(a)&&!r)return;const i=new Map,n=new NumberTree(t,this.xref);if(Number.isInteger(a)){const e=n.get(a);if(Array.isArray(e))for(const t of e)t instanceof Ref&&this.addNode(this.xref.fetch(t),i)}if(r)for(const[e,t]of r){const a=n.get(e);if(a){const e=this.addNode(this.xref.fetchIfRef(a),i);1===e?.kids?.length&&e.kids[0].type===Gn&&(e.kids[0].type=t)}}}addNode(e,t,a=0){if(a>40){warn("StructTree MAX_DEPTH reached.");return null}if(!(e instanceof Dict))return null;if(t.has(e))return t.get(e);const r=new StructElementNode(this,e);t.set(e,r);const i=e.get("P");if(!(i instanceof Dict)||isName(i.get("Type"),"StructTreeRoot")){this.addTopLevelNode(e,r)||t.delete(e);return r}const n=this.addNode(i,t,a+1);if(!n)return r;let s=!1;for(const t of n.kids)if(t.type===Kn&&t.dict===e){t.parentNode=r;s=!0}s||t.delete(e);return r}addTopLevelNode(e,t){const a=this.rootDict.get("K");if(!a)return!1;if(a instanceof Dict){if(a.objId!==e.objId)return!1;this.nodes[0]=t;return!0}if(!Array.isArray(a))return!0;let r=!1;for(let i=0;i<a.length;i++){const n=a[i];if(n?.toString()===e.objId){this.nodes[i]=t;r=!0}}return r}get serializable(){function nodeToSerializable(e,t,a=0){if(a>40){warn("StructTree too deep to be fully serialized.");return}const r=Object.create(null);r.role=e.role;r.children=[];t.children.push(r);let i=e.dict.get("Alt");"string"!=typeof i&&(i=e.dict.get("ActualText"));"string"==typeof i&&(r.alt=stringToPDFString(i));const n=e.dict.get("A");if(n instanceof Dict){const e=lookupNormalRect(n.getArray("BBox"),null);if(e)r.bbox=e;else{const e=n.get("Width"),t=n.get("Height");"number"==typeof e&&e>0&&"number"==typeof t&&t>0&&(r.bbox=[0,0,e,t])}}const s=e.dict.get("Lang");"string"==typeof s&&(r.lang=stringToPDFString(s));for(const t of e.kids){const e=t.type===Kn?t.parentNode:null;e?nodeToSerializable(e,r,a+1):t.type===zn||t.type===$n?r.children.push({type:"content",id:`p${t.pageObjId}_mc${t.mcid}`}):t.type===Gn?r.children.push({type:"object",id:t.refObjId}):t.type===Vn&&r.children.push({type:"annotation",id:`pdfjs_internal_id_${t.refObjId}`})}}const e=Object.create(null);e.children=[];e.role="Root";for(const t of this.nodes)t&&nodeToSerializable(t,e);return e}}const Jn=function _isValidExplicitDest(e,t,a){if(!Array.isArray(a)||a.length<2)return!1;const[r,i,...n]=a;if(!e(r)&&!Number.isInteger(r))return!1;if(!t(i))return!1;const s=n.length;let o=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return 0===s;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(4!==s)return!1;o=!1;break;default:return!1}for(const e of n)if(!("number"==typeof e||o&&null===e))return!1;return!0}.bind(null,(e=>e instanceof Ref),isName);function fetchDest(e){e instanceof Dict&&(e=e.get("D"));return Jn(e)?e:null}function fetchRemoteDest(e){let t=e.get("D");if(t){t instanceof Name&&(t=t.name);if("string"==typeof t)return stringToPDFString(t,!0);if(Jn(t))return JSON.stringify(t)}return null}class Catalog{#re=null;#ie=null;builtInCMapCache=new Map;fontCache=new RefSetCache;globalColorSpaceCache=new GlobalColorSpaceCache;globalImageCache=new GlobalImageCache;nonBlendModesSet=new RefSet;pageDictCache=new RefSetCache;pageIndexCache=new RefSetCache;pageKidsCountCache=new RefSetCache;standardFontDataCache=new Map;systemFontCache=new Map;constructor(e,t){this.pdfManager=e;this.xref=t;this.#ie=t.getCatalogObj();if(!(this.#ie instanceof Dict))throw new FormatError("Catalog object is not a dictionary.");this.toplevelPagesDict}cloneDict(){return this.#ie.clone()}get version(){const e=this.#ie.get("Version");if(e instanceof Name){if(Ca.test(e.name))return shadow(this,"version",e.name);warn(`Invalid PDF catalog version: ${e.name}`)}return shadow(this,"version",null)}get lang(){const e=this.#ie.get("Lang");return shadow(this,"lang",e&&"string"==typeof e?stringToPDFString(e):null)}get needsRendering(){const e=this.#ie.get("NeedsRendering");return shadow(this,"needsRendering","boolean"==typeof e&&e)}get collection(){let e=null;try{const t=this.#ie.get("Collection");t instanceof Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof MissingDataException)throw e;info("Cannot fetch Collection entry; assuming no collection is present.")}return shadow(this,"collection",e)}get acroForm(){let e=null;try{const t=this.#ie.get("AcroForm");t instanceof Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof MissingDataException)throw e;info("Cannot fetch AcroForm entry; assuming no forms are present.")}return shadow(this,"acroForm",e)}get acroFormRef(){const e=this.#ie.getRaw("AcroForm");return shadow(this,"acroFormRef",e instanceof Ref?e:null)}get metadata(){const e=this.#ie.getRaw("Metadata");if(!(e instanceof Ref))return shadow(this,"metadata",null);let t=null;try{const a=this.xref.fetch(e,!this.xref.encrypt?.encryptMetadata);if(a instanceof BaseStream&&a.dict instanceof Dict){const e=a.dict.get("Type"),r=a.dict.get("Subtype");if(isName(e,"Metadata")&&isName(r,"XML")){const e=stringToUTF8String(a.getString());e&&(t=new MetadataParser(e).serializable)}}}catch(e){if(e instanceof MissingDataException)throw e;info(`Skipping invalid Metadata: "${e}".`)}return shadow(this,"metadata",t)}get markInfo(){let e=null;try{e=this.#ne()}catch(e){if(e instanceof MissingDataException)throw e;warn("Unable to read mark info.")}return shadow(this,"markInfo",e)}#ne(){const e=this.#ie.get("MarkInfo");if(!(e instanceof Dict))return null;const t={Marked:!1,UserProperties:!1,Suspects:!1};for(const a in t){const r=e.get(a);"boolean"==typeof r&&(t[a]=r)}return t}get structTreeRoot(){let e=null;try{e=this.#se()}catch(e){if(e instanceof MissingDataException)throw e;warn("Unable read to structTreeRoot info.")}return shadow(this,"structTreeRoot",e)}#se(){const e=this.#ie.getRaw("StructTreeRoot"),t=this.xref.fetchIfRef(e);if(!(t instanceof Dict))return null;const a=new StructTreeRoot(this.xref,t,e);a.init();return a}get toplevelPagesDict(){const e=this.#ie.get("Pages");if(!(e instanceof Dict))throw new FormatError("Invalid top-level pages dictionary.");return shadow(this,"toplevelPagesDict",e)}get documentOutline(){let e=null;try{e=this.#oe()}catch(e){if(e instanceof MissingDataException)throw e;warn("Unable to read document outline.")}return shadow(this,"documentOutline",e)}#oe(){let e=this.#ie.get("Outlines");if(!(e instanceof Dict))return null;e=e.getRaw("First");if(!(e instanceof Ref))return null;const t={items:[]},a=[{obj:e,parent:t}],r=new RefSet;r.put(e);const i=this.xref,n=new Uint8ClampedArray(3);for(;a.length>0;){const t=a.shift(),s=i.fetchIfRef(t.obj);if(null===s)continue;s.has("Title")||warn("Invalid outline item encountered.");const o={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:s,resultObj:o,docBaseUrl:this.baseUrl,docAttachments:this.attachments});const c=s.get("Title"),l=s.get("F")||0,h=s.getArray("C"),u=s.get("Count");let d=n;!isNumberArray(h,3)||0===h[0]&&0===h[1]&&0===h[2]||(d=ColorSpaceUtils.rgb.getRgb(h,0));const f={action:o.action,attachment:o.attachment,dest:o.dest,url:o.url,unsafeUrl:o.unsafeUrl,newWindow:o.newWindow,setOCGState:o.setOCGState,title:"string"==typeof c?stringToPDFString(c):"",color:d,count:Number.isInteger(u)?u:void 0,bold:!!(2&l),italic:!!(1&l),items:[]};t.parent.items.push(f);e=s.getRaw("First");if(e instanceof Ref&&!r.has(e)){a.push({obj:e,parent:f});r.put(e)}e=s.getRaw("Next");if(e instanceof Ref&&!r.has(e)){a.push({obj:e,parent:t.parent});r.put(e)}}return t.items.length>0?t.items:null}get permissions(){let e=null;try{e=this.#ce()}catch(e){if(e instanceof MissingDataException)throw e;warn("Unable to read permissions.")}return shadow(this,"permissions",e)}#ce(){const e=this.xref.trailer.get("Encrypt");if(!(e instanceof Dict))return null;let t=e.get("P");if("number"!=typeof t)return null;t+=2**32;const a=[];for(const e in w){const r=w[e];t&r&&a.push(r)}return a}get optionalContentConfig(){let e=null;try{const t=this.#ie.get("OCProperties");if(!t)return shadow(this,"optionalContentConfig",null);const a=t.get("D");if(!a)return shadow(this,"optionalContentConfig",null);const r=t.get("OCGs");if(!Array.isArray(r))return shadow(this,"optionalContentConfig",null);const i=new RefSetCache;for(const e of r)e instanceof Ref&&!i.has(e)&&i.put(e,this.#le(e));e=this.#he(a,i)}catch(e){if(e instanceof MissingDataException)throw e;warn(`Unable to read optional content config: ${e}`)}return shadow(this,"optionalContentConfig",e)}#le(e){const t=this.xref.fetch(e),a={id:e.toString(),name:null,intent:null,usage:{print:null,view:null},rbGroups:[]},r=t.get("Name");"string"==typeof r&&(a.name=stringToPDFString(r));let i=t.getArray("Intent");Array.isArray(i)||(i=[i]);i.every((e=>e instanceof Name))&&(a.intent=i.map((e=>e.name)));const n=t.get("Usage");if(!(n instanceof Dict))return a;const s=a.usage,o=n.get("Print");if(o instanceof Dict){const e=o.get("PrintState");if(e instanceof Name)switch(e.name){case"ON":case"OFF":s.print={printState:e.name}}}const c=n.get("View");if(c instanceof Dict){const e=c.get("ViewState");if(e instanceof Name)switch(e.name){case"ON":case"OFF":s.view={viewState:e.name}}}return a}#he(e,t){function parseOnOff(e){const a=[];if(Array.isArray(e))for(const r of e)r instanceof Ref&&t.has(r)&&a.push(r.toString());return a}function parseOrder(e,a=0){if(!Array.isArray(e))return null;const i=[];for(const n of e){if(n instanceof Ref&&t.has(n)){r.put(n);i.push(n.toString());continue}const e=parseNestedOrder(n,a);e&&i.push(e)}if(a>0)return i;const n=[];for(const[e]of t.items())r.has(e)||n.push(e.toString());n.length&&i.push({name:null,order:n});return i}function parseNestedOrder(e,t){if(++t>i){warn("parseNestedOrder - reached MAX_NESTED_LEVELS.");return null}const r=a.fetchIfRef(e);if(!Array.isArray(r))return null;const n=a.fetchIfRef(r[0]);if("string"!=typeof n)return null;const s=parseOrder(r.slice(1),t);return s?.length?{name:stringToPDFString(n),order:s}:null}const a=this.xref,r=new RefSet,i=10;!function parseRBGroups(e){if(Array.isArray(e))for(const r of e){const e=a.fetchIfRef(r);if(!Array.isArray(e)||!e.length)continue;const i=new Set;for(const a of e)if(a instanceof Ref&&t.has(a)&&!i.has(a.toString())){i.add(a.toString());t.get(a).rbGroups.push(i)}}}(e.get("RBGroups"));return{name:"string"==typeof e.get("Name")?stringToPDFString(e.get("Name")):null,creator:"string"==typeof e.get("Creator")?stringToPDFString(e.get("Creator")):null,baseState:e.get("BaseState")instanceof Name?e.get("BaseState").name:null,on:parseOnOff(e.get("ON")),off:parseOnOff(e.get("OFF")),order:parseOrder(e.get("Order")),groups:[...t]}}setActualNumPages(e=null){this.#re=e}get hasActualNumPages(){return null!==this.#re}get _pagesCount(){const e=this.toplevelPagesDict.get("Count");if(!Number.isInteger(e))throw new FormatError("Page count in top-level pages dictionary is not an integer.");return shadow(this,"_pagesCount",e)}get numPages(){return this.#re??this._pagesCount}get destinations(){const e=this.#ue(),t=Object.create(null);for(const a of e)if(a instanceof NameTree)for(const[e,r]of a.getAll()){const a=fetchDest(r);a&&(t[stringToPDFString(e,!0)]=a)}else if(a instanceof Dict)for(const[e,r]of a){const a=fetchDest(r);a&&(t[stringToPDFString(e,!0)]||=a)}return shadow(this,"destinations",t)}getDestination(e){if(this.hasOwnProperty("destinations"))return this.destinations[e]??null;const t=this.#ue();for(const a of t)if(a instanceof NameTree||a instanceof Dict){const t=fetchDest(a.get(e));if(t)return t}if(t.length){const t=this.destinations[e];if(t)return t}return null}#ue(){const e=this.#ie.get("Names"),t=[];e?.has("Dests")&&t.push(new NameTree(e.getRaw("Dests"),this.xref));this.#ie.has("Dests")&&t.push(this.#ie.get("Dests"));return t}get pageLabels(){let e=null;try{e=this.#de()}catch(e){if(e instanceof MissingDataException)throw e;warn("Unable to read page labels.")}return shadow(this,"pageLabels",e)}#de(){const e=this.#ie.getRaw("PageLabels");if(!e)return null;const t=new Array(this.numPages);let a=null,r="";const i=new NumberTree(e,this.xref).getAll();let n="",s=1;for(let e=0,o=this.numPages;e<o;e++){const o=i.get(e);if(void 0!==o){if(!(o instanceof Dict))throw new FormatError("PageLabel is not a dictionary.");if(o.has("Type")&&!isName(o.get("Type"),"PageLabel"))throw new FormatError("Invalid type in PageLabel dictionary.");if(o.has("S")){const e=o.get("S");if(!(e instanceof Name))throw new FormatError("Invalid style in PageLabel dictionary.");a=e.name}else a=null;if(o.has("P")){const e=o.get("P");if("string"!=typeof e)throw new FormatError("Invalid prefix in PageLabel dictionary.");r=stringToPDFString(e)}else r="";if(o.has("St")){const e=o.get("St");if(!(Number.isInteger(e)&&e>=1))throw new FormatError("Invalid start in PageLabel dictionary.");s=e}else s=1}switch(a){case"D":n=s;break;case"R":case"r":n=toRomanNumerals(s,"r"===a);break;case"A":case"a":const e=26,t="a"===a?97:65,r=s-1;n=String.fromCharCode(t+r%e).repeat(Math.floor(r/e)+1);break;default:if(a)throw new FormatError(`Invalid style "${a}" in PageLabel dictionary.`);n=""}t[e]=r+n;s++}return t}get pageLayout(){const e=this.#ie.get("PageLayout");let t="";if(e instanceof Name)switch(e.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":t=e.name}return shadow(this,"pageLayout",t)}get pageMode(){const e=this.#ie.get("PageMode");let t="UseNone";if(e instanceof Name)switch(e.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":t=e.name}return shadow(this,"pageMode",t)}get viewerPreferences(){const e=this.#ie.get("ViewerPreferences");if(!(e instanceof Dict))return shadow(this,"viewerPreferences",null);let t=null;for(const[a,r]of e){let e;switch(a){case"HideToolbar":case"HideMenubar":case"HideWindowUI":case"FitWindow":case"CenterWindow":case"DisplayDocTitle":case"PickTrayByPDFSize":"boolean"==typeof r&&(e=r);break;case"NonFullScreenPageMode":if(r instanceof Name)switch(r.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":e=r.name;break;default:e="UseNone"}break;case"Direction":if(r instanceof Name)switch(r.name){case"L2R":case"R2L":e=r.name;break;default:e="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":if(r instanceof Name)switch(r.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":e=r.name;break;default:e="CropBox"}break;case"PrintScaling":if(r instanceof Name)switch(r.name){case"None":case"AppDefault":e=r.name;break;default:e="AppDefault"}break;case"Duplex":if(r instanceof Name)switch(r.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":e=r.name;break;default:e="None"}break;case"PrintPageRange":if(Array.isArray(r)&&r.length%2==0){r.every(((e,t,a)=>Number.isInteger(e)&&e>0&&(0===t||e>=a[t-1])&&e<=this.numPages))&&(e=r)}break;case"NumCopies":Number.isInteger(r)&&r>0&&(e=r);break;default:warn(`Ignoring non-standard key in ViewerPreferences: ${a}.`);continue}if(void 0!==e){t??=Object.create(null);t[a]=e}else warn(`Bad value, for key "${a}", in ViewerPreferences: ${r}.`)}return shadow(this,"viewerPreferences",t)}get openAction(){const e=this.#ie.get("OpenAction"),t=Object.create(null);if(e instanceof Dict){const a=new Dict(this.xref);a.set("A",e);const r={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:a,resultObj:r});Array.isArray(r.dest)?t.dest=r.dest:r.action&&(t.action=r.action)}else Jn(e)&&(t.dest=e);return shadow(this,"openAction",objectSize(t)>0?t:null)}get attachments(){const e=this.#ie.get("Names");let t=null;if(e instanceof Dict&&e.has("EmbeddedFiles")){const a=new NameTree(e.getRaw("EmbeddedFiles"),this.xref);for(const[e,r]of a.getAll()){const a=new FileSpec(r,this.xref);t??=Object.create(null);t[stringToPDFString(e,!0)]=a.serializable}}return shadow(this,"attachments",t)}get xfaImages(){const e=this.#ie.get("Names");let t=null;if(e instanceof Dict&&e.has("XFAImages")){const a=new NameTree(e.getRaw("XFAImages"),this.xref);for(const[e,r]of a.getAll())if(r instanceof BaseStream){t??=new Map;t.set(stringToPDFString(e,!0),r.getBytes())}}return shadow(this,"xfaImages",t)}#fe(){const e=this.#ie.get("Names");let t=null;function appendIfJavaScriptDict(e,a){if(!(a instanceof Dict))return;if(!isName(a.get("S"),"JavaScript"))return;let r=a.get("JS");if(r instanceof BaseStream)r=r.getString();else if("string"!=typeof r)return;r=stringToPDFString(r,!0).replaceAll("\\0","");r&&(t||=new Map).set(e,r)}if(e instanceof Dict&&e.has("JavaScript")){const t=new NameTree(e.getRaw("JavaScript"),this.xref);for(const[e,a]of t.getAll())appendIfJavaScriptDict(stringToPDFString(e,!0),a)}const a=this.#ie.get("OpenAction");a&&appendIfJavaScriptDict("OpenAction",a);return t}get jsActions(){const e=this.#fe();let t=collectActions(this.xref,this.#ie,we);if(e){t||=Object.create(null);for(const[a,r]of e)a in t?t[a].push(r):t[a]=[r]}return shadow(this,"jsActions",t)}async cleanup(e=!1){clearGlobalCaches();this.globalColorSpaceCache.clear();this.globalImageCache.clear(e);this.pageKidsCountCache.clear();this.pageIndexCache.clear();this.pageDictCache.clear();this.nonBlendModesSet.clear();for(const{dict:e}of await Promise.all(this.fontCache))delete e.cacheKey;this.fontCache.clear();this.builtInCMapCache.clear();this.standardFontDataCache.clear();this.systemFontCache.clear()}async getPageDict(e){const t=[this.toplevelPagesDict],a=new RefSet,r=this.#ie.getRaw("Pages");r instanceof Ref&&a.put(r);const i=this.xref,n=this.pageKidsCountCache,s=this.pageIndexCache,o=this.pageDictCache;let c=0;for(;t.length;){const r=t.pop();if(r instanceof Ref){const l=n.get(r);if(l>=0&&c+l<=e){c+=l;continue}if(a.has(r))throw new FormatError("Pages tree contains circular reference.");a.put(r);const h=await(o.get(r)||i.fetchAsync(r));if(h instanceof Dict){let t=h.getRaw("Type");t instanceof Ref&&(t=await i.fetchAsync(t));if(isName(t,"Page")||!h.has("Kids")){n.has(r)||n.put(r,1);s.has(r)||s.put(r,c);if(c===e)return[h,r];c++;continue}}t.push(h);continue}if(!(r instanceof Dict))throw new FormatError("Page dictionary kid reference points to wrong type of object.");const{objId:l}=r;let h=r.getRaw("Count");h instanceof Ref&&(h=await i.fetchAsync(h));if(Number.isInteger(h)&&h>=0){l&&!n.has(l)&&n.put(l,h);if(c+h<=e){c+=h;continue}}let u=r.getRaw("Kids");u instanceof Ref&&(u=await i.fetchAsync(u));if(!Array.isArray(u)){let t=r.getRaw("Type");t instanceof Ref&&(t=await i.fetchAsync(t));if(isName(t,"Page")||!r.has("Kids")){if(c===e)return[r,null];c++;continue}throw new FormatError("Page dictionary kids object is not an array.")}for(let e=u.length-1;e>=0;e--){const a=u[e];t.push(a);r===this.toplevelPagesDict&&a instanceof Ref&&!o.has(a)&&o.put(a,i.fetchAsync(a))}}throw new Error(`Page index ${e} not found.`)}async getAllPageDicts(e=!1){const{ignoreErrors:t}=this.pdfManager.evaluatorOptions,a=[{currentNode:this.toplevelPagesDict,posInKids:0}],r=new RefSet,i=this.#ie.getRaw("Pages");i instanceof Ref&&r.put(i);const n=new Map,s=this.xref,o=this.pageIndexCache;let c=0;function addPageDict(e,t){t&&!o.has(t)&&o.put(t,c);n.set(c++,[e,t])}function addPageError(a){if(a instanceof XRefEntryException&&!e)throw a;if(e&&t&&0===c){warn(`getAllPageDicts - Skipping invalid first page: "${a}".`);a=Dict.empty}n.set(c++,[a,null])}for(;a.length>0;){const e=a.at(-1),{currentNode:t,posInKids:i}=e;let n=t.getRaw("Kids");if(n instanceof Ref)try{n=await s.fetchAsync(n)}catch(e){addPageError(e);break}if(!Array.isArray(n)){addPageError(new FormatError("Page dictionary kids object is not an array."));break}if(i>=n.length){a.pop();continue}const o=n[i];let c;if(o instanceof Ref){if(r.has(o)){addPageError(new FormatError("Pages tree contains circular reference."));break}r.put(o);try{c=await s.fetchAsync(o)}catch(e){addPageError(e);break}}else c=o;if(!(c instanceof Dict)){addPageError(new FormatError("Page dictionary kid reference points to wrong type of object."));break}let l=c.getRaw("Type");if(l instanceof Ref)try{l=await s.fetchAsync(l)}catch(e){addPageError(e);break}isName(l,"Page")||!c.has("Kids")?addPageDict(c,o instanceof Ref?o:null):a.push({currentNode:c,posInKids:0});e.posInKids++}return n}getPageIndex(e){const t=this.pageIndexCache.get(e);if(void 0!==t)return Promise.resolve(t);const a=this.xref;let r=0;const next=t=>function pagesBeforeRef(t){let r,i=0;return a.fetchAsync(t).then((function(a){if(isRefsEqual(t,e)&&!isDict(a,"Page")&&!(a instanceof Dict&&!a.has("Type")&&a.has("Contents")))throw new FormatError("The reference does not point to a /Page dictionary.");if(!a)return null;if(!(a instanceof Dict))throw new FormatError("Node must be a dictionary.");r=a.getRaw("Parent");return a.getAsync("Parent")})).then((function(e){if(!e)return null;if(!(e instanceof Dict))throw new FormatError("Parent must be a dictionary.");return e.getAsync("Kids")})).then((function(e){if(!e)return null;const n=[];let s=!1;for(const r of e){if(!(r instanceof Ref))throw new FormatError("Kid must be a reference.");if(isRefsEqual(r,t)){s=!0;break}n.push(a.fetchAsync(r).then((function(e){if(!(e instanceof Dict))throw new FormatError("Kid node must be a dictionary.");e.has("Count")?i+=e.get("Count"):i++})))}if(!s)throw new FormatError("Kid reference not found in parent\'s kids.");return Promise.all(n).then((()=>[i,r]))}))}(t).then((t=>{if(!t){this.pageIndexCache.put(e,r);return r}const[a,i]=t;r+=a;return next(i)}));return next(e)}get baseUrl(){const e=this.#ie.get("URI");if(e instanceof Dict){const t=e.get("Base");if("string"==typeof t){const e=createValidAbsoluteUrl(t,null,{tryConvertEncoding:!0});if(e)return shadow(this,"baseUrl",e.href)}}return shadow(this,"baseUrl",this.pdfManager.docBaseUrl)}static parseDestDictionary({destDict:e,resultObj:t,docBaseUrl:a=null,docAttachments:r=null}){if(!(e instanceof Dict)){warn("parseDestDictionary: `destDict` must be a dictionary.");return}let i,n,s=e.get("A");if(!(s instanceof Dict))if(e.has("Dest"))s=e.get("Dest");else{s=e.get("AA");s instanceof Dict&&(s.has("D")?s=s.get("D"):s.has("U")&&(s=s.get("U")))}if(s instanceof Dict){const e=s.get("S");if(!(e instanceof Name)){warn("parseDestDictionary: Invalid type in Action dictionary.");return}const a=e.name;switch(a){case"ResetForm":const e=s.get("Flags"),o=!(1&("number"==typeof e?e:0)),c=[],l=[];for(const e of s.get("Fields")||[])e instanceof Ref?l.push(e.toString()):"string"==typeof e&&c.push(stringToPDFString(e));t.resetForm={fields:c,refs:l,include:o};break;case"URI":i=s.get("URI");i instanceof Name&&(i="/"+i.name);break;case"GoTo":n=s.get("D");break;case"Launch":case"GoToR":const h=s.get("F");if(h instanceof Dict){const e=new FileSpec(h,null,!0),{rawFilename:t}=e.serializable;i=t}else"string"==typeof h&&(i=h);const u=fetchRemoteDest(s);u&&"string"==typeof i&&(i=i.split("#",1)[0]+"#"+u);const d=s.get("NewWindow");"boolean"==typeof d&&(t.newWindow=d);break;case"GoToE":const f=s.get("T");let g;if(r&&f instanceof Dict){const e=f.get("R"),t=f.get("N");isName(e,"C")&&"string"==typeof t&&(g=r[stringToPDFString(t,!0)])}if(g){t.attachment=g;const e=fetchRemoteDest(s);e&&(t.attachmentDest=e)}else warn(\'parseDestDictionary - unimplemented "GoToE" action.\');break;case"Named":const p=s.get("N");p instanceof Name&&(t.action=p.name);break;case"SetOCGState":const m=s.get("State"),b=s.get("PreserveRB");if(!Array.isArray(m)||0===m.length)break;const y=[];for(const e of m)if(e instanceof Name)switch(e.name){case"ON":case"OFF":case"Toggle":y.push(e.name)}else e instanceof Ref&&y.push(e.toString());if(y.length!==m.length)break;t.setOCGState={state:y,preserveRB:"boolean"!=typeof b||b};break;case"JavaScript":const w=s.get("JS");let x;w instanceof BaseStream?x=w.getString():"string"==typeof w&&(x=w);const S=x&&recoverJsURL(stringToPDFString(x,!0));if(S){i=S.url;t.newWindow=S.newWindow;break}default:if("JavaScript"===a||"SubmitForm"===a)break;warn(`parseDestDictionary - unsupported action: "${a}".`)}}else e.has("Dest")&&(n=e.get("Dest"));if("string"==typeof i){const e=createValidAbsoluteUrl(i,a,{addDefaultProtocol:!0,tryConvertEncoding:!0});e&&(t.url=e.href);t.unsafeUrl=i}if(n){n instanceof Name&&(n=n.name);"string"==typeof n?t.dest=stringToPDFString(n,!0):Jn(n)&&(t.dest=n)}}}function addChildren(e,t){if(e instanceof Dict)e=e.getRawValues();else if(e instanceof BaseStream)e=e.dict.getRawValues();else if(!Array.isArray(e))return;for(const r of e)((a=r)instanceof Ref||a instanceof Dict||a instanceof BaseStream||Array.isArray(a))&&t.push(r);var a}class ObjectLoader{refSet=new RefSet;constructor(e,t,a){this.dict=e;this.keys=t;this.xref=a}async load(){const{keys:e,dict:t}=this,a=[];for(const r of e){const e=t.getRaw(r);void 0!==e&&a.push(e)}await this.#ge(a);this.refSet=null}async#ge(e){const t=[],a=[];for(;e.length;){let r=e.pop();if(r instanceof Ref){if(this.refSet.has(r))continue;try{this.refSet.put(r);r=this.xref.fetch(r)}catch(e){if(!(e instanceof MissingDataException)){warn(`ObjectLoader.#walk - requesting all data: "${e}".`);await this.xref.stream.manager.requestAllChunks();return}t.push(r);a.push({begin:e.begin,end:e.end})}}if(r instanceof BaseStream){const e=r.getBaseStreams();if(e){let i=!1;for(const t of e)if(!t.isDataLoaded){i=!0;a.push({begin:t.start,end:t.end})}i&&t.push(r)}}addChildren(r,e)}if(a.length){await this.xref.stream.manager.requestRanges(a);for(const e of t)e instanceof Ref&&this.refSet.remove(e);await this.#ge(t)}}static async load(e,t,a){if(a.stream.isDataLoaded)return;const r=new ObjectLoader(e,t,a);await r.load()}}const Yn=Symbol(),Zn=Symbol(),Qn=Symbol(),es=Symbol(),ts=Symbol(),as=Symbol(),rs=Symbol(),is=Symbol(),ns=Symbol(),ss=Symbol("content"),os=Symbol("data"),cs=Symbol(),ls=Symbol("extra"),hs=Symbol(),us=Symbol(),ds=Symbol(),fs=Symbol(),gs=Symbol(),ps=Symbol(),ms=Symbol(),bs=Symbol(),ys=Symbol(),ws=Symbol(),xs=Symbol(),Ss=Symbol(),As=Symbol(),ks=Symbol(),Cs=Symbol(),vs=Symbol(),Fs=Symbol(),Is=Symbol(),Ts=Symbol(),Os=Symbol(),Ms=Symbol(),Ds=Symbol(),Bs=Symbol(),Rs=Symbol(),Ns=Symbol(),Es=Symbol(),Ls=Symbol(),js=Symbol(),_s=Symbol(),Us=Symbol(),Xs=Symbol(),qs=Symbol(),Hs=Symbol("namespaceId"),Ws=Symbol("nodeName"),zs=Symbol(),$s=Symbol(),Gs=Symbol(),Vs=Symbol(),Ks=Symbol(),Js=Symbol(),Ys=Symbol(),Zs=Symbol(),Qs=Symbol("root"),eo=Symbol(),to=Symbol(),ao=Symbol(),ro=Symbol(),io=Symbol(),no=Symbol(),so=Symbol(),oo=Symbol(),co=Symbol(),lo=Symbol(),ho=Symbol(),uo=Symbol("uid"),fo=Symbol(),go={config:{id:0,check:e=>e.startsWith("http://www.xfa.org/schema/xci/")},connectionSet:{id:1,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-connection-set/")},datasets:{id:2,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-data/")},form:{id:3,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-form/")},localeSet:{id:4,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-locale-set/")},pdf:{id:5,check:e=>"http://ns.adobe.com/xdp/pdf/"===e},signature:{id:6,check:e=>"http://www.w3.org/2000/09/xmldsig#"===e},sourceSet:{id:7,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-source-set/")},stylesheet:{id:8,check:e=>"http://www.w3.org/1999/XSL/Transform"===e},template:{id:9,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-template/")},xdc:{id:10,check:e=>e.startsWith("http://www.xfa.org/schema/xdc/")},xdp:{id:11,check:e=>"http://ns.adobe.com/xdp/"===e},xfdf:{id:12,check:e=>"http://ns.adobe.com/xfdf/"===e},xhtml:{id:13,check:e=>"http://www.w3.org/1999/xhtml"===e},xmpmeta:{id:14,check:e=>"http://ns.adobe.com/xmpmeta/"===e}},po={pt:e=>e,cm:e=>e/2.54*72,mm:e=>e/25.4*72,in:e=>72*e,px:e=>e},mo=/([+-]?\\d+\\.?\\d*)(.*)/;function stripQuotes(e){return e.startsWith("\'")||e.startsWith(\'"\')?e.slice(1,-1):e}function getInteger({data:e,defaultValue:t,validate:a}){if(!e)return t;e=e.trim();const r=parseInt(e,10);return!isNaN(r)&&a(r)?r:t}function getFloat({data:e,defaultValue:t,validate:a}){if(!e)return t;e=e.trim();const r=parseFloat(e);return!isNaN(r)&&a(r)?r:t}function getKeyword({data:e,defaultValue:t,validate:a}){return e&&a(e=e.trim())?e:t}function getStringOption(e,t){return getKeyword({data:e,defaultValue:t[0],validate:e=>t.includes(e)})}function getMeasurement(e,t="0"){t||="0";if(!e)return getMeasurement(t);const a=e.trim().match(mo);if(!a)return getMeasurement(t);const[,r,i]=a,n=parseFloat(r);if(isNaN(n))return getMeasurement(t);if(0===n)return 0;const s=po[i];return s?s(n):n}function getRatio(e){if(!e)return{num:1,den:1};const t=e.split(":",2).map((e=>parseFloat(e.trim()))).filter((e=>!isNaN(e)));1===t.length&&t.push(1);if(0===t.length)return{num:1,den:1};const[a,r]=t;return{num:a,den:r}}function getRelevant(e){return e?e.trim().split(/\\s+/).map((e=>({excluded:"-"===e[0],viewname:e.substring(1)}))):[]}class HTMLResult{static get FAILURE(){return shadow(this,"FAILURE",new HTMLResult(!1,null,null,null))}static get EMPTY(){return shadow(this,"EMPTY",new HTMLResult(!0,null,null,null))}constructor(e,t,a,r){this.success=e;this.html=t;this.bbox=a;this.breakNode=r}isBreak(){return!!this.breakNode}static breakNode(e){return new HTMLResult(!1,null,null,e)}static success(e,t=null){return new HTMLResult(!0,e,t,null)}}class FontFinder{constructor(e){this.fonts=new Map;this.cache=new Map;this.warned=new Set;this.defaultFont=null;this.add(e)}add(e,t=null){for(const t of e)this.addPdfFont(t);for(const e of this.fonts.values())e.regular||(e.regular=e.italic||e.bold||e.bolditalic);if(!t||0===t.size)return;const a=this.fonts.get("PdfJS-Fallback-PdfJS-XFA");for(const e of t)this.fonts.set(e,a)}addPdfFont(e){const t=e.cssFontInfo,a=t.fontFamily;let r=this.fonts.get(a);if(!r){r=Object.create(null);this.fonts.set(a,r);this.defaultFont||(this.defaultFont=r)}let i="";const n=parseFloat(t.fontWeight);0!==parseFloat(t.italicAngle)?i=n>=700?"bolditalic":"italic":n>=700&&(i="bold");if(!i){(e.name.includes("Bold")||e.psName?.includes("Bold"))&&(i="bold");(e.name.includes("Italic")||e.name.endsWith("It")||e.psName?.includes("Italic")||e.psName?.endsWith("It"))&&(i+="italic")}i||(i="regular");r[i]=e}getDefault(){return this.defaultFont}find(e,t=!0){let a=this.fonts.get(e)||this.cache.get(e);if(a)return a;const r=/,|-|_| |bolditalic|bold|italic|regular|it/gi;let i=e.replaceAll(r,"");a=this.fonts.get(i);if(a){this.cache.set(e,a);return a}i=i.toLowerCase();const n=[];for(const[e,t]of this.fonts.entries())e.replaceAll(r,"").toLowerCase().startsWith(i)&&n.push(t);if(0===n.length)for(const[,e]of this.fonts.entries())e.regular.name?.replaceAll(r,"").toLowerCase().startsWith(i)&&n.push(e);if(0===n.length){i=i.replaceAll(/psmt|mt/gi,"");for(const[e,t]of this.fonts.entries())e.replaceAll(r,"").toLowerCase().startsWith(i)&&n.push(t)}if(0===n.length)for(const e of this.fonts.values())e.regular.name?.replaceAll(r,"").toLowerCase().startsWith(i)&&n.push(e);if(n.length>=1){1!==n.length&&t&&warn(`XFA - Too many choices to guess the correct font: ${e}`);this.cache.set(e,n[0]);return n[0]}if(t&&!this.warned.has(e)){this.warned.add(e);warn(`XFA - Cannot find the font: ${e}`)}return null}}function selectFont(e,t){return"italic"===e.posture?"bold"===e.weight?t.bolditalic:t.italic:"bold"===e.weight?t.bold:t.regular}class FontInfo{constructor(e,t,a,r){this.lineHeight=a;this.paraMargin=t||{top:0,bottom:0,left:0,right:0};if(!e){[this.pdfFont,this.xfaFont]=this.defaultFont(r);return}this.xfaFont={typeface:e.typeface,posture:e.posture,weight:e.weight,size:e.size,letterSpacing:e.letterSpacing};const i=r.find(e.typeface);if(i){this.pdfFont=selectFont(e,i);this.pdfFont||([this.pdfFont,this.xfaFont]=this.defaultFont(r))}else[this.pdfFont,this.xfaFont]=this.defaultFont(r)}defaultFont(e){const t=e.find("Helvetica",!1)||e.find("Myriad Pro",!1)||e.find("Arial",!1)||e.getDefault();if(t?.regular){const e=t.regular;return[e,{typeface:e.cssFontInfo.fontFamily,posture:"normal",weight:"normal",size:10,letterSpacing:0}]}return[null,{typeface:"Courier",posture:"normal",weight:"normal",size:10,letterSpacing:0}]}}class FontSelector{constructor(e,t,a,r){this.fontFinder=r;this.stack=[new FontInfo(e,t,a,r)]}pushData(e,t,a){const r=this.stack.at(-1);for(const t of["typeface","posture","weight","size","letterSpacing"])e[t]||(e[t]=r.xfaFont[t]);for(const e of["top","bottom","left","right"])isNaN(t[e])&&(t[e]=r.paraMargin[e]);const i=new FontInfo(e,t,a||r.lineHeight,this.fontFinder);i.pdfFont||(i.pdfFont=r.pdfFont);this.stack.push(i)}popFont(){this.stack.pop()}topFont(){return this.stack.at(-1)}}class TextMeasure{constructor(e,t,a,r){this.glyphs=[];this.fontSelector=new FontSelector(e,t,a,r);this.extraHeight=0}pushData(e,t,a){this.fontSelector.pushData(e,t,a)}popFont(e){return this.fontSelector.popFont()}addPara(){const e=this.fontSelector.topFont();this.extraHeight+=e.paraMargin.top+e.paraMargin.bottom}addString(e){if(!e)return;const t=this.fontSelector.topFont(),a=t.xfaFont.size;if(t.pdfFont){const r=t.xfaFont.letterSpacing,i=t.pdfFont,n=i.lineHeight||1.2,s=t.lineHeight||Math.max(1.2,n)*a,o=n-(void 0===i.lineGap?.2:i.lineGap),c=Math.max(1,o)*a,l=a/1e3,h=i.defaultWidth||i.charsToGlyphs(" ")[0].width;for(const t of e.split(/[\\u2029\\n]/)){const e=i.encodeString(t).join(""),a=i.charsToGlyphs(e);for(const e of a){const t=e.width||h;this.glyphs.push([t*l+r,s,c,e.unicode,!1])}this.glyphs.push([0,0,0,"\\n",!0])}this.glyphs.pop()}else{for(const t of e.split(/[\\u2029\\n]/)){for(const e of t.split(""))this.glyphs.push([a,1.2*a,a,e,!1]);this.glyphs.push([0,0,0,"\\n",!0])}this.glyphs.pop()}}compute(e){let t=-1,a=0,r=0,i=0,n=0,s=0,o=!1,c=!0;for(let l=0,h=this.glyphs.length;l<h;l++){const[h,u,d,f,g]=this.glyphs[l],p=" "===f,m=c?d:u;if(g){r=Math.max(r,n);n=0;i+=s;s=m;t=-1;a=0;c=!1}else if(p)if(n+h>e){r=Math.max(r,n);n=0;i+=s;s=m;t=-1;a=0;o=!0;c=!1}else{s=Math.max(m,s);a=n;n+=h;t=l}else if(n+h>e){i+=s;s=m;if(-1!==t){l=t;r=Math.max(r,a);n=0;t=-1;a=0}else{r=Math.max(r,n);n=h}o=!0;c=!1}else{n+=h;s=Math.max(m,s)}}r=Math.max(r,n);i+=s+this.extraHeight;return{width:1.02*r,height:i,isBroken:o}}}const bo=/^[^.[]+/,yo=/^[^\\]]+/,wo=0,xo=1,So=2,Ao=3,ko=4,Co=new Map([["$data",(e,t)=>e.datasets?e.datasets.data:e],["$record",(e,t)=>(e.datasets?e.datasets.data:e)[Ss]()[0]],["$template",(e,t)=>e.template],["$connectionSet",(e,t)=>e.connectionSet],["$form",(e,t)=>e.form],["$layout",(e,t)=>e.layout],["$host",(e,t)=>e.host],["$dataWindow",(e,t)=>e.dataWindow],["$event",(e,t)=>e.event],["!",(e,t)=>e.datasets],["$xfa",(e,t)=>e],["xfa",(e,t)=>e],["$",(e,t)=>t]]),vo=new WeakMap;function parseExpression(e,t,a=!0){let r=e.match(bo);if(!r)return null;let[i]=r;const n=[{name:i,cacheName:"."+i,index:0,js:null,formCalc:null,operator:wo}];let s=i.length;for(;s<e.length;){const c=s;if("["===e.charAt(s++)){r=e.slice(s).match(yo);if(!r){warn("XFA - Invalid index in SOM expression");return null}n.at(-1).index="*"===(o=(o=r[0]).trim())?1/0:parseInt(o,10)||0;s+=r[0].length+1;continue}let l;switch(e.charAt(s)){case".":if(!t)return null;s++;l=xo;break;case"#":s++;l=So;break;case"[":if(a){warn("XFA - SOM expression contains a FormCalc subexpression which is not supported for now.");return null}l=Ao;break;case"(":if(a){warn("XFA - SOM expression contains a JavaScript subexpression which is not supported for now.");return null}l=ko;break;default:l=wo}r=e.slice(s).match(bo);if(!r)break;[i]=r;s+=i.length;n.push({name:i,cacheName:e.slice(c,s),operator:l,index:0,js:null,formCalc:null})}var o;return n}function searchNode(e,t,a,r=!0,i=!0){const n=parseExpression(a,r);if(!n)return null;const s=Co.get(n[0].name);let o,c=0;if(s){o=!0;e=[s(e,t)];c=1}else{o=null===t;e=[t||e]}for(let a=n.length;c<a;c++){const{name:a,cacheName:r,operator:s,index:l}=n[c],h=[];for(const t of e){if(!t.isXFAObject)continue;let e,n;if(i){n=vo.get(t);if(!n){n=new Map;vo.set(t,n)}e=n.get(r)}if(!e){switch(s){case wo:e=t[ms](a,!1);break;case xo:e=t[ms](a,!0);break;case So:e=t[ps](a);e=e.isXFAObjectArray?e.children:[e]}i&&n.set(r,e)}e.length>0&&h.push(e)}if(0!==h.length||o||0!==c)e=isFinite(l)?h.filter((e=>l<e.length)).map((e=>e[l])):h.flat();else{const a=t[vs]();if(!(t=a))return null;c=-1;e=[t]}}return 0===e.length?null:e}function createDataNode(e,t,a){const r=parseExpression(a);if(!r)return null;if(r.some((e=>e.operator===xo)))return null;const i=Co.get(r[0].name);let n=0;if(i){e=i(e,t);n=1}else e=t||e;for(let t=r.length;n<t;n++){const{name:t,operator:a,index:i}=r[n];if(!isFinite(i)){r[n].index=0;return e.createNodes(r.slice(n))}let s;switch(a){case wo:s=e[ms](t,!1);break;case xo:s=e[ms](t,!0);break;case So:s=e[ps](t);s=s.isXFAObjectArray?s.children:[s]}if(0===s.length)return e.createNodes(r.slice(n));if(!(i<s.length)){r[n].index=i-s.length;return e.createNodes(r.slice(n))}{const t=s[i];if(!t.isXFAObject){warn("XFA - Cannot create a node.");return null}e=t}}return null}const Fo=Symbol(),Io=Symbol(),Oo=Symbol(),Mo=Symbol("_children"),Do=Symbol(),Bo=Symbol(),Ro=Symbol(),No=Symbol(),Eo=Symbol(),Po=Symbol(),Lo=Symbol(),jo=Symbol(),_o=Symbol(),Uo=Symbol("parent"),Xo=Symbol(),qo=Symbol(),Ho=Symbol();let Wo=0;const zo=go.datasets.id;class XFAObject{constructor(e,t,a=!1){this[Hs]=e;this[Ws]=t;this[Lo]=a;this[Uo]=null;this[Mo]=[];this[uo]=`${t}${Wo++}`;this[Is]=null}get isXFAObject(){return!0}get isXFAObjectArray(){return!1}createNodes(e){let t=this,a=null;for(const{name:r,index:i}of e){for(let e=0,n=isFinite(i)?i:0;e<=n;e++){const e=t[Hs]===zo?-1:t[Hs];a=new XmlObject(e,r);t[Qn](a)}t=a}return a}[$s](e){if(!this[Lo]||!this[Gs](e))return!1;const t=e[Ws],a=this[t];if(!(a instanceof XFAObjectArray)){null!==a&&this[Zs](a);this[t]=e;this[Qn](e);return!0}if(a.push(e)){this[Qn](e);return!0}let r="";this.id?r=` (id: ${this.id})`:this.name&&(r=` (name: ${this.name} ${this.h.value})`);warn(`XFA - node "${this[Ws]}"${r} has already enough "${t}"!`);return!1}[Gs](e){return this.hasOwnProperty(e[Ws])&&e[Hs]===this[Hs]}[Ls](){return!1}[Yn](){return!1}[Bs](){return!1}[Rs](){return!1}[Js](){this.para&&this[Fs]()[ls].paraStack.pop()}[Ys](){this[Fs]()[ls].paraStack.push(this.para)}[ao](e){this.id&&this[Hs]===go.template.id&&e.set(this.id,this)}[Fs](){return this[Is].template}[js](){return!1}[_s](){return!1}[Qn](e){e[Uo]=this;this[Mo].push(e);!e[Is]&&this[Is]&&(e[Is]=this[Is])}[Zs](e){const t=this[Mo].indexOf(e);this[Mo].splice(t,1)}[Ts](){return this.hasOwnProperty("value")}[io](e){}[Vs](e){}[hs](){}[ts](e){delete this[Lo];if(this[rs]){e.clean(this[rs]);delete this[rs]}}[Ms](e){return this[Mo].indexOf(e)}[Ds](e,t){t[Uo]=this;this[Mo].splice(e,0,t);!t[Is]&&this[Is]&&(t[Is]=this[Is])}[Us](){return!this.name}[qs](){return""}[so](){return 0===this[Mo].length?this[ss]:this[Mo].map((e=>e[so]())).join("")}get[Oo](){const e=Object.getPrototypeOf(this);if(!e._attributes){const t=e._attributes=new Set;for(const e of Object.getOwnPropertyNames(this)){if(null===this[e]||this[e]instanceof XFAObject||this[e]instanceof XFAObjectArray)break;t.add(e)}}return shadow(this,Oo,e._attributes)}[Es](e){let t=this;for(;t;){if(t===e)return!0;t=t[vs]()}return!1}[vs](){return this[Uo]}[Cs](){return this[vs]()}[Ss](e=null){return e?this[e]:this[Mo]}[cs](){const e=Object.create(null);this[ss]&&(e.$content=this[ss]);for(const t of Object.getOwnPropertyNames(this)){const a=this[t];null!==a&&(a instanceof XFAObject?e[t]=a[cs]():a instanceof XFAObjectArray?a.isEmpty()||(e[t]=a.dump()):e[t]=a)}return e}[ho](){return null}[co](){return HTMLResult.EMPTY}*[As](){for(const e of this[Ss]())yield e}*[No](e,t){for(const a of this[As]())if(!e||t===e.has(a[Ws])){const e=this[gs](),t=a[co](e);t.success||(this[ls].failingNode=a);yield t}}[us](){return null}[Zn](e,t){this[ls].children.push(e)}[gs](){}[es]({filter:e=null,include:t=!0}){if(this[ls].generator){const e=this[gs](),t=this[ls].failingNode[co](e);if(!t.success)return t;t.html&&this[Zn](t.html,t.bbox);delete this[ls].failingNode}else this[ls].generator=this[No](e,t);for(;;){const e=this[ls].generator.next();if(e.done)break;const t=e.value;if(!t.success)return t;t.html&&this[Zn](t.html,t.bbox)}this[ls].generator=null;return HTMLResult.EMPTY}[ro](e){this[qo]=new Set(Object.keys(e))}[Po](e){const t=this[Oo],a=this[qo];return[...e].filter((e=>t.has(e)&&!a.has(e)))}[eo](e,t=new Set){for(const a of this[Mo])a[Xo](e,t)}[Xo](e,t){const a=this[Eo](e,t);a?this[Fo](a,e,t):this[eo](e,t)}[Eo](e,t){const{use:a,usehref:r}=this;if(!a&&!r)return null;let i=null,n=null,s=null,o=a;if(r){o=r;r.startsWith("#som(")&&r.endsWith(")")?n=r.slice(5,-1):r.startsWith(".#som(")&&r.endsWith(")")?n=r.slice(6,-1):r.startsWith("#")?s=r.slice(1):r.startsWith(".#")&&(s=r.slice(2))}else a.startsWith("#")?s=a.slice(1):n=a;this.use=this.usehref="";if(s)i=e.get(s);else{i=searchNode(e.get(Qs),this,n,!0,!1);i&&(i=i[0])}if(!i){warn(`XFA - Invalid prototype reference: ${o}.`);return null}if(i[Ws]!==this[Ws]){warn(`XFA - Incompatible prototype: ${i[Ws]} !== ${this[Ws]}.`);return null}if(t.has(i)){warn("XFA - Cycle detected in prototypes use.");return null}t.add(i);const c=i[Eo](e,t);c&&i[Fo](c,e,t);i[eo](e,t);t.delete(i);return i}[Fo](e,t,a){if(a.has(e)){warn("XFA - Cycle detected in prototypes use.");return}!this[ss]&&e[ss]&&(this[ss]=e[ss]);new Set(a).add(e);for(const t of this[Po](e[qo])){this[t]=e[t];this[qo]&&this[qo].add(t)}for(const r of Object.getOwnPropertyNames(this)){if(this[Oo].has(r))continue;const i=this[r],n=e[r];if(i instanceof XFAObjectArray){for(const e of i[Mo])e[Xo](t,a);for(let r=i[Mo].length,s=n[Mo].length;r<s;r++){const n=e[Mo][r][is]();if(!i.push(n))break;n[Uo]=this;this[Mo].push(n);n[Xo](t,a)}}else if(null===i){if(null!==n){const e=n[is]();e[Uo]=this;this[r]=e;this[Mo].push(e);e[Xo](t,a)}}else{i[eo](t,a);n&&i[Fo](n,t,a)}}}static[Do](e){return Array.isArray(e)?e.map((e=>XFAObject[Do](e))):"object"==typeof e&&null!==e?Object.assign({},e):e}[is](){const e=Object.create(Object.getPrototypeOf(this));for(const t of Object.getOwnPropertySymbols(this))try{e[t]=this[t]}catch{shadow(e,t,this[t])}e[uo]=`${e[Ws]}${Wo++}`;e[Mo]=[];for(const t of Object.getOwnPropertyNames(this)){if(this[Oo].has(t)){e[t]=XFAObject[Do](this[t]);continue}const a=this[t];e[t]=a instanceof XFAObjectArray?new XFAObjectArray(a[jo]):null}for(const t of this[Mo]){const a=t[Ws],r=t[is]();e[Mo].push(r);r[Uo]=e;null===e[a]?e[a]=r:e[a][Mo].push(r)}return e}[Ss](e=null){return e?this[Mo].filter((t=>t[Ws]===e)):this[Mo]}[ps](e){return this[e]}[ms](e,t,a=!0){return Array.from(this[bs](e,t,a))}*[bs](e,t,a=!0){if("parent"!==e){for(const a of this[Mo]){a[Ws]===e&&(yield a);a.name===e&&(yield a);(t||a[Us]())&&(yield*a[bs](e,t,!1))}a&&this[Oo].has(e)&&(yield new XFAAttribute(this,e,this[e]))}else yield this[Uo]}}class XFAObjectArray{constructor(e=1/0){this[jo]=e;this[Mo]=[]}get isXFAObject(){return!1}get isXFAObjectArray(){return!0}push(e){if(this[Mo].length<=this[jo]){this[Mo].push(e);return!0}warn(`XFA - node "${e[Ws]}" accepts no more than ${this[jo]} children`);return!1}isEmpty(){return 0===this[Mo].length}dump(){return 1===this[Mo].length?this[Mo][0][cs]():this[Mo].map((e=>e[cs]()))}[is](){const e=new XFAObjectArray(this[jo]);e[Mo]=this[Mo].map((e=>e[is]()));return e}get children(){return this[Mo]}clear(){this[Mo].length=0}}class XFAAttribute{constructor(e,t,a){this[Uo]=e;this[Ws]=t;this[ss]=a;this[ns]=!1;this[uo]="attribute"+Wo++}[vs](){return this[Uo]}[Ns](){return!0}[ys](){return this[ss].trim()}[io](e){e=e.value||"";this[ss]=e.toString()}[so](){return this[ss]}[Es](e){return this[Uo]===e||this[Uo][Es](e)}}class XmlObject extends XFAObject{constructor(e,t,a={}){super(e,t);this[ss]="";this[Bo]=null;if("#text"!==t){const e=new Map;this[Io]=e;for(const[t,r]of Object.entries(a))e.set(t,new XFAAttribute(this,t,r));if(a.hasOwnProperty(zs)){const e=a[zs].xfa.dataNode;void 0!==e&&("dataGroup"===e?this[Bo]=!1:"dataValue"===e&&(this[Bo]=!0))}}this[ns]=!1}[lo](e){const t=this[Ws];if("#text"===t){e.push(encodeToXmlString(this[ss]));return}const a=utf8StringToString(t),r=this[Hs]===zo?"xfa:":"";e.push(`<${r}${a}`);for(const[t,a]of this[Io].entries()){const r=utf8StringToString(t);e.push(` ${r}="${encodeToXmlString(a[ss])}"`)}null!==this[Bo]&&(this[Bo]?e.push(\' xfa:dataNode="dataValue"\'):e.push(\' xfa:dataNode="dataGroup"\'));if(this[ss]||0!==this[Mo].length){e.push(">");if(this[ss])"string"==typeof this[ss]?e.push(encodeToXmlString(this[ss])):this[ss][lo](e);else for(const t of this[Mo])t[lo](e);e.push(`</${r}${a}>`)}else e.push("/>")}[$s](e){if(this[ss]){const e=new XmlObject(this[Hs],"#text");this[Qn](e);e[ss]=this[ss];this[ss]=""}this[Qn](e);return!0}[Vs](e){this[ss]+=e}[hs](){if(this[ss]&&this[Mo].length>0){const e=new XmlObject(this[Hs],"#text");this[Qn](e);e[ss]=this[ss];delete this[ss]}}[co](){return"#text"===this[Ws]?HTMLResult.success({name:"#text",value:this[ss]}):HTMLResult.EMPTY}[Ss](e=null){return e?this[Mo].filter((t=>t[Ws]===e)):this[Mo]}[fs](){return this[Io]}[ps](e){const t=this[Io].get(e);return void 0!==t?t:this[Ss](e)}*[bs](e,t){const a=this[Io].get(e);a&&(yield a);for(const a of this[Mo]){a[Ws]===e&&(yield a);t&&(yield*a[bs](e,t))}}*[ds](e,t){const a=this[Io].get(e);!a||t&&a[ns]||(yield a);for(const a of this[Mo])yield*a[ds](e,t)}*[xs](e,t,a){for(const r of this[Mo]){r[Ws]!==e||a&&r[ns]||(yield r);t&&(yield*r[xs](e,t,a))}}[Ns](){return null===this[Bo]?0===this[Mo].length||this[Mo][0][Hs]===go.xhtml.id:this[Bo]}[ys](){return null===this[Bo]?0===this[Mo].length?this[ss].trim():this[Mo][0][Hs]===go.xhtml.id?this[Mo][0][so]().trim():null:this[ss].trim()}[io](e){e=e.value||"";this[ss]=e.toString()}[cs](e=!1){const t=Object.create(null);e&&(t.$ns=this[Hs]);this[ss]&&(t.$content=this[ss]);t.$name=this[Ws];t.children=[];for(const a of this[Mo])t.children.push(a[cs](e));t.attributes=Object.create(null);for(const[e,a]of this[Io])t.attributes[e]=a[ss];return t}}class ContentObject extends XFAObject{constructor(e,t){super(e,t);this[ss]=""}[Vs](e){this[ss]+=e}[hs](){}}class OptionObject extends ContentObject{constructor(e,t,a){super(e,t);this[_o]=a}[hs](){this[ss]=getKeyword({data:this[ss],defaultValue:this[_o][0],validate:e=>this[_o].includes(e)})}[ts](e){super[ts](e);delete this[_o]}}class StringObject extends ContentObject{[hs](){this[ss]=this[ss].trim()}}class IntegerObject extends ContentObject{constructor(e,t,a,r){super(e,t);this[Ro]=a;this[Ho]=r}[hs](){this[ss]=getInteger({data:this[ss],defaultValue:this[Ro],validate:this[Ho]})}[ts](e){super[ts](e);delete this[Ro];delete this[Ho]}}class Option01 extends IntegerObject{constructor(e,t){super(e,t,0,(e=>1===e))}}class Option10 extends IntegerObject{constructor(e,t){super(e,t,1,(e=>0===e))}}function measureToString(e){return"string"==typeof e?"0px":Number.isInteger(e)?`${e}px`:`${e.toFixed(2)}px`}const $o={anchorType(e,t){const a=e[Cs]();if(a&&(!a.layout||"position"===a.layout)){"transform"in t||(t.transform="");switch(e.anchorType){case"bottomCenter":t.transform+="translate(-50%, -100%)";break;case"bottomLeft":t.transform+="translate(0,-100%)";break;case"bottomRight":t.transform+="translate(-100%,-100%)";break;case"middleCenter":t.transform+="translate(-50%,-50%)";break;case"middleLeft":t.transform+="translate(0,-50%)";break;case"middleRight":t.transform+="translate(-100%,-50%)";break;case"topCenter":t.transform+="translate(-50%,0)";break;case"topRight":t.transform+="translate(-100%,0)"}}},dimensions(e,t){const a=e[Cs]();let r=e.w;const i=e.h;if(a.layout?.includes("row")){const t=a[ls],i=e.colSpan;let n;if(-1===i){n=Math.sumPrecise(t.columnWidths.slice(t.currentColumn));t.currentColumn=0}else{n=Math.sumPrecise(t.columnWidths.slice(t.currentColumn,t.currentColumn+i));t.currentColumn=(t.currentColumn+e.colSpan)%t.columnWidths.length}isNaN(n)||(r=e.w=n)}t.width=""!==r?measureToString(r):"auto";t.height=""!==i?measureToString(i):"auto"},position(e,t){const a=e[Cs]();if(!a?.layout||"position"===a.layout){t.position="absolute";t.left=measureToString(e.x);t.top=measureToString(e.y)}},rotate(e,t){if(e.rotate){"transform"in t||(t.transform="");t.transform+=`rotate(-${e.rotate}deg)`;t.transformOrigin="top left"}},presence(e,t){switch(e.presence){case"invisible":t.visibility="hidden";break;case"hidden":case"inactive":t.display="none"}},hAlign(e,t){if("para"===e[Ws])switch(e.hAlign){case"justifyAll":t.textAlign="justify-all";break;case"radix":t.textAlign="left";break;default:t.textAlign=e.hAlign}else switch(e.hAlign){case"left":t.alignSelf="start";break;case"center":t.alignSelf="center";break;case"right":t.alignSelf="end"}},margin(e,t){e.margin&&(t.margin=e.margin[ho]().margin)}};function setMinMaxDimensions(e,t){if("position"===e[Cs]().layout){e.minW>0&&(t.minWidth=measureToString(e.minW));e.maxW>0&&(t.maxWidth=measureToString(e.maxW));e.minH>0&&(t.minHeight=measureToString(e.minH));e.maxH>0&&(t.maxHeight=measureToString(e.maxH))}}function layoutText(e,t,a,r,i,n){const s=new TextMeasure(t,a,r,i);"string"==typeof e?s.addString(e):e[Ks](s);return s.compute(n)}function layoutNode(e,t){let a=null,r=null,i=!1;if((!e.w||!e.h)&&e.value){let n=0,s=0;if(e.margin){n=e.margin.leftInset+e.margin.rightInset;s=e.margin.topInset+e.margin.bottomInset}let o=null,c=null;if(e.para){c=Object.create(null);o=""===e.para.lineHeight?null:e.para.lineHeight;c.top=""===e.para.spaceAbove?0:e.para.spaceAbove;c.bottom=""===e.para.spaceBelow?0:e.para.spaceBelow;c.left=""===e.para.marginLeft?0:e.para.marginLeft;c.right=""===e.para.marginRight?0:e.para.marginRight}let l=e.font;if(!l){const t=e[Fs]();let a=e[vs]();for(;a&&a!==t;){if(a.font){l=a.font;break}a=a[vs]()}}const h=(e.w||t.width)-n,u=e[Is].fontFinder;if(e.value.exData&&e.value.exData[ss]&&"text/html"===e.value.exData.contentType){const t=layoutText(e.value.exData[ss],l,c,o,u,h);r=t.width;a=t.height;i=t.isBroken}else{const t=e.value[so]();if(t){const e=layoutText(t,l,c,o,u,h);r=e.width;a=e.height;i=e.isBroken}}null===r||e.w||(r+=n);null===a||e.h||(a+=s)}return{w:r,h:a,isBroken:i}}function computeBbox(e,t,a){let r;if(""!==e.w&&""!==e.h)r=[e.x,e.y,e.w,e.h];else{if(!a)return null;let i=e.w;if(""===i){if(0===e.maxW){const t=e[Cs]();i="position"===t.layout&&""!==t.w?0:e.minW}else i=Math.min(e.maxW,a.width);t.attributes.style.width=measureToString(i)}let n=e.h;if(""===n){if(0===e.maxH){const t=e[Cs]();n="position"===t.layout&&""!==t.h?0:e.minH}else n=Math.min(e.maxH,a.height);t.attributes.style.height=measureToString(n)}r=[e.x,e.y,i,n]}return r}function fixDimensions(e){const t=e[Cs]();if(t.layout?.includes("row")){const a=t[ls],r=e.colSpan;let i;i=-1===r?Math.sumPrecise(a.columnWidths.slice(a.currentColumn)):Math.sumPrecise(a.columnWidths.slice(a.currentColumn,a.currentColumn+r));isNaN(i)||(e.w=i)}t.layout&&"position"!==t.layout&&(e.x=e.y=0);"table"===e.layout&&""===e.w&&Array.isArray(e.columnWidths)&&(e.w=Math.sumPrecise(e.columnWidths))}function layoutClass(e){switch(e.layout){case"position":default:return"xfaPosition";case"lr-tb":return"xfaLrTb";case"rl-row":return"xfaRlRow";case"rl-tb":return"xfaRlTb";case"row":return"xfaRow";case"table":return"xfaTable";case"tb":return"xfaTb"}}function toStyle(e,...t){const a=Object.create(null);for(const r of t){const t=e[r];if(null!==t)if($o.hasOwnProperty(r))$o[r](e,a);else if(t instanceof XFAObject){const e=t[ho]();e?Object.assign(a,e):warn(`(DEBUG) - XFA - style for ${r} not implemented yet`)}}return a}function createWrapper(e,t){const{attributes:a}=t,{style:r}=a,i={name:"div",attributes:{class:["xfaWrapper"],style:Object.create(null)},children:[]};a.class.push("xfaWrapped");if(e.border){const{widths:a,insets:n}=e.border[ls];let s,o,c=n[0],l=n[3];const h=n[0]+n[2],u=n[1]+n[3];switch(e.border.hand){case"even":c-=a[0]/2;l-=a[3]/2;s=`calc(100% + ${(a[1]+a[3])/2-u}px)`;o=`calc(100% + ${(a[0]+a[2])/2-h}px)`;break;case"left":c-=a[0];l-=a[3];s=`calc(100% + ${a[1]+a[3]-u}px)`;o=`calc(100% + ${a[0]+a[2]-h}px)`;break;case"right":s=u?`calc(100% - ${u}px)`:"100%";o=h?`calc(100% - ${h}px)`:"100%"}const d=["xfaBorder"];isPrintOnly(e.border)&&d.push("xfaPrintOnly");const f={name:"div",attributes:{class:d,style:{top:`${c}px`,left:`${l}px`,width:s,height:o}},children:[]};for(const e of["border","borderWidth","borderColor","borderRadius","borderStyle"])if(void 0!==r[e]){f.attributes.style[e]=r[e];delete r[e]}i.children.push(f,t)}else i.children.push(t);for(const e of["background","backgroundClip","top","left","width","height","minWidth","minHeight","maxWidth","maxHeight","transform","transformOrigin","visibility"])if(void 0!==r[e]){i.attributes.style[e]=r[e];delete r[e]}i.attributes.style.position="absolute"===r.position?"absolute":"relative";delete r.position;if(r.alignSelf){i.attributes.style.alignSelf=r.alignSelf;delete r.alignSelf}return i}function fixTextIndent(e){const t=getMeasurement(e.textIndent,"0px");if(t>=0)return;const a="padding"+("left"===("right"===e.textAlign?"right":"left")?"Left":"Right"),r=getMeasurement(e[a],"0px");e[a]=r-t+"px"}function setAccess(e,t){switch(e.access){case"nonInteractive":t.push("xfaNonInteractive");break;case"readOnly":t.push("xfaReadOnly");break;case"protected":t.push("xfaDisabled")}}function isPrintOnly(e){return e.relevant.length>0&&!e.relevant[0].excluded&&"print"===e.relevant[0].viewname}function getCurrentPara(e){const t=e[Fs]()[ls].paraStack;return t.length?t.at(-1):null}function setPara(e,t,a){if(a.attributes.class?.includes("xfaRich")){if(t){""===e.h&&(t.height="auto");""===e.w&&(t.width="auto")}const r=getCurrentPara(e);if(r){const e=a.attributes.style;e.display="flex";e.flexDirection="column";switch(r.vAlign){case"top":e.justifyContent="start";break;case"bottom":e.justifyContent="end";break;case"middle":e.justifyContent="center"}const t=r[ho]();for(const[a,r]of Object.entries(t))a in e||(e[a]=r)}}}function setFontFamily(e,t,a,r){if(!a){delete r.fontFamily;return}const i=stripQuotes(e.typeface);r.fontFamily=`"${i}"`;const n=a.find(i);if(n){const{fontFamily:a}=n.regular.cssFontInfo;a!==i&&(r.fontFamily=`"${a}"`);const s=getCurrentPara(t);if(s&&""!==s.lineHeight)return;if(r.lineHeight)return;const o=selectFont(e,n);o&&(r.lineHeight=Math.max(1.2,o.lineHeight))}}function fixURL(e){const t=createValidAbsoluteUrl(e,null,{addDefaultProtocol:!0,tryConvertEncoding:!0});return t?t.href:null}function createLine(e,t){return{name:"div",attributes:{class:["lr-tb"===e.layout?"xfaLr":"xfaRl"]},children:t}}function flushHTML(e){if(!e[ls])return null;const t={name:"div",attributes:e[ls].attributes,children:e[ls].children};if(e[ls].failingNode){const a=e[ls].failingNode[us]();a&&(e.layout.endsWith("-tb")?t.children.push(createLine(e,[a])):t.children.push(a))}return 0===t.children.length?null:t}function addHTML(e,t,a){const r=e[ls],i=r.availableSpace,[n,s,o,c]=a;switch(e.layout){case"position":r.width=Math.max(r.width,n+o);r.height=Math.max(r.height,s+c);r.children.push(t);break;case"lr-tb":case"rl-tb":if(!r.line||1===r.attempt){r.line=createLine(e,[]);r.children.push(r.line);r.numberInLine=0}r.numberInLine+=1;r.line.children.push(t);if(0===r.attempt){r.currentWidth+=o;r.height=Math.max(r.height,r.prevHeight+c)}else{r.currentWidth=o;r.prevHeight=r.height;r.height+=c;r.attempt=0}r.width=Math.max(r.width,r.currentWidth);break;case"rl-row":case"row":{r.children.push(t);r.width+=o;r.height=Math.max(r.height,c);const e=measureToString(r.height);for(const t of r.children)t.attributes.style.height=e;break}case"table":case"tb":r.width=MathClamp(o,r.width,i.width);r.height+=c;r.children.push(t)}}function getAvailableSpace(e){const t=e[ls].availableSpace,a=e.margin?e.margin.topInset+e.margin.bottomInset:0,r=e.margin?e.margin.leftInset+e.margin.rightInset:0;switch(e.layout){case"lr-tb":case"rl-tb":return 0===e[ls].attempt?{width:t.width-r-e[ls].currentWidth,height:t.height-a-e[ls].prevHeight}:{width:t.width-r,height:t.height-a-e[ls].height};case"rl-row":case"row":return{width:Math.sumPrecise(e[ls].columnWidths.slice(e[ls].currentColumn)),height:t.height-r};case"table":case"tb":return{width:t.width-r,height:t.height-a-e[ls].height};default:return t}}function checkDimensions(e,t){if(null===e[Fs]()[ls].firstUnsplittable)return!0;if(0===e.w||0===e.h)return!0;const a=e[Cs](),r=a[ls]?.attempt||0,[,i,n,s]=function getTransformedBBox(e){let t,a,r=""===e.w?NaN:e.w,i=""===e.h?NaN:e.h,[n,s]=[0,0];switch(e.anchorType||""){case"bottomCenter":[n,s]=[r/2,i];break;case"bottomLeft":[n,s]=[0,i];break;case"bottomRight":[n,s]=[r,i];break;case"middleCenter":[n,s]=[r/2,i/2];break;case"middleLeft":[n,s]=[0,i/2];break;case"middleRight":[n,s]=[r,i/2];break;case"topCenter":[n,s]=[r/2,0];break;case"topRight":[n,s]=[r,0]}switch(e.rotate||0){case 0:[t,a]=[-n,-s];break;case 90:[t,a]=[-s,n];[r,i]=[i,-r];break;case 180:[t,a]=[n,s];[r,i]=[-r,-i];break;case 270:[t,a]=[s,-n];[r,i]=[-i,r]}return[e.x+t+Math.min(0,r),e.y+a+Math.min(0,i),Math.abs(r),Math.abs(i)]}(e);switch(a.layout){case"lr-tb":case"rl-tb":return 0===r?e[Fs]()[ls].noLayoutFailure?""!==e.w?Math.round(n-t.width)<=2:t.width>2:!(""!==e.h&&Math.round(s-t.height)>2)&&(""!==e.w?Math.round(n-t.width)<=2||0===a[ls].numberInLine&&t.height>2:t.width>2):!!e[Fs]()[ls].noLayoutFailure||!(""!==e.h&&Math.round(s-t.height)>2)&&((""===e.w||Math.round(n-t.width)<=2||!a[_s]())&&t.height>2);case"table":case"tb":return!!e[Fs]()[ls].noLayoutFailure||(""===e.h||e[js]()?(""===e.w||Math.round(n-t.width)<=2||!a[_s]())&&t.height>2:Math.round(s-t.height)<=2);case"position":if(e[Fs]()[ls].noLayoutFailure)return!0;if(""===e.h||Math.round(s+i-t.height)<=2)return!0;return s+i>e[Fs]()[ls].currentContentArea.h;case"rl-row":case"row":return!!e[Fs]()[ls].noLayoutFailure||(""===e.h||Math.round(s-t.height)<=2);default:return!0}}const Go=go.template.id,Vo="http://www.w3.org/2000/svg",Ko=/^H(\\d+)$/,Jo=new Set(["image/gif","image/jpeg","image/jpg","image/pjpeg","image/png","image/apng","image/x-png","image/bmp","image/x-ms-bmp","image/tiff","image/tif","application/octet-stream"]),Yo=[[[66,77],"image/bmp"],[[255,216,255],"image/jpeg"],[[73,73,42,0],"image/tiff"],[[77,77,0,42],"image/tiff"],[[71,73,70,56,57,97],"image/gif"],[[137,80,78,71,13,10,26,10],"image/png"]];function getBorderDims(e){if(!e||!e.border)return{w:0,h:0};const t=e.border[ws]();return t?{w:t.widths[0]+t.widths[2]+t.insets[0]+t.insets[2],h:t.widths[1]+t.widths[3]+t.insets[1]+t.insets[3]}:{w:0,h:0}}function hasMargin(e){return e.margin&&(e.margin.topInset||e.margin.rightInset||e.margin.bottomInset||e.margin.leftInset)}function _setValue(e,t){if(!e.value){const t=new Value({});e[Qn](t);e.value=t}e.value[io](t)}function*getContainedChildren(e){for(const t of e[Ss]())t instanceof SubformSet?yield*t[As]():yield t}function isRequired(e){return"error"===e.validate?.nullTest}function setTabIndex(e){for(;e;){if(!e.traversal){e[no]=e[vs]()[no];return}if(e[no])return;let t=null;for(const a of e.traversal[Ss]())if("next"===a.operation){t=a;break}if(!t||!t.ref){e[no]=e[vs]()[no];return}const a=e[Fs]();e[no]=++a[no];const r=a[to](t.ref,e);if(!r)return;e=r[0]}}function applyAssist(e,t){const a=e.assist;if(a){const e=a[co]();e&&(t.title=e);const r=a.role.match(Ko);if(r){const e="heading",a=r[1];t.role=e;t["aria-level"]=a}}if("table"===e.layout)t.role="table";else if("row"===e.layout)t.role="row";else{const a=e[vs]();"row"===a.layout&&(t.role="TH"===a.assist?.role?"columnheader":"cell")}}function ariaLabel(e){if(!e.assist)return null;const t=e.assist;return t.speak&&""!==t.speak[ss]?t.speak[ss]:t.toolTip?t.toolTip[ss]:null}function valueToHtml(e){return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:Object.create(null)},children:[{name:"span",attributes:{style:Object.create(null)},value:e}]})}function setFirstUnsplittable(e){const t=e[Fs]();if(null===t[ls].firstUnsplittable){t[ls].firstUnsplittable=e;t[ls].noLayoutFailure=!0}}function unsetFirstUnsplittable(e){const t=e[Fs]();t[ls].firstUnsplittable===e&&(t[ls].noLayoutFailure=!1)}function handleBreak(e){if(e[ls])return!1;e[ls]=Object.create(null);if("auto"===e.targetType)return!1;const t=e[Fs]();let a=null;if(e.target){a=t[to](e.target,e[vs]());if(!a)return!1;a=a[0]}const{currentPageArea:r,currentContentArea:i}=t[ls];if("pageArea"===e.targetType){a instanceof PageArea||(a=null);if(e.startNew){e[ls].target=a||r;return!0}if(a&&a!==r){e[ls].target=a;return!0}return!1}a instanceof ContentArea||(a=null);const n=a&&a[vs]();let s,o=n;if(e.startNew)if(a){const e=n.contentArea.children,t=e.indexOf(i),r=e.indexOf(a);-1!==t&&t<r&&(o=null);s=r-1}else s=r.contentArea.children.indexOf(i);else{if(!a||a===i)return!1;s=n.contentArea.children.indexOf(a)-1;o=n===r?null:n}e[ls].target=o;e[ls].index=s;return!0}function handleOverflow(e,t,a){const r=e[Fs](),i=r[ls].noLayoutFailure,n=t[Cs];t[Cs]=()=>e;r[ls].noLayoutFailure=!0;const s=t[co](a);e[Zn](s.html,s.bbox);r[ls].noLayoutFailure=i;t[Cs]=n}class AppearanceFilter extends StringObject{constructor(e){super(Go,"appearanceFilter");this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Arc extends XFAObject{constructor(e){super(Go,"arc",!0);this.circular=getInteger({data:e.circular,defaultValue:0,validate:e=>1===e});this.hand=getStringOption(e.hand,["even","left","right"]);this.id=e.id||"";this.startAngle=getFloat({data:e.startAngle,defaultValue:0,validate:e=>!0});this.sweepAngle=getFloat({data:e.sweepAngle,defaultValue:360,validate:e=>!0});this.use=e.use||"";this.usehref=e.usehref||"";this.edge=null;this.fill=null}[co](){const e=this.edge||new Edge({}),t=e[ho](),a=Object.create(null);"visible"===this.fill?.presence?Object.assign(a,this.fill[ho]()):a.fill="transparent";a.strokeWidth=measureToString("visible"===e.presence?e.thickness:0);a.stroke=t.color;let r;const i={xmlns:Vo,style:{width:"100%",height:"100%",overflow:"visible"}};if(360===this.sweepAngle)r={name:"ellipse",attributes:{xmlns:Vo,cx:"50%",cy:"50%",rx:"50%",ry:"50%",style:a}};else{const e=this.startAngle*Math.PI/180,t=this.sweepAngle*Math.PI/180,n=this.sweepAngle>180?1:0,[s,o,c,l]=[50*(1+Math.cos(e)),50*(1-Math.sin(e)),50*(1+Math.cos(e+t)),50*(1-Math.sin(e+t))];r={name:"path",attributes:{xmlns:Vo,d:`M ${s} ${o} A 50 50 0 ${n} 0 ${c} ${l}`,vectorEffect:"non-scaling-stroke",style:a}};Object.assign(i,{viewBox:"0 0 100 100",preserveAspectRatio:"none"})}const n={name:"svg",children:[r],attributes:i};if(hasMargin(this[vs]()[vs]()))return HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[n]});n.attributes.style.position="absolute";return HTMLResult.success(n)}}class Area extends XFAObject{constructor(e){super(Go,"area",!0);this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.id=e.id||"";this.name=e.name||"";this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.y,"0pt");this.desc=null;this.extras=null;this.area=new XFAObjectArray;this.draw=new XFAObjectArray;this.exObject=new XFAObjectArray;this.exclGroup=new XFAObjectArray;this.field=new XFAObjectArray;this.subform=new XFAObjectArray;this.subformSet=new XFAObjectArray}*[As](){yield*getContainedChildren(this)}[Us](){return!0}[Rs](){return!0}[Zn](e,t){const[a,r,i,n]=t;this[ls].width=Math.max(this[ls].width,a+i);this[ls].height=Math.max(this[ls].height,r+n);this[ls].children.push(e)}[gs](){return this[ls].availableSpace}[co](e){const t=toStyle(this,"position"),a={style:t,id:this[uo],class:["xfaArea"]};isPrintOnly(this)&&a.class.push("xfaPrintOnly");this.name&&(a.xfaName=this.name);const r=[];this[ls]={children:r,width:0,height:0,availableSpace:e};const i=this[es]({filter:new Set(["area","draw","field","exclGroup","subform","subformSet"]),include:!0});if(!i.success){if(i.isBreak())return i;delete this[ls];return HTMLResult.FAILURE}t.width=measureToString(this[ls].width);t.height=measureToString(this[ls].height);const n={name:"div",attributes:a,children:r},s=[this.x,this.y,this[ls].width,this[ls].height];delete this[ls];return HTMLResult.success(n,s)}}class Assist extends XFAObject{constructor(e){super(Go,"assist",!0);this.id=e.id||"";this.role=e.role||"";this.use=e.use||"";this.usehref=e.usehref||"";this.speak=null;this.toolTip=null}[co](){return this.toolTip?.[ss]||null}}class Barcode extends XFAObject{constructor(e){super(Go,"barcode",!0);this.charEncoding=getKeyword({data:e.charEncoding?e.charEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\\d{2}/)});this.checksum=getStringOption(e.checksum,["none","1mod10","1mod10_1mod11","2mod10","auto"]);this.dataColumnCount=getInteger({data:e.dataColumnCount,defaultValue:-1,validate:e=>e>=0});this.dataLength=getInteger({data:e.dataLength,defaultValue:-1,validate:e=>e>=0});this.dataPrep=getStringOption(e.dataPrep,["none","flateCompress"]);this.dataRowCount=getInteger({data:e.dataRowCount,defaultValue:-1,validate:e=>e>=0});this.endChar=e.endChar||"";this.errorCorrectionLevel=getInteger({data:e.errorCorrectionLevel,defaultValue:-1,validate:e=>e>=0&&e<=8});this.id=e.id||"";this.moduleHeight=getMeasurement(e.moduleHeight,"5mm");this.moduleWidth=getMeasurement(e.moduleWidth,"0.25mm");this.printCheckDigit=getInteger({data:e.printCheckDigit,defaultValue:0,validate:e=>1===e});this.rowColumnRatio=getRatio(e.rowColumnRatio);this.startChar=e.startChar||"";this.textLocation=getStringOption(e.textLocation,["below","above","aboveEmbedded","belowEmbedded","none"]);this.truncate=getInteger({data:e.truncate,defaultValue:0,validate:e=>1===e});this.type=getStringOption(e.type?e.type.toLowerCase():"",["aztec","codabar","code2of5industrial","code2of5interleaved","code2of5matrix","code2of5standard","code3of9","code3of9extended","code11","code49","code93","code128","code128a","code128b","code128c","code128sscc","datamatrix","ean8","ean8add2","ean8add5","ean13","ean13add2","ean13add5","ean13pwcd","fim","logmars","maxicode","msi","pdf417","pdf417macro","plessey","postauscust2","postauscust3","postausreplypaid","postausstandard","postukrm4scc","postusdpbc","postusimb","postusstandard","postus5zip","qrcode","rfid","rss14","rss14expanded","rss14limited","rss14stacked","rss14stackedomni","rss14truncated","telepen","ucc128","ucc128random","ucc128sscc","upca","upcaadd2","upcaadd5","upcapwcd","upce","upceadd2","upceadd5","upcean2","upcean5","upsmaxicode"]);this.upsMode=getStringOption(e.upsMode,["usCarrier","internationalCarrier","secureSymbol","standardSymbol"]);this.use=e.use||"";this.usehref=e.usehref||"";this.wideNarrowRatio=getRatio(e.wideNarrowRatio);this.encrypt=null;this.extras=null}}class Bind extends XFAObject{constructor(e){super(Go,"bind",!0);this.match=getStringOption(e.match,["once","dataRef","global","none"]);this.ref=e.ref||"";this.picture=null}}class BindItems extends XFAObject{constructor(e){super(Go,"bindItems");this.connection=e.connection||"";this.labelRef=e.labelRef||"";this.ref=e.ref||"";this.valueRef=e.valueRef||""}}class Bookend extends XFAObject{constructor(e){super(Go,"bookend");this.id=e.id||"";this.leader=e.leader||"";this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||""}}class BooleanElement extends Option01{constructor(e){super(Go,"boolean");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[co](e){return valueToHtml(1===this[ss]?"1":"0")}}class Border extends XFAObject{constructor(e){super(Go,"border",!0);this.break=getStringOption(e.break,["close","open"]);this.hand=getStringOption(e.hand,["even","left","right"]);this.id=e.id||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.corner=new XFAObjectArray(4);this.edge=new XFAObjectArray(4);this.extras=null;this.fill=null;this.margin=null}[ws](){if(!this[ls]){const e=this.edge.children.slice();if(e.length<4){const t=e.at(-1)||new Edge({});for(let a=e.length;a<4;a++)e.push(t)}const t=e.map((e=>e.thickness)),a=[0,0,0,0];if(this.margin){a[0]=this.margin.topInset;a[1]=this.margin.rightInset;a[2]=this.margin.bottomInset;a[3]=this.margin.leftInset}this[ls]={widths:t,insets:a,edges:e}}return this[ls]}[ho](){const{edges:e}=this[ws](),t=e.map((e=>{const t=e[ho]();t.color||="#000000";return t})),a=Object.create(null);this.margin&&Object.assign(a,this.margin[ho]());"visible"===this.fill?.presence&&Object.assign(a,this.fill[ho]());if(this.corner.children.some((e=>0!==e.radius))){const e=this.corner.children.map((e=>e[ho]()));if(2===e.length||3===e.length){const t=e.at(-1);for(let a=e.length;a<4;a++)e.push(t)}a.borderRadius=e.map((e=>e.radius)).join(" ")}switch(this.presence){case"invisible":case"hidden":a.borderStyle="";break;case"inactive":a.borderStyle="none";break;default:a.borderStyle=t.map((e=>e.style)).join(" ")}a.borderWidth=t.map((e=>e.width)).join(" ");a.borderColor=t.map((e=>e.color)).join(" ");return a}}class Break extends XFAObject{constructor(e){super(Go,"break",!0);this.after=getStringOption(e.after,["auto","contentArea","pageArea","pageEven","pageOdd"]);this.afterTarget=e.afterTarget||"";this.before=getStringOption(e.before,["auto","contentArea","pageArea","pageEven","pageOdd"]);this.beforeTarget=e.beforeTarget||"";this.bookendLeader=e.bookendLeader||"";this.bookendTrailer=e.bookendTrailer||"";this.id=e.id||"";this.overflowLeader=e.overflowLeader||"";this.overflowTarget=e.overflowTarget||"";this.overflowTrailer=e.overflowTrailer||"";this.startNew=getInteger({data:e.startNew,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class BreakAfter extends XFAObject{constructor(e){super(Go,"breakAfter",!0);this.id=e.id||"";this.leader=e.leader||"";this.startNew=getInteger({data:e.startNew,defaultValue:0,validate:e=>1===e});this.target=e.target||"";this.targetType=getStringOption(e.targetType,["auto","contentArea","pageArea"]);this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||"";this.script=null}}class BreakBefore extends XFAObject{constructor(e){super(Go,"breakBefore",!0);this.id=e.id||"";this.leader=e.leader||"";this.startNew=getInteger({data:e.startNew,defaultValue:0,validate:e=>1===e});this.target=e.target||"";this.targetType=getStringOption(e.targetType,["auto","contentArea","pageArea"]);this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||"";this.script=null}[co](e){this[ls]={};return HTMLResult.FAILURE}}class Button extends XFAObject{constructor(e){super(Go,"button",!0);this.highlight=getStringOption(e.highlight,["inverted","none","outline","push"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[co](e){const t=this[vs]()[vs](),a={name:"button",attributes:{id:this[uo],class:["xfaButton"],style:{}},children:[]};for(const e of t.event.children){if("click"!==e.activity||!e.script)continue;const t=recoverJsURL(e.script[ss]);if(!t)continue;const r=fixURL(t.url);r&&a.children.push({name:"a",attributes:{id:"link"+this[uo],href:r,newWindow:t.newWindow,class:["xfaLink"],style:{}},children:[]})}return HTMLResult.success(a)}}class Calculate extends XFAObject{constructor(e){super(Go,"calculate",!0);this.id=e.id||"";this.override=getStringOption(e.override,["disabled","error","ignore","warning"]);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.message=null;this.script=null}}class Caption extends XFAObject{constructor(e){super(Go,"caption",!0);this.id=e.id||"";this.placement=getStringOption(e.placement,["left","bottom","inline","right","top"]);this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.reserve=Math.ceil(getMeasurement(e.reserve));this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.font=null;this.margin=null;this.para=null;this.value=null}[io](e){_setValue(this,e)}[ws](e){if(!this[ls]){let{width:t,height:a}=e;switch(this.placement){case"left":case"right":case"inline":t=this.reserve<=0?t:this.reserve;break;case"top":case"bottom":a=this.reserve<=0?a:this.reserve}this[ls]=layoutNode(this,{width:t,height:a})}return this[ls]}[co](e){if(!this.value)return HTMLResult.EMPTY;this[Ys]();const t=this.value[co](e).html;if(!t){this[Js]();return HTMLResult.EMPTY}const a=this.reserve;if(this.reserve<=0){const{w:t,h:a}=this[ws](e);switch(this.placement){case"left":case"right":case"inline":this.reserve=t;break;case"top":case"bottom":this.reserve=a}}const r=[];"string"==typeof t?r.push({name:"#text",value:t}):r.push(t);const i=toStyle(this,"font","margin","visibility");switch(this.placement){case"left":case"right":this.reserve>0&&(i.width=measureToString(this.reserve));break;case"top":case"bottom":this.reserve>0&&(i.height=measureToString(this.reserve))}setPara(this,null,t);this[Js]();this.reserve=a;return HTMLResult.success({name:"div",attributes:{style:i,class:["xfaCaption"]},children:r})}}class Certificate extends StringObject{constructor(e){super(Go,"certificate");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Certificates extends XFAObject{constructor(e){super(Go,"certificates",!0);this.credentialServerPolicy=getStringOption(e.credentialServerPolicy,["optional","required"]);this.id=e.id||"";this.url=e.url||"";this.urlPolicy=e.urlPolicy||"";this.use=e.use||"";this.usehref=e.usehref||"";this.encryption=null;this.issuers=null;this.keyUsage=null;this.oids=null;this.signing=null;this.subjectDNs=null}}class CheckButton extends XFAObject{constructor(e){super(Go,"checkButton",!0);this.id=e.id||"";this.mark=getStringOption(e.mark,["default","check","circle","cross","diamond","square","star"]);this.shape=getStringOption(e.shape,["square","round"]);this.size=getMeasurement(e.size,"10pt");this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[co](e){const t=toStyle(this,"margin"),a=measureToString(this.size);t.width=t.height=a;let r,i,n;const s=this[vs]()[vs](),o=s.items.children.length&&s.items.children[0][co]().html||[],c={on:(void 0!==o[0]?o[0]:"on").toString(),off:(void 0!==o[1]?o[1]:"off").toString()},l=(s.value?.[so]()||"off")===c.on||void 0,h=s[Cs](),u=s[uo];let d;if(h instanceof ExclGroup){n=h[uo];r="radio";i="xfaRadio";d=h[os]?.[uo]||h[uo]}else{r="checkbox";i="xfaCheckbox";d=s[os]?.[uo]||s[uo]}const f={name:"input",attributes:{class:[i],style:t,fieldId:u,dataId:d,type:r,checked:l,xfaOn:c.on,xfaOff:c.off,"aria-label":ariaLabel(s),"aria-required":!1}};n&&(f.attributes.name=n);if(isRequired(s)){f.attributes["aria-required"]=!0;f.attributes.required=!0}return HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[f]})}}class ChoiceList extends XFAObject{constructor(e){super(Go,"choiceList",!0);this.commitOn=getStringOption(e.commitOn,["select","exit"]);this.id=e.id||"";this.open=getStringOption(e.open,["userControl","always","multiSelect","onEntry"]);this.textEntry=getInteger({data:e.textEntry,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[co](e){const t=toStyle(this,"border","margin"),a=this[vs]()[vs](),r={fontSize:`calc(${a.font?.size||10}px * var(--total-scale-factor))`},i=[];if(a.items.children.length>0){const e=a.items;let t=0,n=0;if(2===e.children.length){t=e.children[0].save;n=1-t}const s=e.children[t][co]().html,o=e.children[n][co]().html;let c=!1;const l=a.value?.[so]()||"";for(let e=0,t=s.length;e<t;e++){const t={name:"option",attributes:{value:o[e]||s[e],style:r},value:s[e]};o[e]===l&&(t.attributes.selected=c=!0);i.push(t)}c||i.splice(0,0,{name:"option",attributes:{hidden:!0,selected:!0},value:" "})}const n={class:["xfaSelect"],fieldId:a[uo],dataId:a[os]?.[uo]||a[uo],style:t,"aria-label":ariaLabel(a),"aria-required":!1};if(isRequired(a)){n["aria-required"]=!0;n.required=!0}"multiSelect"===this.open&&(n.multiple=!0);return HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[{name:"select",children:i,attributes:n}]})}}class Color extends XFAObject{constructor(e){super(Go,"color",!0);this.cSpace=getStringOption(e.cSpace,["SRGB"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.value=e.value?function getColor(e,t=[0,0,0]){let[a,r,i]=t;if(!e)return{r:a,g:r,b:i};const n=e.split(",",3).map((e=>MathClamp(parseInt(e.trim(),10),0,255))).map((e=>isNaN(e)?0:e));if(n.length<3)return{r:a,g:r,b:i};[a,r,i]=n;return{r:a,g:r,b:i}}(e.value):"";this.extras=null}[Ts](){return!1}[ho](){return this.value?Util.makeHexColor(this.value.r,this.value.g,this.value.b):null}}class Comb extends XFAObject{constructor(e){super(Go,"comb");this.id=e.id||"";this.numberOfCells=getInteger({data:e.numberOfCells,defaultValue:0,validate:e=>e>=0});this.use=e.use||"";this.usehref=e.usehref||""}}class Connect extends XFAObject{constructor(e){super(Go,"connect",!0);this.connection=e.connection||"";this.id=e.id||"";this.ref=e.ref||"";this.usage=getStringOption(e.usage,["exportAndImport","exportOnly","importOnly"]);this.use=e.use||"";this.usehref=e.usehref||"";this.picture=null}}class ContentArea extends XFAObject{constructor(e){super(Go,"contentArea",!0);this.h=getMeasurement(e.h);this.id=e.id||"";this.name=e.name||"";this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.w=getMeasurement(e.w);this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.y,"0pt");this.desc=null;this.extras=null}[co](e){const t={left:measureToString(this.x),top:measureToString(this.y),width:measureToString(this.w),height:measureToString(this.h)},a=["xfaContentarea"];isPrintOnly(this)&&a.push("xfaPrintOnly");return HTMLResult.success({name:"div",children:[],attributes:{style:t,class:a,id:this[uo]}})}}class Corner extends XFAObject{constructor(e){super(Go,"corner",!0);this.id=e.id||"";this.inverted=getInteger({data:e.inverted,defaultValue:0,validate:e=>1===e});this.join=getStringOption(e.join,["square","round"]);this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.radius=getMeasurement(e.radius);this.stroke=getStringOption(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);this.thickness=getMeasurement(e.thickness,"0.5pt");this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[ho](){const e=toStyle(this,"visibility");e.radius=measureToString("square"===this.join?0:this.radius);return e}}class DateElement extends ContentObject{constructor(e){super(Go,"date");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[hs](){const e=this[ss].trim();this[ss]=e?new Date(e):null}[co](e){return valueToHtml(this[ss]?this[ss].toString():"")}}class DateTime extends ContentObject{constructor(e){super(Go,"dateTime");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[hs](){const e=this[ss].trim();this[ss]=e?new Date(e):null}[co](e){return valueToHtml(this[ss]?this[ss].toString():"")}}class DateTimeEdit extends XFAObject{constructor(e){super(Go,"dateTimeEdit",!0);this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.picker=getStringOption(e.picker,["host","none"]);this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.comb=null;this.extras=null;this.margin=null}[co](e){const t=toStyle(this,"border","font","margin"),a=this[vs]()[vs](),r={name:"input",attributes:{type:"text",fieldId:a[uo],dataId:a[os]?.[uo]||a[uo],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(a),"aria-required":!1}};if(isRequired(a)){r.attributes["aria-required"]=!0;r.attributes.required=!0}return HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[r]})}}class Decimal extends ContentObject{constructor(e){super(Go,"decimal");this.fracDigits=getInteger({data:e.fracDigits,defaultValue:2,validate:e=>!0});this.id=e.id||"";this.leadDigits=getInteger({data:e.leadDigits,defaultValue:-1,validate:e=>!0});this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[hs](){const e=parseFloat(this[ss].trim());this[ss]=isNaN(e)?null:e}[co](e){return valueToHtml(null!==this[ss]?this[ss].toString():"")}}class DefaultUi extends XFAObject{constructor(e){super(Go,"defaultUi",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class Desc extends XFAObject{constructor(e){super(Go,"desc",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.decimal=new XFAObjectArray;this.exData=new XFAObjectArray;this.float=new XFAObjectArray;this.image=new XFAObjectArray;this.integer=new XFAObjectArray;this.text=new XFAObjectArray;this.time=new XFAObjectArray}}class DigestMethod extends OptionObject{constructor(e){super(Go,"digestMethod",["","SHA1","SHA256","SHA512","RIPEMD160"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class DigestMethods extends XFAObject{constructor(e){super(Go,"digestMethods",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.digestMethod=new XFAObjectArray}}class Draw extends XFAObject{constructor(e){super(Go,"draw",!0);this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?getMeasurement(e.h):"";this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.locale=e.locale||"";this.maxH=getMeasurement(e.maxH,"0pt");this.maxW=getMeasurement(e.maxW,"0pt");this.minH=getMeasurement(e.minH,"0pt");this.minW=getMeasurement(e.minW,"0pt");this.name=e.name||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=getRelevant(e.relevant);this.rotate=getInteger({data:e.rotate,defaultValue:0,validate:e=>e%90==0});this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?getMeasurement(e.w):"";this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.y,"0pt");this.assist=null;this.border=null;this.caption=null;this.desc=null;this.extras=null;this.font=null;this.keep=null;this.margin=null;this.para=null;this.traversal=null;this.ui=null;this.value=null;this.setProperty=new XFAObjectArray}[io](e){_setValue(this,e)}[co](e){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence)return HTMLResult.EMPTY;fixDimensions(this);this[Ys]();const t=this.w,a=this.h,{w:r,h:i,isBroken:n}=layoutNode(this,e);if(r&&""===this.w){if(n&&this[Cs]()[_s]()){this[Js]();return HTMLResult.FAILURE}this.w=r}i&&""===this.h&&(this.h=i);setFirstUnsplittable(this);if(!checkDimensions(this,e)){this.w=t;this.h=a;this[Js]();return HTMLResult.FAILURE}unsetFirstUnsplittable(this);const s=toStyle(this,"font","hAlign","dimensions","position","presence","rotate","anchorType","border","margin");setMinMaxDimensions(this,s);if(s.margin){s.padding=s.margin;delete s.margin}const o=["xfaDraw"];this.font&&o.push("xfaFont");isPrintOnly(this)&&o.push("xfaPrintOnly");const c={style:s,id:this[uo],class:o};this.name&&(c.xfaName=this.name);const l={name:"div",attributes:c,children:[]};applyAssist(this,c);const h=computeBbox(this,l,e),u=this.value?this.value[co](e).html:null;if(null===u){this.w=t;this.h=a;this[Js]();return HTMLResult.success(createWrapper(this,l),h)}l.children.push(u);setPara(this,s,u);this.w=t;this.h=a;this[Js]();return HTMLResult.success(createWrapper(this,l),h)}}class Edge extends XFAObject{constructor(e){super(Go,"edge",!0);this.cap=getStringOption(e.cap,["square","butt","round"]);this.id=e.id||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.stroke=getStringOption(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);this.thickness=getMeasurement(e.thickness,"0.5pt");this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[ho](){const e=toStyle(this,"visibility");Object.assign(e,{linecap:this.cap,width:measureToString(this.thickness),color:this.color?this.color[ho]():"#000000",style:""});if("visible"!==this.presence)e.style="none";else switch(this.stroke){case"solid":e.style="solid";break;case"dashDot":case"dashDotDot":case"dashed":e.style="dashed";break;case"dotted":e.style="dotted";break;case"embossed":e.style="ridge";break;case"etched":e.style="groove";break;case"lowered":e.style="inset";break;case"raised":e.style="outset"}return e}}class Encoding extends OptionObject{constructor(e){super(Go,"encoding",["adbe.x509.rsa_sha1","adbe.pkcs7.detached","adbe.pkcs7.sha1"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Encodings extends XFAObject{constructor(e){super(Go,"encodings",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.encoding=new XFAObjectArray}}class Encrypt extends XFAObject{constructor(e){super(Go,"encrypt",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=null}}class EncryptData extends XFAObject{constructor(e){super(Go,"encryptData",!0);this.id=e.id||"";this.operation=getStringOption(e.operation,["encrypt","decrypt"]);this.target=e.target||"";this.use=e.use||"";this.usehref=e.usehref||"";this.filter=null;this.manifest=null}}class Encryption extends XFAObject{constructor(e){super(Go,"encryption",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new XFAObjectArray}}class EncryptionMethod extends OptionObject{constructor(e){super(Go,"encryptionMethod",["","AES256-CBC","TRIPLEDES-CBC","AES128-CBC","AES192-CBC"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class EncryptionMethods extends XFAObject{constructor(e){super(Go,"encryptionMethods",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.encryptionMethod=new XFAObjectArray}}class Event extends XFAObject{constructor(e){super(Go,"event",!0);this.activity=getStringOption(e.activity,["click","change","docClose","docReady","enter","exit","full","indexChange","initialize","mouseDown","mouseEnter","mouseExit","mouseUp","postExecute","postOpen","postPrint","postSave","postSign","postSubmit","preExecute","preOpen","prePrint","preSave","preSign","preSubmit","ready","validationState"]);this.id=e.id||"";this.listen=getStringOption(e.listen,["refOnly","refAndDescendents"]);this.name=e.name||"";this.ref=e.ref||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.encryptData=null;this.execute=null;this.script=null;this.signData=null;this.submit=null}}class ExData extends ContentObject{constructor(e){super(Go,"exData");this.contentType=e.contentType||"";this.href=e.href||"";this.id=e.id||"";this.maxLength=getInteger({data:e.maxLength,defaultValue:-1,validate:e=>e>=-1});this.name=e.name||"";this.rid=e.rid||"";this.transferEncoding=getStringOption(e.transferEncoding,["none","base64","package"]);this.use=e.use||"";this.usehref=e.usehref||""}[Bs](){return"text/html"===this.contentType}[$s](e){if("text/html"===this.contentType&&e[Hs]===go.xhtml.id){this[ss]=e;return!0}if("text/xml"===this.contentType){this[ss]=e;return!0}return!1}[co](e){return"text/html"===this.contentType&&this[ss]?this[ss][co](e):HTMLResult.EMPTY}}class ExObject extends XFAObject{constructor(e){super(Go,"exObject",!0);this.archive=e.archive||"";this.classId=e.classId||"";this.codeBase=e.codeBase||"";this.codeType=e.codeType||"";this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.boolean=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.decimal=new XFAObjectArray;this.exData=new XFAObjectArray;this.exObject=new XFAObjectArray;this.float=new XFAObjectArray;this.image=new XFAObjectArray;this.integer=new XFAObjectArray;this.text=new XFAObjectArray;this.time=new XFAObjectArray}}class ExclGroup extends XFAObject{constructor(e){super(Go,"exclGroup",!0);this.access=getStringOption(e.access,["open","nonInteractive","protected","readOnly"]);this.accessKey=e.accessKey||"";this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?getMeasurement(e.h):"";this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.layout=getStringOption(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);this.maxH=getMeasurement(e.maxH,"0pt");this.maxW=getMeasurement(e.maxW,"0pt");this.minH=getMeasurement(e.minH,"0pt");this.minW=getMeasurement(e.minW,"0pt");this.name=e.name||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?getMeasurement(e.w):"";this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.y,"0pt");this.assist=null;this.bind=null;this.border=null;this.calculate=null;this.caption=null;this.desc=null;this.extras=null;this.margin=null;this.para=null;this.traversal=null;this.validate=null;this.connect=new XFAObjectArray;this.event=new XFAObjectArray;this.field=new XFAObjectArray;this.setProperty=new XFAObjectArray}[Rs](){return!0}[Ts](){return!0}[io](e){for(const t of this.field.children){if(!t.value){const e=new Value({});t[Qn](e);t.value=e}t.value[io](e)}}[_s](){return this.layout.endsWith("-tb")&&0===this[ls].attempt&&this[ls].numberInLine>0||this[vs]()[_s]()}[js](){const e=this[Cs]();if(!e[js]())return!1;if(void 0!==this[ls]._isSplittable)return this[ls]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[ls]._isSplittable=!1;return!1}if(e.layout?.endsWith("-tb")&&0!==e[ls].numberInLine)return!1;this[ls]._isSplittable=!0;return!0}[us](){return flushHTML(this)}[Zn](e,t){addHTML(this,e,t)}[gs](){return getAvailableSpace(this)}[co](e){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return HTMLResult.EMPTY;fixDimensions(this);const t=[],a={id:this[uo],class:[]};setAccess(this,a.class);this[ls]||=Object.create(null);Object.assign(this[ls],{children:t,attributes:a,attempt:0,line:null,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const r=this[js]();r||setFirstUnsplittable(this);if(!checkDimensions(this,e))return HTMLResult.FAILURE;const i=new Set(["field"]);if(this.layout.includes("row")){const e=this[Cs]().columnWidths;if(Array.isArray(e)&&e.length>0){this[ls].columnWidths=e;this[ls].currentColumn=0}}const n=toStyle(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),s=["xfaExclgroup"],o=layoutClass(this);o&&s.push(o);isPrintOnly(this)&&s.push("xfaPrintOnly");a.style=n;a.class=s;this.name&&(a.xfaName=this.name);this[Ys]();const c="lr-tb"===this.layout||"rl-tb"===this.layout,l=c?2:1;for(;this[ls].attempt<l;this[ls].attempt++){c&&1===this[ls].attempt&&(this[ls].numberInLine=0);const e=this[es]({filter:i,include:!0});if(e.success)break;if(e.isBreak()){this[Js]();return e}if(c&&0===this[ls].attempt&&0===this[ls].numberInLine&&!this[Fs]()[ls].noLayoutFailure){this[ls].attempt=l;break}}this[Js]();r||unsetFirstUnsplittable(this);if(this[ls].attempt===l){r||delete this[ls];return HTMLResult.FAILURE}let h=0,u=0;if(this.margin){h=this.margin.leftInset+this.margin.rightInset;u=this.margin.topInset+this.margin.bottomInset}const d=Math.max(this[ls].width+h,this.w||0),f=Math.max(this[ls].height+u,this.h||0),g=[this.x,this.y,d,f];""===this.w&&(n.width=measureToString(d));""===this.h&&(n.height=measureToString(f));const p={name:"div",attributes:a,children:t};applyAssist(this,a);delete this[ls];return HTMLResult.success(createWrapper(this,p),g)}}class Execute extends XFAObject{constructor(e){super(Go,"execute");this.connection=e.connection||"";this.executeType=getStringOption(e.executeType,["import","remerge"]);this.id=e.id||"";this.runAt=getStringOption(e.runAt,["client","both","server"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Extras extends XFAObject{constructor(e){super(Go,"extras",!0);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.decimal=new XFAObjectArray;this.exData=new XFAObjectArray;this.extras=new XFAObjectArray;this.float=new XFAObjectArray;this.image=new XFAObjectArray;this.integer=new XFAObjectArray;this.text=new XFAObjectArray;this.time=new XFAObjectArray}}class Field extends XFAObject{constructor(e){super(Go,"field",!0);this.access=getStringOption(e.access,["open","nonInteractive","protected","readOnly"]);this.accessKey=e.accessKey||"";this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?getMeasurement(e.h):"";this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.locale=e.locale||"";this.maxH=getMeasurement(e.maxH,"0pt");this.maxW=getMeasurement(e.maxW,"0pt");this.minH=getMeasurement(e.minH,"0pt");this.minW=getMeasurement(e.minW,"0pt");this.name=e.name||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=getRelevant(e.relevant);this.rotate=getInteger({data:e.rotate,defaultValue:0,validate:e=>e%90==0});this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?getMeasurement(e.w):"";this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.y,"0pt");this.assist=null;this.bind=null;this.border=null;this.calculate=null;this.caption=null;this.desc=null;this.extras=null;this.font=null;this.format=null;this.items=new XFAObjectArray(2);this.keep=null;this.margin=null;this.para=null;this.traversal=null;this.ui=null;this.validate=null;this.value=null;this.bindItems=new XFAObjectArray;this.connect=new XFAObjectArray;this.event=new XFAObjectArray;this.setProperty=new XFAObjectArray}[Rs](){return!0}[io](e){_setValue(this,e)}[co](e){setTabIndex(this);if(!this.ui){this.ui=new Ui({});this.ui[Is]=this[Is];this[Qn](this.ui);let e;switch(this.items.children.length){case 0:e=new TextEdit({});this.ui.textEdit=e;break;case 1:e=new CheckButton({});this.ui.checkButton=e;break;case 2:e=new ChoiceList({});this.ui.choiceList=e}this.ui[Qn](e)}if(!this.ui||"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return HTMLResult.EMPTY;this.caption&&delete this.caption[ls];this[Ys]();const t=this.caption?this.caption[co](e).html:null,a=this.w,r=this.h;let i=0,n=0;if(this.margin){i=this.margin.leftInset+this.margin.rightInset;n=this.margin.topInset+this.margin.bottomInset}let s=null;if(""===this.w||""===this.h){let t=null,a=null,r=0,o=0;if(this.ui.checkButton)r=o=this.ui.checkButton.size;else{const{w:t,h:a}=layoutNode(this,e);if(null!==t){r=t;o=a}else o=function fonts_getMetrics(e,t=!1){let a=null;if(e){const t=stripQuotes(e.typeface),r=e[Is].fontFinder.find(t);a=selectFont(e,r)}if(!a)return{lineHeight:12,lineGap:2,lineNoGap:10};const r=e.size||10,i=a.lineHeight?Math.max(t?0:1.2,a.lineHeight):1.2,n=void 0===a.lineGap?.2:a.lineGap;return{lineHeight:i*r,lineGap:n*r,lineNoGap:Math.max(1,i-n)*r}}(this.font,!0).lineNoGap}s=getBorderDims(this.ui[ws]());r+=s.w;o+=s.h;if(this.caption){const{w:i,h:n,isBroken:s}=this.caption[ws](e);if(s&&this[Cs]()[_s]()){this[Js]();return HTMLResult.FAILURE}t=i;a=n;switch(this.caption.placement){case"left":case"right":case"inline":t+=r;break;case"top":case"bottom":a+=o}}else{t=r;a=o}if(t&&""===this.w){t+=i;this.w=Math.min(this.maxW<=0?1/0:this.maxW,this.minW+1<t?t:this.minW)}if(a&&""===this.h){a+=n;this.h=Math.min(this.maxH<=0?1/0:this.maxH,this.minH+1<a?a:this.minH)}}this[Js]();fixDimensions(this);setFirstUnsplittable(this);if(!checkDimensions(this,e)){this.w=a;this.h=r;this[Js]();return HTMLResult.FAILURE}unsetFirstUnsplittable(this);const o=toStyle(this,"font","dimensions","position","rotate","anchorType","presence","margin","hAlign");setMinMaxDimensions(this,o);const c=["xfaField"];this.font&&c.push("xfaFont");isPrintOnly(this)&&c.push("xfaPrintOnly");const l={style:o,id:this[uo],class:c};if(o.margin){o.padding=o.margin;delete o.margin}setAccess(this,c);this.name&&(l.xfaName=this.name);const h=[],u={name:"div",attributes:l,children:h};applyAssist(this,l);const d=this.border?this.border[ho]():null,f=computeBbox(this,u,e),g=this.ui[co]().html;if(!g){Object.assign(o,d);return HTMLResult.success(createWrapper(this,u),f)}this[no]&&(g.children?.[0]?g.children[0].attributes.tabindex=this[no]:g.attributes.tabindex=this[no]);g.attributes.style||=Object.create(null);let p=null;if(this.ui.button){1===g.children.length&&([p]=g.children.splice(0,1));Object.assign(g.attributes.style,d)}else Object.assign(o,d);h.push(g);if(this.value)if(this.ui.imageEdit)g.children.push(this.value[co]().html);else if(!this.ui.button){let e="";if(this.value.exData)e=this.value.exData[so]();else if(this.value.text)e=this.value.text[ws]();else{const t=this.value[co]().html;null!==t&&(e=t.children[0].value)}this.ui.textEdit&&this.value.text?.maxChars&&(g.children[0].attributes.maxLength=this.value.text.maxChars);if(e){if(this.ui.numericEdit){e=parseFloat(e);e=isNaN(e)?"":e.toString()}"textarea"===g.children[0].name?g.children[0].attributes.textContent=e:g.children[0].attributes.value=e}}if(!this.ui.imageEdit&&g.children?.[0]&&this.h){s=s||getBorderDims(this.ui[ws]());let t=0;if(this.caption&&["top","bottom"].includes(this.caption.placement)){t=this.caption.reserve;t<=0&&(t=this.caption[ws](e).h);const a=this.h-t-n-s.h;g.children[0].attributes.style.height=measureToString(a)}else g.children[0].attributes.style.height="100%"}p&&g.children.push(p);if(!t){g.attributes.class&&g.attributes.class.push("xfaLeft");this.w=a;this.h=r;return HTMLResult.success(createWrapper(this,u),f)}if(this.ui.button){o.padding&&delete o.padding;"div"===t.name&&(t.name="span");g.children.push(t);return HTMLResult.success(u,f)}this.ui.checkButton&&(t.attributes.class[0]="xfaCaptionForCheckButton");g.attributes.class||=[];g.children.splice(0,0,t);switch(this.caption.placement){case"left":case"inline":g.attributes.class.push("xfaLeft");break;case"right":g.attributes.class.push("xfaRight");break;case"top":g.attributes.class.push("xfaTop");break;case"bottom":g.attributes.class.push("xfaBottom")}this.w=a;this.h=r;return HTMLResult.success(createWrapper(this,u),f)}}class Fill extends XFAObject{constructor(e){super(Go,"fill",!0);this.id=e.id||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null;this.linear=null;this.pattern=null;this.radial=null;this.solid=null;this.stipple=null}[ho](){const e=this[vs](),t=e[vs]()[vs](),a=Object.create(null);let r="color",i=r;if(e instanceof Border){r="background-color";i="background";t instanceof Ui&&(a.backgroundColor="white")}if(e instanceof Rectangle||e instanceof Arc){r=i="fill";a.fill="white"}for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"color"===e)continue;const t=this[e];if(!(t instanceof XFAObject))continue;const n=t[ho](this.color);n&&(a[n.startsWith("#")?r:i]=n);return a}if(this.color?.value){const e=this.color[ho]();a[e.startsWith("#")?r:i]=e}return a}}class Filter extends XFAObject{constructor(e){super(Go,"filter",!0);this.addRevocationInfo=getStringOption(e.addRevocationInfo,["","required","optional","none"]);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.version=getInteger({data:this.version,defaultValue:5,validate:e=>e>=1&&e<=5});this.appearanceFilter=null;this.certificates=null;this.digestMethods=null;this.encodings=null;this.encryptionMethods=null;this.handler=null;this.lockDocument=null;this.mdp=null;this.reasons=null;this.timeStamp=null}}class Float extends ContentObject{constructor(e){super(Go,"float");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[hs](){const e=parseFloat(this[ss].trim());this[ss]=isNaN(e)?null:e}[co](e){return valueToHtml(null!==this[ss]?this[ss].toString():"")}}class template_Font extends XFAObject{constructor(e){super(Go,"font",!0);this.baselineShift=getMeasurement(e.baselineShift);this.fontHorizontalScale=getFloat({data:e.fontHorizontalScale,defaultValue:100,validate:e=>e>=0});this.fontVerticalScale=getFloat({data:e.fontVerticalScale,defaultValue:100,validate:e=>e>=0});this.id=e.id||"";this.kerningMode=getStringOption(e.kerningMode,["none","pair"]);this.letterSpacing=getMeasurement(e.letterSpacing,"0");this.lineThrough=getInteger({data:e.lineThrough,defaultValue:0,validate:e=>1===e||2===e});this.lineThroughPeriod=getStringOption(e.lineThroughPeriod,["all","word"]);this.overline=getInteger({data:e.overline,defaultValue:0,validate:e=>1===e||2===e});this.overlinePeriod=getStringOption(e.overlinePeriod,["all","word"]);this.posture=getStringOption(e.posture,["normal","italic"]);this.size=getMeasurement(e.size,"10pt");this.typeface=e.typeface||"Courier";this.underline=getInteger({data:e.underline,defaultValue:0,validate:e=>1===e||2===e});this.underlinePeriod=getStringOption(e.underlinePeriod,["all","word"]);this.use=e.use||"";this.usehref=e.usehref||"";this.weight=getStringOption(e.weight,["normal","bold"]);this.extras=null;this.fill=null}[ts](e){super[ts](e);this[Is].usedTypefaces.add(this.typeface)}[ho](){const e=toStyle(this,"fill"),t=e.color;if(t)if("#000000"===t)delete e.color;else if(!t.startsWith("#")){e.background=t;e.backgroundClip="text";e.color="transparent"}this.baselineShift&&(e.verticalAlign=measureToString(this.baselineShift));e.fontKerning="none"===this.kerningMode?"none":"normal";e.letterSpacing=measureToString(this.letterSpacing);if(0!==this.lineThrough){e.textDecoration="line-through";2===this.lineThrough&&(e.textDecorationStyle="double")}if(0!==this.overline){e.textDecoration="overline";2===this.overline&&(e.textDecorationStyle="double")}e.fontStyle=this.posture;e.fontSize=measureToString(.99*this.size);setFontFamily(this,this,this[Is].fontFinder,e);if(0!==this.underline){e.textDecoration="underline";2===this.underline&&(e.textDecorationStyle="double")}e.fontWeight=this.weight;return e}}class Format extends XFAObject{constructor(e){super(Go,"format",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.picture=null}}class Handler extends StringObject{constructor(e){super(Go,"handler");this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Hyphenation extends XFAObject{constructor(e){super(Go,"hyphenation");this.excludeAllCaps=getInteger({data:e.excludeAllCaps,defaultValue:0,validate:e=>1===e});this.excludeInitialCap=getInteger({data:e.excludeInitialCap,defaultValue:0,validate:e=>1===e});this.hyphenate=getInteger({data:e.hyphenate,defaultValue:0,validate:e=>1===e});this.id=e.id||"";this.pushCharacterCount=getInteger({data:e.pushCharacterCount,defaultValue:3,validate:e=>e>=0});this.remainCharacterCount=getInteger({data:e.remainCharacterCount,defaultValue:3,validate:e=>e>=0});this.use=e.use||"";this.usehref=e.usehref||"";this.wordCharacterCount=getInteger({data:e.wordCharacterCount,defaultValue:7,validate:e=>e>=0})}}class Image extends StringObject{constructor(e){super(Go,"image");this.aspect=getStringOption(e.aspect,["fit","actual","height","none","width"]);this.contentType=e.contentType||"";this.href=e.href||"";this.id=e.id||"";this.name=e.name||"";this.transferEncoding=getStringOption(e.transferEncoding,["base64","none","package"]);this.use=e.use||"";this.usehref=e.usehref||""}[co](){if(this.contentType&&!Jo.has(this.contentType.toLowerCase()))return HTMLResult.EMPTY;let e=this[Is].images?.get(this.href);if(!e&&(this.href||!this[ss]))return HTMLResult.EMPTY;e||"base64"!==this.transferEncoding||(e=function fromBase64Util(e){return Uint8Array.fromBase64?Uint8Array.fromBase64(e):stringToBytes(atob(e))}(this[ss]));if(!e)return HTMLResult.EMPTY;if(!this.contentType){for(const[t,a]of Yo)if(e.length>t.length&&t.every(((t,a)=>t===e[a]))){this.contentType=a;break}if(!this.contentType)return HTMLResult.EMPTY}const t=new Blob([e],{type:this.contentType});let a;switch(this.aspect){case"fit":case"actual":break;case"height":a={height:"100%",objectFit:"fill"};break;case"none":a={width:"100%",height:"100%",objectFit:"fill"};break;case"width":a={width:"100%",objectFit:"fill"}}const r=this[vs]();return HTMLResult.success({name:"img",attributes:{class:["xfaImage"],style:a,src:URL.createObjectURL(t),alt:r?ariaLabel(r[vs]()):null}})}}class ImageEdit extends XFAObject{constructor(e){super(Go,"imageEdit",!0);this.data=getStringOption(e.data,["link","embed"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[co](e){return"embed"===this.data?HTMLResult.success({name:"div",children:[],attributes:{}}):HTMLResult.EMPTY}}class Integer extends ContentObject{constructor(e){super(Go,"integer");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[hs](){const e=parseInt(this[ss].trim(),10);this[ss]=isNaN(e)?null:e}[co](e){return valueToHtml(null!==this[ss]?this[ss].toString():"")}}class Issuers extends XFAObject{constructor(e){super(Go,"issuers",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new XFAObjectArray}}class Items extends XFAObject{constructor(e){super(Go,"items",!0);this.id=e.id||"";this.name=e.name||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.ref=e.ref||"";this.save=getInteger({data:e.save,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.decimal=new XFAObjectArray;this.exData=new XFAObjectArray;this.float=new XFAObjectArray;this.image=new XFAObjectArray;this.integer=new XFAObjectArray;this.text=new XFAObjectArray;this.time=new XFAObjectArray}[co](){const e=[];for(const t of this[Ss]())e.push(t[so]());return HTMLResult.success(e)}}class Keep extends XFAObject{constructor(e){super(Go,"keep",!0);this.id=e.id||"";const t=["none","contentArea","pageArea"];this.intact=getStringOption(e.intact,t);this.next=getStringOption(e.next,t);this.previous=getStringOption(e.previous,t);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class KeyUsage extends XFAObject{constructor(e){super(Go,"keyUsage");const t=["","yes","no"];this.crlSign=getStringOption(e.crlSign,t);this.dataEncipherment=getStringOption(e.dataEncipherment,t);this.decipherOnly=getStringOption(e.decipherOnly,t);this.digitalSignature=getStringOption(e.digitalSignature,t);this.encipherOnly=getStringOption(e.encipherOnly,t);this.id=e.id||"";this.keyAgreement=getStringOption(e.keyAgreement,t);this.keyCertSign=getStringOption(e.keyCertSign,t);this.keyEncipherment=getStringOption(e.keyEncipherment,t);this.nonRepudiation=getStringOption(e.nonRepudiation,t);this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Line extends XFAObject{constructor(e){super(Go,"line",!0);this.hand=getStringOption(e.hand,["even","left","right"]);this.id=e.id||"";this.slope=getStringOption(e.slope,["\\\\","/"]);this.use=e.use||"";this.usehref=e.usehref||"";this.edge=null}[co](){const e=this[vs]()[vs](),t=this.edge||new Edge({}),a=t[ho](),r=Object.create(null),i="visible"===t.presence?t.thickness:0;r.strokeWidth=measureToString(i);r.stroke=a.color;let n,s,o,c,l="100%",h="100%";if(e.w<=i){[n,s,o,c]=["50%",0,"50%","100%"];l=r.strokeWidth}else if(e.h<=i){[n,s,o,c]=[0,"50%","100%","50%"];h=r.strokeWidth}else"\\\\"===this.slope?[n,s,o,c]=[0,0,"100%","100%"]:[n,s,o,c]=[0,"100%","100%",0];const u={name:"svg",children:[{name:"line",attributes:{xmlns:Vo,x1:n,y1:s,x2:o,y2:c,style:r}}],attributes:{xmlns:Vo,width:l,height:h,style:{overflow:"visible"}}};if(hasMargin(e))return HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[u]});u.attributes.style.position="absolute";return HTMLResult.success(u)}}class Linear extends XFAObject{constructor(e){super(Go,"linear",!0);this.id=e.id||"";this.type=getStringOption(e.type,["toRight","toBottom","toLeft","toTop"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[ho](e){e=e?e[ho]():"#FFFFFF";return`linear-gradient(${this.type.replace(/([RBLT])/," $1").toLowerCase()}, ${e}, ${this.color?this.color[ho]():"#000000"})`}}class LockDocument extends ContentObject{constructor(e){super(Go,"lockDocument");this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}[hs](){this[ss]=getStringOption(this[ss],["auto","0","1"])}}class Manifest extends XFAObject{constructor(e){super(Go,"manifest",!0);this.action=getStringOption(e.action,["include","all","exclude"]);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.ref=new XFAObjectArray}}class Margin extends XFAObject{constructor(e){super(Go,"margin",!0);this.bottomInset=getMeasurement(e.bottomInset,"0");this.id=e.id||"";this.leftInset=getMeasurement(e.leftInset,"0");this.rightInset=getMeasurement(e.rightInset,"0");this.topInset=getMeasurement(e.topInset,"0");this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[ho](){return{margin:measureToString(this.topInset)+" "+measureToString(this.rightInset)+" "+measureToString(this.bottomInset)+" "+measureToString(this.leftInset)}}}class Mdp extends XFAObject{constructor(e){super(Go,"mdp");this.id=e.id||"";this.permissions=getInteger({data:e.permissions,defaultValue:2,validate:e=>1===e||3===e});this.signatureType=getStringOption(e.signatureType,["filler","author"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Medium extends XFAObject{constructor(e){super(Go,"medium");this.id=e.id||"";this.imagingBBox=function getBBox(e){const t=-1;if(!e)return{x:t,y:t,width:t,height:t};const a=e.split(",",4).map((e=>getMeasurement(e.trim(),"-1")));if(a.length<4||a[2]<0||a[3]<0)return{x:t,y:t,width:t,height:t};const[r,i,n,s]=a;return{x:r,y:i,width:n,height:s}}(e.imagingBBox);this.long=getMeasurement(e.long);this.orientation=getStringOption(e.orientation,["portrait","landscape"]);this.short=getMeasurement(e.short);this.stock=e.stock||"";this.trayIn=getStringOption(e.trayIn,["auto","delegate","pageFront"]);this.trayOut=getStringOption(e.trayOut,["auto","delegate"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Message extends XFAObject{constructor(e){super(Go,"message",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.text=new XFAObjectArray}}class NumericEdit extends XFAObject{constructor(e){super(Go,"numericEdit",!0);this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.comb=null;this.extras=null;this.margin=null}[co](e){const t=toStyle(this,"border","font","margin"),a=this[vs]()[vs](),r={name:"input",attributes:{type:"text",fieldId:a[uo],dataId:a[os]?.[uo]||a[uo],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(a),"aria-required":!1}};if(isRequired(a)){r.attributes["aria-required"]=!0;r.attributes.required=!0}return HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[r]})}}class Occur extends XFAObject{constructor(e){super(Go,"occur",!0);this.id=e.id||"";this.initial=""!==e.initial?getInteger({data:e.initial,defaultValue:"",validate:e=>!0}):"";this.max=""!==e.max?getInteger({data:e.max,defaultValue:1,validate:e=>!0}):"";this.min=""!==e.min?getInteger({data:e.min,defaultValue:1,validate:e=>!0}):"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[ts](){const e=this[vs](),t=this.min;""===this.min&&(this.min=e instanceof PageArea||e instanceof PageSet?0:1);""===this.max&&(this.max=""===t?e instanceof PageArea||e instanceof PageSet?-1:1:this.min);-1!==this.max&&this.max<this.min&&(this.max=this.min);""===this.initial&&(this.initial=e instanceof Template?1:this.min)}}class Oid extends StringObject{constructor(e){super(Go,"oid");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Oids extends XFAObject{constructor(e){super(Go,"oids",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.oid=new XFAObjectArray}}class Overflow extends XFAObject{constructor(e){super(Go,"overflow");this.id=e.id||"";this.leader=e.leader||"";this.target=e.target||"";this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||""}[ws](){if(!this[ls]){const e=this[vs](),t=this[Fs](),a=t[to](this.target,e),r=t[to](this.leader,e),i=t[to](this.trailer,e);this[ls]={target:a?.[0]||null,leader:r?.[0]||null,trailer:i?.[0]||null,addLeader:!1,addTrailer:!1}}return this[ls]}}class PageArea extends XFAObject{constructor(e){super(Go,"pageArea",!0);this.blankOrNotBlank=getStringOption(e.blankOrNotBlank,["any","blank","notBlank"]);this.id=e.id||"";this.initialNumber=getInteger({data:e.initialNumber,defaultValue:1,validate:e=>!0});this.name=e.name||"";this.numbered=getInteger({data:e.numbered,defaultValue:1,validate:e=>!0});this.oddOrEven=getStringOption(e.oddOrEven,["any","even","odd"]);this.pagePosition=getStringOption(e.pagePosition,["any","first","last","only","rest"]);this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.desc=null;this.extras=null;this.medium=null;this.occur=null;this.area=new XFAObjectArray;this.contentArea=new XFAObjectArray;this.draw=new XFAObjectArray;this.exclGroup=new XFAObjectArray;this.field=new XFAObjectArray;this.subform=new XFAObjectArray}[Xs](){if(!this[ls]){this[ls]={numberOfUse:0};return!0}return!this.occur||-1===this.occur.max||this[ls].numberOfUse<this.occur.max}[as](){delete this[ls]}[ks](){this[ls]||={numberOfUse:0};const e=this[vs]();if("orderedOccurrence"===e.relation&&this[Xs]()){this[ls].numberOfUse+=1;return this}return e[ks]()}[gs](){return this[ls].space||{width:0,height:0}}[co](){this[ls]||={numberOfUse:1};const e=[];this[ls].children=e;const t=Object.create(null);if(this.medium&&this.medium.short&&this.medium.long){t.width=measureToString(this.medium.short);t.height=measureToString(this.medium.long);this[ls].space={width:this.medium.short,height:this.medium.long};if("landscape"===this.medium.orientation){const e=t.width;t.width=t.height;t.height=e;this[ls].space={width:this.medium.long,height:this.medium.short}}}else warn("XFA - No medium specified in pageArea: please file a bug.");this[es]({filter:new Set(["area","draw","field","subform"]),include:!0});this[es]({filter:new Set(["contentArea"]),include:!0});return HTMLResult.success({name:"div",children:e,attributes:{class:["xfaPage"],id:this[uo],style:t,xfaName:this.name}})}}class PageSet extends XFAObject{constructor(e){super(Go,"pageSet",!0);this.duplexImposition=getStringOption(e.duplexImposition,["longEdge","shortEdge"]);this.id=e.id||"";this.name=e.name||"";this.relation=getStringOption(e.relation,["orderedOccurrence","duplexPaginated","simplexPaginated"]);this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.occur=null;this.pageArea=new XFAObjectArray;this.pageSet=new XFAObjectArray}[as](){for(const e of this.pageArea.children)e[as]();for(const e of this.pageSet.children)e[as]()}[Xs](){return!this.occur||-1===this.occur.max||this[ls].numberOfUse<this.occur.max}[ks](){this[ls]||={numberOfUse:1,pageIndex:-1,pageSetIndex:-1};if("orderedOccurrence"===this.relation){if(this[ls].pageIndex+1<this.pageArea.children.length){this[ls].pageIndex+=1;return this.pageArea.children[this[ls].pageIndex][ks]()}if(this[ls].pageSetIndex+1<this.pageSet.children.length){this[ls].pageSetIndex+=1;return this.pageSet.children[this[ls].pageSetIndex][ks]()}if(this[Xs]()){this[ls].numberOfUse+=1;this[ls].pageIndex=-1;this[ls].pageSetIndex=-1;return this[ks]()}const e=this[vs]();if(e instanceof PageSet)return e[ks]();this[as]();return this[ks]()}const e=this[Fs]()[ls].pageNumber,t=e%2==0?"even":"odd",a=0===e?"first":"rest";let r=this.pageArea.children.find((e=>e.oddOrEven===t&&e.pagePosition===a));if(r)return r;r=this.pageArea.children.find((e=>"any"===e.oddOrEven&&e.pagePosition===a));if(r)return r;r=this.pageArea.children.find((e=>"any"===e.oddOrEven&&"any"===e.pagePosition));return r||this.pageArea.children[0]}}class Para extends XFAObject{constructor(e){super(Go,"para",!0);this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.lineHeight=e.lineHeight?getMeasurement(e.lineHeight,"0pt"):"";this.marginLeft=e.marginLeft?getMeasurement(e.marginLeft,"0pt"):"";this.marginRight=e.marginRight?getMeasurement(e.marginRight,"0pt"):"";this.orphans=getInteger({data:e.orphans,defaultValue:0,validate:e=>e>=0});this.preserve=e.preserve||"";this.radixOffset=e.radixOffset?getMeasurement(e.radixOffset,"0pt"):"";this.spaceAbove=e.spaceAbove?getMeasurement(e.spaceAbove,"0pt"):"";this.spaceBelow=e.spaceBelow?getMeasurement(e.spaceBelow,"0pt"):"";this.tabDefault=e.tabDefault?getMeasurement(this.tabDefault):"";this.tabStops=(e.tabStops||"").trim().split(/\\s+/).map(((e,t)=>t%2==1?getMeasurement(e):e));this.textIndent=e.textIndent?getMeasurement(e.textIndent,"0pt"):"";this.use=e.use||"";this.usehref=e.usehref||"";this.vAlign=getStringOption(e.vAlign,["top","bottom","middle"]);this.widows=getInteger({data:e.widows,defaultValue:0,validate:e=>e>=0});this.hyphenation=null}[ho](){const e=toStyle(this,"hAlign");""!==this.marginLeft&&(e.paddingLeft=measureToString(this.marginLeft));""!==this.marginRight&&(e.paddingRight=measureToString(this.marginRight));""!==this.spaceAbove&&(e.paddingTop=measureToString(this.spaceAbove));""!==this.spaceBelow&&(e.paddingBottom=measureToString(this.spaceBelow));if(""!==this.textIndent){e.textIndent=measureToString(this.textIndent);fixTextIndent(e)}this.lineHeight>0&&(e.lineHeight=measureToString(this.lineHeight));""!==this.tabDefault&&(e.tabSize=measureToString(this.tabDefault));this.tabStops.length;this.hyphenatation&&Object.assign(e,this.hyphenatation[ho]());return e}}class PasswordEdit extends XFAObject{constructor(e){super(Go,"passwordEdit",!0);this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.passwordChar=e.passwordChar||"*";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}}class template_Pattern extends XFAObject{constructor(e){super(Go,"pattern",!0);this.id=e.id||"";this.type=getStringOption(e.type,["crossHatch","crossDiagonal","diagonalLeft","diagonalRight","horizontal","vertical"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[ho](e){e=e?e[ho]():"#FFFFFF";const t=this.color?this.color[ho]():"#000000",a="repeating-linear-gradient",r=`${e},${e} 5px,${t} 5px,${t} 10px`;switch(this.type){case"crossHatch":return`${a}(to top,${r}) ${a}(to right,${r})`;case"crossDiagonal":return`${a}(45deg,${r}) ${a}(-45deg,${r})`;case"diagonalLeft":return`${a}(45deg,${r})`;case"diagonalRight":return`${a}(-45deg,${r})`;case"horizontal":return`${a}(to top,${r})`;case"vertical":return`${a}(to right,${r})`}return""}}class Picture extends StringObject{constructor(e){super(Go,"picture");this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Proto extends XFAObject{constructor(e){super(Go,"proto",!0);this.appearanceFilter=new XFAObjectArray;this.arc=new XFAObjectArray;this.area=new XFAObjectArray;this.assist=new XFAObjectArray;this.barcode=new XFAObjectArray;this.bindItems=new XFAObjectArray;this.bookend=new XFAObjectArray;this.boolean=new XFAObjectArray;this.border=new XFAObjectArray;this.break=new XFAObjectArray;this.breakAfter=new XFAObjectArray;this.breakBefore=new XFAObjectArray;this.button=new XFAObjectArray;this.calculate=new XFAObjectArray;this.caption=new XFAObjectArray;this.certificate=new XFAObjectArray;this.certificates=new XFAObjectArray;this.checkButton=new XFAObjectArray;this.choiceList=new XFAObjectArray;this.color=new XFAObjectArray;this.comb=new XFAObjectArray;this.connect=new XFAObjectArray;this.contentArea=new XFAObjectArray;this.corner=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.dateTimeEdit=new XFAObjectArray;this.decimal=new XFAObjectArray;this.defaultUi=new XFAObjectArray;this.desc=new XFAObjectArray;this.digestMethod=new XFAObjectArray;this.digestMethods=new XFAObjectArray;this.draw=new XFAObjectArray;this.edge=new XFAObjectArray;this.encoding=new XFAObjectArray;this.encodings=new XFAObjectArray;this.encrypt=new XFAObjectArray;this.encryptData=new XFAObjectArray;this.encryption=new XFAObjectArray;this.encryptionMethod=new XFAObjectArray;this.encryptionMethods=new XFAObjectArray;this.event=new XFAObjectArray;this.exData=new XFAObjectArray;this.exObject=new XFAObjectArray;this.exclGroup=new XFAObjectArray;this.execute=new XFAObjectArray;this.extras=new XFAObjectArray;this.field=new XFAObjectArray;this.fill=new XFAObjectArray;this.filter=new XFAObjectArray;this.float=new XFAObjectArray;this.font=new XFAObjectArray;this.format=new XFAObjectArray;this.handler=new XFAObjectArray;this.hyphenation=new XFAObjectArray;this.image=new XFAObjectArray;this.imageEdit=new XFAObjectArray;this.integer=new XFAObjectArray;this.issuers=new XFAObjectArray;this.items=new XFAObjectArray;this.keep=new XFAObjectArray;this.keyUsage=new XFAObjectArray;this.line=new XFAObjectArray;this.linear=new XFAObjectArray;this.lockDocument=new XFAObjectArray;this.manifest=new XFAObjectArray;this.margin=new XFAObjectArray;this.mdp=new XFAObjectArray;this.medium=new XFAObjectArray;this.message=new XFAObjectArray;this.numericEdit=new XFAObjectArray;this.occur=new XFAObjectArray;this.oid=new XFAObjectArray;this.oids=new XFAObjectArray;this.overflow=new XFAObjectArray;this.pageArea=new XFAObjectArray;this.pageSet=new XFAObjectArray;this.para=new XFAObjectArray;this.passwordEdit=new XFAObjectArray;this.pattern=new XFAObjectArray;this.picture=new XFAObjectArray;this.radial=new XFAObjectArray;this.reason=new XFAObjectArray;this.reasons=new XFAObjectArray;this.rectangle=new XFAObjectArray;this.ref=new XFAObjectArray;this.script=new XFAObjectArray;this.setProperty=new XFAObjectArray;this.signData=new XFAObjectArray;this.signature=new XFAObjectArray;this.signing=new XFAObjectArray;this.solid=new XFAObjectArray;this.speak=new XFAObjectArray;this.stipple=new XFAObjectArray;this.subform=new XFAObjectArray;this.subformSet=new XFAObjectArray;this.subjectDN=new XFAObjectArray;this.subjectDNs=new XFAObjectArray;this.submit=new XFAObjectArray;this.text=new XFAObjectArray;this.textEdit=new XFAObjectArray;this.time=new XFAObjectArray;this.timeStamp=new XFAObjectArray;this.toolTip=new XFAObjectArray;this.traversal=new XFAObjectArray;this.traverse=new XFAObjectArray;this.ui=new XFAObjectArray;this.validate=new XFAObjectArray;this.value=new XFAObjectArray;this.variables=new XFAObjectArray}}class Radial extends XFAObject{constructor(e){super(Go,"radial",!0);this.id=e.id||"";this.type=getStringOption(e.type,["toEdge","toCenter"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[ho](e){e=e?e[ho]():"#FFFFFF";const t=this.color?this.color[ho]():"#000000";return`radial-gradient(circle at center, ${"toEdge"===this.type?`${e},${t}`:`${t},${e}`})`}}class Reason extends StringObject{constructor(e){super(Go,"reason");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Reasons extends XFAObject{constructor(e){super(Go,"reasons",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.reason=new XFAObjectArray}}class Rectangle extends XFAObject{constructor(e){super(Go,"rectangle",!0);this.hand=getStringOption(e.hand,["even","left","right"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.corner=new XFAObjectArray(4);this.edge=new XFAObjectArray(4);this.fill=null}[co](){const e=this.edge.children.length?this.edge.children[0]:new Edge({}),t=e[ho](),a=Object.create(null);"visible"===this.fill?.presence?Object.assign(a,this.fill[ho]()):a.fill="transparent";a.strokeWidth=measureToString("visible"===e.presence?e.thickness:0);a.stroke=t.color;const r=(this.corner.children.length?this.corner.children[0]:new Corner({}))[ho](),i={name:"svg",children:[{name:"rect",attributes:{xmlns:Vo,width:"100%",height:"100%",x:0,y:0,rx:r.radius,ry:r.radius,style:a}}],attributes:{xmlns:Vo,style:{overflow:"visible"},width:"100%",height:"100%"}};if(hasMargin(this[vs]()[vs]()))return HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[i]});i.attributes.style.position="absolute";return HTMLResult.success(i)}}class RefElement extends StringObject{constructor(e){super(Go,"ref");this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Script extends StringObject{constructor(e){super(Go,"script");this.binding=e.binding||"";this.contentType=e.contentType||"";this.id=e.id||"";this.name=e.name||"";this.runAt=getStringOption(e.runAt,["client","both","server"]);this.use=e.use||"";this.usehref=e.usehref||""}}class SetProperty extends XFAObject{constructor(e){super(Go,"setProperty");this.connection=e.connection||"";this.ref=e.ref||"";this.target=e.target||""}}class SignData extends XFAObject{constructor(e){super(Go,"signData",!0);this.id=e.id||"";this.operation=getStringOption(e.operation,["sign","clear","verify"]);this.ref=e.ref||"";this.target=e.target||"";this.use=e.use||"";this.usehref=e.usehref||"";this.filter=null;this.manifest=null}}class Signature extends XFAObject{constructor(e){super(Go,"signature",!0);this.id=e.id||"";this.type=getStringOption(e.type,["PDF1.3","PDF1.6"]);this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.filter=null;this.manifest=null;this.margin=null}}class Signing extends XFAObject{constructor(e){super(Go,"signing",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new XFAObjectArray}}class Solid extends XFAObject{constructor(e){super(Go,"solid",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[ho](e){return e?e[ho]():"#FFFFFF"}}class Speak extends StringObject{constructor(e){super(Go,"speak");this.disable=getInteger({data:e.disable,defaultValue:0,validate:e=>1===e});this.id=e.id||"";this.priority=getStringOption(e.priority,["custom","caption","name","toolTip"]);this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Stipple extends XFAObject{constructor(e){super(Go,"stipple",!0);this.id=e.id||"";this.rate=getInteger({data:e.rate,defaultValue:50,validate:e=>e>=0&&e<=100});this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[ho](e){const t=this.rate/100;return Util.makeHexColor(Math.round(e.value.r*(1-t)+this.value.r*t),Math.round(e.value.g*(1-t)+this.value.g*t),Math.round(e.value.b*(1-t)+this.value.b*t))}}class Subform extends XFAObject{constructor(e){super(Go,"subform",!0);this.access=getStringOption(e.access,["open","nonInteractive","protected","readOnly"]);this.allowMacro=getInteger({data:e.allowMacro,defaultValue:0,validate:e=>1===e});this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.columnWidths=(e.columnWidths||"").trim().split(/\\s+/).map((e=>"-1"===e?-1:getMeasurement(e)));this.h=e.h?getMeasurement(e.h):"";this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.layout=getStringOption(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);this.locale=e.locale||"";this.maxH=getMeasurement(e.maxH,"0pt");this.maxW=getMeasurement(e.maxW,"0pt");this.mergeMode=getStringOption(e.mergeMode,["consumeData","matchTemplate"]);this.minH=getMeasurement(e.minH,"0pt");this.minW=getMeasurement(e.minW,"0pt");this.name=e.name||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=getRelevant(e.relevant);this.restoreState=getStringOption(e.restoreState,["manual","auto"]);this.scope=getStringOption(e.scope,["name","none"]);this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?getMeasurement(e.w):"";this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.y,"0pt");this.assist=null;this.bind=null;this.bookend=null;this.border=null;this.break=null;this.calculate=null;this.desc=null;this.extras=null;this.keep=null;this.margin=null;this.occur=null;this.overflow=null;this.pageSet=null;this.para=null;this.traversal=null;this.validate=null;this.variables=null;this.area=new XFAObjectArray;this.breakAfter=new XFAObjectArray;this.breakBefore=new XFAObjectArray;this.connect=new XFAObjectArray;this.draw=new XFAObjectArray;this.event=new XFAObjectArray;this.exObject=new XFAObjectArray;this.exclGroup=new XFAObjectArray;this.field=new XFAObjectArray;this.proto=new XFAObjectArray;this.setProperty=new XFAObjectArray;this.subform=new XFAObjectArray;this.subformSet=new XFAObjectArray}[Cs](){const e=this[vs]();return e instanceof SubformSet?e[Cs]():e}[Rs](){return!0}[_s](){return this.layout.endsWith("-tb")&&0===this[ls].attempt&&this[ls].numberInLine>0||this[vs]()[_s]()}*[As](){yield*getContainedChildren(this)}[us](){return flushHTML(this)}[Zn](e,t){addHTML(this,e,t)}[gs](){return getAvailableSpace(this)}[js](){const e=this[Cs]();if(!e[js]())return!1;if(void 0!==this[ls]._isSplittable)return this[ls]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[ls]._isSplittable=!1;return!1}if(this.keep&&"none"!==this.keep.intact){this[ls]._isSplittable=!1;return!1}if(e.layout?.endsWith("-tb")&&0!==e[ls].numberInLine)return!1;this[ls]._isSplittable=!0;return!0}[co](e){setTabIndex(this);if(this.break){if("auto"!==this.break.after||""!==this.break.afterTarget){const e=new BreakAfter({targetType:this.break.after,target:this.break.afterTarget,startNew:this.break.startNew.toString()});e[Is]=this[Is];this[Qn](e);this.breakAfter.push(e)}if("auto"!==this.break.before||""!==this.break.beforeTarget){const e=new BreakBefore({targetType:this.break.before,target:this.break.beforeTarget,startNew:this.break.startNew.toString()});e[Is]=this[Is];this[Qn](e);this.breakBefore.push(e)}if(""!==this.break.overflowTarget){const e=new Overflow({target:this.break.overflowTarget,leader:this.break.overflowLeader,trailer:this.break.overflowTrailer});e[Is]=this[Is];this[Qn](e);this.overflow.push(e)}this[Zs](this.break);this.break=null}if("hidden"===this.presence||"inactive"===this.presence)return HTMLResult.EMPTY;(this.breakBefore.children.length>1||this.breakAfter.children.length>1)&&warn("XFA - Several breakBefore or breakAfter in subforms: please file a bug.");if(this.breakBefore.children.length>=1){const e=this.breakBefore.children[0];if(handleBreak(e))return HTMLResult.breakNode(e)}if(this[ls]?.afterBreakAfter)return HTMLResult.EMPTY;fixDimensions(this);const t=[],a={id:this[uo],class:[]};setAccess(this,a.class);this[ls]||=Object.create(null);Object.assign(this[ls],{children:t,line:null,attributes:a,attempt:0,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const r=this[Fs](),i=r[ls].noLayoutFailure,n=this[js]();n||setFirstUnsplittable(this);if(!checkDimensions(this,e))return HTMLResult.FAILURE;const s=new Set(["area","draw","exclGroup","field","subform","subformSet"]);if(this.layout.includes("row")){const e=this[Cs]().columnWidths;if(Array.isArray(e)&&e.length>0){this[ls].columnWidths=e;this[ls].currentColumn=0}}const o=toStyle(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),c=["xfaSubform"],l=layoutClass(this);l&&c.push(l);a.style=o;a.class=c;this.name&&(a.xfaName=this.name);if(this.overflow){const t=this.overflow[ws]();if(t.addLeader){t.addLeader=!1;handleOverflow(this,t.leader,e)}}this[Ys]();const h="lr-tb"===this.layout||"rl-tb"===this.layout,u=h?2:1;for(;this[ls].attempt<u;this[ls].attempt++){h&&1===this[ls].attempt&&(this[ls].numberInLine=0);const e=this[es]({filter:s,include:!0});if(e.success)break;if(e.isBreak()){this[Js]();return e}if(h&&0===this[ls].attempt&&0===this[ls].numberInLine&&!r[ls].noLayoutFailure){this[ls].attempt=u;break}}this[Js]();n||unsetFirstUnsplittable(this);r[ls].noLayoutFailure=i;if(this[ls].attempt===u){this.overflow&&(this[Fs]()[ls].overflowNode=this.overflow);n||delete this[ls];return HTMLResult.FAILURE}if(this.overflow){const t=this.overflow[ws]();if(t.addTrailer){t.addTrailer=!1;handleOverflow(this,t.trailer,e)}}let d=0,f=0;if(this.margin){d=this.margin.leftInset+this.margin.rightInset;f=this.margin.topInset+this.margin.bottomInset}const g=Math.max(this[ls].width+d,this.w||0),p=Math.max(this[ls].height+f,this.h||0),m=[this.x,this.y,g,p];""===this.w&&(o.width=measureToString(g));""===this.h&&(o.height=measureToString(p));if(("0px"===o.width||"0px"===o.height)&&0===t.length)return HTMLResult.EMPTY;const b={name:"div",attributes:a,children:t};applyAssist(this,a);const y=HTMLResult.success(createWrapper(this,b),m);if(this.breakAfter.children.length>=1){const e=this.breakAfter.children[0];if(handleBreak(e)){this[ls].afterBreakAfter=y;return HTMLResult.breakNode(e)}}delete this[ls];return y}}class SubformSet extends XFAObject{constructor(e){super(Go,"subformSet",!0);this.id=e.id||"";this.name=e.name||"";this.relation=getStringOption(e.relation,["ordered","choice","unordered"]);this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.bookend=null;this.break=null;this.desc=null;this.extras=null;this.occur=null;this.overflow=null;this.breakAfter=new XFAObjectArray;this.breakBefore=new XFAObjectArray;this.subform=new XFAObjectArray;this.subformSet=new XFAObjectArray}*[As](){yield*getContainedChildren(this)}[Cs](){let e=this[vs]();for(;!(e instanceof Subform);)e=e[vs]();return e}[Rs](){return!0}}class SubjectDN extends ContentObject{constructor(e){super(Go,"subjectDN");this.delimiter=e.delimiter||",";this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[hs](){this[ss]=new Map(this[ss].split(this.delimiter).map((e=>{(e=e.split("=",2))[0]=e[0].trim();return e})))}}class SubjectDNs extends XFAObject{constructor(e){super(Go,"subjectDNs",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.subjectDN=new XFAObjectArray}}class Submit extends XFAObject{constructor(e){super(Go,"submit",!0);this.embedPDF=getInteger({data:e.embedPDF,defaultValue:0,validate:e=>1===e});this.format=getStringOption(e.format,["xdp","formdata","pdf","urlencoded","xfd","xml"]);this.id=e.id||"";this.target=e.target||"";this.textEncoding=getKeyword({data:e.textEncoding?e.textEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\\d{2}/)});this.use=e.use||"";this.usehref=e.usehref||"";this.xdpContent=e.xdpContent||"";this.encrypt=null;this.encryptData=new XFAObjectArray;this.signData=new XFAObjectArray}}class Template extends XFAObject{constructor(e){super(Go,"template",!0);this.baseProfile=getStringOption(e.baseProfile,["full","interactiveForms"]);this.extras=null;this.subform=new XFAObjectArray}[hs](){0===this.subform.children.length&&warn("XFA - No subforms in template node.");this.subform.children.length>=2&&warn("XFA - Several subforms in template node: please file a bug.");this[no]=5e3}[js](){return!0}[to](e,t){return e.startsWith("#")?[this[Os].get(e.slice(1))]:searchNode(this,t,e,!0,!0)}*[oo](){if(!this.subform.children.length)return HTMLResult.success({name:"div",children:[]});this[ls]={overflowNode:null,firstUnsplittable:null,currentContentArea:null,currentPageArea:null,noLayoutFailure:!1,pageNumber:1,pagePosition:"first",oddOrEven:"odd",blankOrNotBlank:"nonBlank",paraStack:[]};const e=this.subform.children[0];e.pageSet[as]();const t=e.pageSet.pageArea.children,a={name:"div",children:[]};let r=null,i=null,n=null;if(e.breakBefore.children.length>=1){i=e.breakBefore.children[0];n=i.target}else if(e.subform.children.length>=1&&e.subform.children[0].breakBefore.children.length>=1){i=e.subform.children[0].breakBefore.children[0];n=i.target}else if(e.break?.beforeTarget){i=e.break;n=i.beforeTarget}else if(e.subform.children.length>=1&&e.subform.children[0].break?.beforeTarget){i=e.subform.children[0].break;n=i.beforeTarget}if(i){const e=this[to](n,i[vs]());if(e instanceof PageArea){r=e;i[ls]={}}}r||=t[0];r[ls]={numberOfUse:1};const s=r[vs]();s[ls]={numberOfUse:1,pageIndex:s.pageArea.children.indexOf(r),pageSetIndex:0};let o,c=null,l=null,h=!0,u=0,d=0;for(;;){if(h)u=0;else{a.children.pop();if(3==++u){warn("XFA - Something goes wrong: please file a bug.");return a}}o=null;this[ls].currentPageArea=r;const t=r[co]().html;a.children.push(t);if(c){this[ls].noLayoutFailure=!0;t.children.push(c[co](r[ls].space).html);c=null}if(l){this[ls].noLayoutFailure=!0;t.children.push(l[co](r[ls].space).html);l=null}const i=r.contentArea.children,n=t.children.filter((e=>e.attributes.class.includes("xfaContentarea")));h=!1;this[ls].firstUnsplittable=null;this[ls].noLayoutFailure=!1;const flush=t=>{const a=e[us]();if(a){h||=a.children?.length>0;n[t].children.push(a)}};for(let t=d,r=i.length;t<r;t++){const r=this[ls].currentContentArea=i[t],s={width:r.w,height:r.h};d=0;if(c){n[t].children.push(c[co](s).html);c=null}if(l){n[t].children.push(l[co](s).html);l=null}const u=e[co](s);if(u.success){if(u.html){h||=u.html.children?.length>0;n[t].children.push(u.html)}else!h&&a.children.length>1&&a.children.pop();return a}if(u.isBreak()){const e=u.breakNode;flush(t);if("auto"===e.targetType)continue;if(e.leader){c=this[to](e.leader,e[vs]());c=c?c[0]:null}if(e.trailer){l=this[to](e.trailer,e[vs]());l=l?l[0]:null}if("pageArea"===e.targetType){o=e[ls].target;t=1/0}else if(e[ls].target){o=e[ls].target;d=e[ls].index+1;t=1/0}else t=e[ls].index}else if(this[ls].overflowNode){const e=this[ls].overflowNode;this[ls].overflowNode=null;const a=e[ws](),r=a.target;a.addLeader=null!==a.leader;a.addTrailer=null!==a.trailer;flush(t);const n=t;t=1/0;if(r instanceof PageArea)o=r;else if(r instanceof ContentArea){const e=i.indexOf(r);if(-1!==e)e>n?t=e-1:d=e;else{o=r[vs]();d=o.contentArea.children.indexOf(r)}}}else flush(t)}this[ls].pageNumber+=1;o&&(o[Xs]()?o[ls].numberOfUse+=1:o=null);r=o||r[ks]();yield null}}}class Text extends ContentObject{constructor(e){super(Go,"text");this.id=e.id||"";this.maxChars=getInteger({data:e.maxChars,defaultValue:0,validate:e=>e>=0});this.name=e.name||"";this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}[Yn](){return!0}[$s](e){if(e[Hs]===go.xhtml.id){this[ss]=e;return!0}warn(`XFA - Invalid content in Text: ${e[Ws]}.`);return!1}[Vs](e){this[ss]instanceof XFAObject||super[Vs](e)}[hs](){"string"==typeof this[ss]&&(this[ss]=this[ss].replaceAll("\\r\\n","\\n"))}[ws](){return"string"==typeof this[ss]?this[ss].split(/[\\u2029\\u2028\\n]/).filter((e=>!!e)).join("\\n"):this[ss][so]()}[co](e){if("string"==typeof this[ss]){const e=valueToHtml(this[ss]).html;if(this[ss].includes("\\u2029")){e.name="div";e.children=[];this[ss].split("\\u2029").map((e=>e.split(/[\\u2028\\n]/).flatMap((e=>[{name:"span",value:e},{name:"br"}])))).forEach((t=>{e.children.push({name:"p",children:t})}))}else if(/[\\u2028\\n]/.test(this[ss])){e.name="div";e.children=[];this[ss].split(/[\\u2028\\n]/).forEach((t=>{e.children.push({name:"span",value:t},{name:"br"})}))}return HTMLResult.success(e)}return this[ss][co](e)}}class TextEdit extends XFAObject{constructor(e){super(Go,"textEdit",!0);this.allowRichText=getInteger({data:e.allowRichText,defaultValue:0,validate:e=>1===e});this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.multiLine=getInteger({data:e.multiLine,defaultValue:"",validate:e=>0===e||1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.vScrollPolicy=getStringOption(e.vScrollPolicy,["auto","off","on"]);this.border=null;this.comb=null;this.extras=null;this.margin=null}[co](e){const t=toStyle(this,"border","font","margin");let a;const r=this[vs]()[vs]();""===this.multiLine&&(this.multiLine=r instanceof Draw?1:0);a=1===this.multiLine?{name:"textarea",attributes:{dataId:r[os]?.[uo]||r[uo],fieldId:r[uo],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(r),"aria-required":!1}}:{name:"input",attributes:{type:"text",dataId:r[os]?.[uo]||r[uo],fieldId:r[uo],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(r),"aria-required":!1}};if(isRequired(r)){a.attributes["aria-required"]=!0;a.attributes.required=!0}return HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[a]})}}class Time extends StringObject{constructor(e){super(Go,"time");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[hs](){const e=this[ss].trim();this[ss]=e?new Date(e):null}[co](e){return valueToHtml(this[ss]?this[ss].toString():"")}}class TimeStamp extends XFAObject{constructor(e){super(Go,"timeStamp");this.id=e.id||"";this.server=e.server||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class ToolTip extends StringObject{constructor(e){super(Go,"toolTip");this.id=e.id||"";this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Traversal extends XFAObject{constructor(e){super(Go,"traversal",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.traverse=new XFAObjectArray}}class Traverse extends XFAObject{constructor(e){super(Go,"traverse",!0);this.id=e.id||"";this.operation=getStringOption(e.operation,["next","back","down","first","left","right","up"]);this.ref=e.ref||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.script=null}get name(){return this.operation}[Us](){return!1}}class Ui extends XFAObject{constructor(e){super(Go,"ui",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.picture=null;this.barcode=null;this.button=null;this.checkButton=null;this.choiceList=null;this.dateTimeEdit=null;this.defaultUi=null;this.imageEdit=null;this.numericEdit=null;this.passwordEdit=null;this.signature=null;this.textEdit=null}[ws](){if(void 0===this[ls]){for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"picture"===e)continue;const t=this[e];if(t instanceof XFAObject){this[ls]=t;return t}}this[ls]=null}return this[ls]}[co](e){const t=this[ws]();return t?t[co](e):HTMLResult.EMPTY}}class Validate extends XFAObject{constructor(e){super(Go,"validate",!0);this.formatTest=getStringOption(e.formatTest,["warning","disabled","error"]);this.id=e.id||"";this.nullTest=getStringOption(e.nullTest,["disabled","error","warning"]);this.scriptTest=getStringOption(e.scriptTest,["error","disabled","warning"]);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.message=null;this.picture=null;this.script=null}}class Value extends XFAObject{constructor(e){super(Go,"value",!0);this.id=e.id||"";this.override=getInteger({data:e.override,defaultValue:0,validate:e=>1===e});this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.arc=null;this.boolean=null;this.date=null;this.dateTime=null;this.decimal=null;this.exData=null;this.float=null;this.image=null;this.integer=null;this.line=null;this.rectangle=null;this.text=null;this.time=null}[io](e){const t=this[vs]();if(t instanceof Field&&t.ui?.imageEdit){if(!this.image){this.image=new Image({});this[Qn](this.image)}this.image[ss]=e[ss];return}const a=e[Ws];if(null===this[a]){for(const e of Object.getOwnPropertyNames(this)){const t=this[e];if(t instanceof XFAObject){this[e]=null;this[Zs](t)}}this[e[Ws]]=e;this[Qn](e)}else this[a][ss]=e[ss]}[so](){if(this.exData)return"string"==typeof this.exData[ss]?this.exData[ss].trim():this.exData[ss][so]().trim();for(const e of Object.getOwnPropertyNames(this)){if("image"===e)continue;const t=this[e];if(t instanceof XFAObject)return(t[ss]||"").toString().trim()}return null}[co](e){for(const t of Object.getOwnPropertyNames(this)){const a=this[t];if(a instanceof XFAObject)return a[co](e)}return HTMLResult.EMPTY}}class Variables extends XFAObject{constructor(e){super(Go,"variables",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.decimal=new XFAObjectArray;this.exData=new XFAObjectArray;this.float=new XFAObjectArray;this.image=new XFAObjectArray;this.integer=new XFAObjectArray;this.manifest=new XFAObjectArray;this.script=new XFAObjectArray;this.text=new XFAObjectArray;this.time=new XFAObjectArray}[Us](){return!0}}class TemplateNamespace{static[fo](e,t){if(TemplateNamespace.hasOwnProperty(e)){const a=TemplateNamespace[e](t);a[ro](t);return a}}static appearanceFilter(e){return new AppearanceFilter(e)}static arc(e){return new Arc(e)}static area(e){return new Area(e)}static assist(e){return new Assist(e)}static barcode(e){return new Barcode(e)}static bind(e){return new Bind(e)}static bindItems(e){return new BindItems(e)}static bookend(e){return new Bookend(e)}static boolean(e){return new BooleanElement(e)}static border(e){return new Border(e)}static break(e){return new Break(e)}static breakAfter(e){return new BreakAfter(e)}static breakBefore(e){return new BreakBefore(e)}static button(e){return new Button(e)}static calculate(e){return new Calculate(e)}static caption(e){return new Caption(e)}static certificate(e){return new Certificate(e)}static certificates(e){return new Certificates(e)}static checkButton(e){return new CheckButton(e)}static choiceList(e){return new ChoiceList(e)}static color(e){return new Color(e)}static comb(e){return new Comb(e)}static connect(e){return new Connect(e)}static contentArea(e){return new ContentArea(e)}static corner(e){return new Corner(e)}static date(e){return new DateElement(e)}static dateTime(e){return new DateTime(e)}static dateTimeEdit(e){return new DateTimeEdit(e)}static decimal(e){return new Decimal(e)}static defaultUi(e){return new DefaultUi(e)}static desc(e){return new Desc(e)}static digestMethod(e){return new DigestMethod(e)}static digestMethods(e){return new DigestMethods(e)}static draw(e){return new Draw(e)}static edge(e){return new Edge(e)}static encoding(e){return new Encoding(e)}static encodings(e){return new Encodings(e)}static encrypt(e){return new Encrypt(e)}static encryptData(e){return new EncryptData(e)}static encryption(e){return new Encryption(e)}static encryptionMethod(e){return new EncryptionMethod(e)}static encryptionMethods(e){return new EncryptionMethods(e)}static event(e){return new Event(e)}static exData(e){return new ExData(e)}static exObject(e){return new ExObject(e)}static exclGroup(e){return new ExclGroup(e)}static execute(e){return new Execute(e)}static extras(e){return new Extras(e)}static field(e){return new Field(e)}static fill(e){return new Fill(e)}static filter(e){return new Filter(e)}static float(e){return new Float(e)}static font(e){return new template_Font(e)}static format(e){return new Format(e)}static handler(e){return new Handler(e)}static hyphenation(e){return new Hyphenation(e)}static image(e){return new Image(e)}static imageEdit(e){return new ImageEdit(e)}static integer(e){return new Integer(e)}static issuers(e){return new Issuers(e)}static items(e){return new Items(e)}static keep(e){return new Keep(e)}static keyUsage(e){return new KeyUsage(e)}static line(e){return new Line(e)}static linear(e){return new Linear(e)}static lockDocument(e){return new LockDocument(e)}static manifest(e){return new Manifest(e)}static margin(e){return new Margin(e)}static mdp(e){return new Mdp(e)}static medium(e){return new Medium(e)}static message(e){return new Message(e)}static numericEdit(e){return new NumericEdit(e)}static occur(e){return new Occur(e)}static oid(e){return new Oid(e)}static oids(e){return new Oids(e)}static overflow(e){return new Overflow(e)}static pageArea(e){return new PageArea(e)}static pageSet(e){return new PageSet(e)}static para(e){return new Para(e)}static passwordEdit(e){return new PasswordEdit(e)}static pattern(e){return new template_Pattern(e)}static picture(e){return new Picture(e)}static proto(e){return new Proto(e)}static radial(e){return new Radial(e)}static reason(e){return new Reason(e)}static reasons(e){return new Reasons(e)}static rectangle(e){return new Rectangle(e)}static ref(e){return new RefElement(e)}static script(e){return new Script(e)}static setProperty(e){return new SetProperty(e)}static signData(e){return new SignData(e)}static signature(e){return new Signature(e)}static signing(e){return new Signing(e)}static solid(e){return new Solid(e)}static speak(e){return new Speak(e)}static stipple(e){return new Stipple(e)}static subform(e){return new Subform(e)}static subformSet(e){return new SubformSet(e)}static subjectDN(e){return new SubjectDN(e)}static subjectDNs(e){return new SubjectDNs(e)}static submit(e){return new Submit(e)}static template(e){return new Template(e)}static text(e){return new Text(e)}static textEdit(e){return new TextEdit(e)}static time(e){return new Time(e)}static timeStamp(e){return new TimeStamp(e)}static toolTip(e){return new ToolTip(e)}static traversal(e){return new Traversal(e)}static traverse(e){return new Traverse(e)}static ui(e){return new Ui(e)}static validate(e){return new Validate(e)}static value(e){return new Value(e)}static variables(e){return new Variables(e)}}const Zo=go.datasets.id;function createText(e){const t=new Text({});t[ss]=e;return t}class Binder{constructor(e){this.root=e;this.datasets=e.datasets;this.data=e.datasets?.data||new XmlObject(go.datasets.id,"data");this.emptyMerge=0===this.data[Ss]().length;this.root.form=this.form=e.template[is]()}_isConsumeData(){return!this.emptyMerge&&this._mergeMode}_isMatchTemplate(){return!this._isConsumeData()}bind(){this._bindElement(this.form,this.data);return this.form}getData(){return this.data}_bindValue(e,t,a){e[os]=t;if(e[Ts]())if(t[Ns]()){const a=t[ys]();e[io](createText(a))}else if(e instanceof Field&&"multiSelect"===e.ui?.choiceList?.open){const a=t[Ss]().map((e=>e[ss].trim())).join("\\n");e[io](createText(a))}else this._isConsumeData()&&warn("XFA - Nodes haven\'t the same type.");else!t[Ns]()||this._isMatchTemplate()?this._bindElement(e,t):warn("XFA - Nodes haven\'t the same type.")}_findDataByNameToConsume(e,t,a,r){if(!e)return null;let i,n;for(let r=0;r<3;r++){i=a[xs](e,!1,!0);for(;;){n=i.next().value;if(!n)break;if(t===n[Ns]())return n}if(a[Hs]===go.datasets.id&&"data"===a[Ws])break;a=a[vs]()}if(!r)return null;i=this.data[xs](e,!0,!1);n=i.next().value;if(n)return n;i=this.data[ds](e,!0);n=i.next().value;return n?.[Ns]()?n:null}_setProperties(e,t){if(e.hasOwnProperty("setProperty"))for(const{ref:a,target:r,connection:i}of e.setProperty.children){if(i)continue;if(!a)continue;const n=searchNode(this.root,t,a,!1,!1);if(!n){warn(`XFA - Invalid reference: ${a}.`);continue}const[s]=n;if(!s[Es](this.data)){warn("XFA - Invalid node: must be a data node.");continue}const o=searchNode(this.root,e,r,!1,!1);if(!o){warn(`XFA - Invalid target: ${r}.`);continue}const[c]=o;if(!c[Es](e)){warn("XFA - Invalid target: must be a property or subproperty.");continue}const l=c[vs]();if(c instanceof SetProperty||l instanceof SetProperty){warn("XFA - Invalid target: cannot be a setProperty or one of its properties.");continue}if(c instanceof BindItems||l instanceof BindItems){warn("XFA - Invalid target: cannot be a bindItems or one of its properties.");continue}const h=s[so](),u=c[Ws];if(c instanceof XFAAttribute){const e=Object.create(null);e[u]=h;const t=Reflect.construct(Object.getPrototypeOf(l).constructor,[e]);l[u]=t[u]}else if(c.hasOwnProperty(ss)){c[os]=s;c[ss]=h;c[hs]()}else warn("XFA - Invalid node to use in setProperty")}}_bindItems(e,t){if(!e.hasOwnProperty("items")||!e.hasOwnProperty("bindItems")||e.bindItems.isEmpty())return;for(const t of e.items.children)e[Zs](t);e.items.clear();const a=new Items({}),r=new Items({});e[Qn](a);e.items.push(a);e[Qn](r);e.items.push(r);for(const{ref:i,labelRef:n,valueRef:s,connection:o}of e.bindItems.children){if(o)continue;if(!i)continue;const e=searchNode(this.root,t,i,!1,!1);if(e)for(const t of e){if(!t[Es](this.datasets)){warn(`XFA - Invalid ref (${i}): must be a datasets child.`);continue}const e=searchNode(this.root,t,n,!0,!1);if(!e){warn(`XFA - Invalid label: ${n}.`);continue}const[o]=e;if(!o[Es](this.datasets)){warn("XFA - Invalid label: must be a datasets child.");continue}const c=searchNode(this.root,t,s,!0,!1);if(!c){warn(`XFA - Invalid value: ${s}.`);continue}const[l]=c;if(!l[Es](this.datasets)){warn("XFA - Invalid value: must be a datasets child.");continue}const h=createText(o[so]()),u=createText(l[so]());a[Qn](h);a.text.push(h);r[Qn](u);r.text.push(u)}else warn(`XFA - Invalid reference: ${i}.`)}}_bindOccurrences(e,t,a){let r;if(t.length>1){r=e[is]();r[Zs](r.occur);r.occur=null}this._bindValue(e,t[0],a);this._setProperties(e,t[0]);this._bindItems(e,t[0]);if(1===t.length)return;const i=e[vs](),n=e[Ws],s=i[Ms](e);for(let e=1,o=t.length;e<o;e++){const o=t[e],c=r[is]();i[n].push(c);i[Ds](s+e,c);this._bindValue(c,o,a);this._setProperties(c,o);this._bindItems(c,o)}}_createOccurrences(e){if(!this.emptyMerge)return;const{occur:t}=e;if(!t||t.initial<=1)return;const a=e[vs](),r=e[Ws];if(!(a[r]instanceof XFAObjectArray))return;let i;i=e.name?a[r].children.filter((t=>t.name===e.name)).length:a[r].children.length;const n=a[Ms](e)+1,s=t.initial-i;if(s){const t=e[is]();t[Zs](t.occur);t.occur=null;a[r].push(t);a[Ds](n,t);for(let e=1;e<s;e++){const i=t[is]();a[r].push(i);a[Ds](n+e,i)}}}_getOccurInfo(e){const{name:t,occur:a}=e;if(!a||!t)return[1,1];const r=-1===a.max?1/0:a.max;return[a.min,r]}_setAndBind(e,t){this._setProperties(e,t);this._bindItems(e,t);this._bindElement(e,t)}_bindElement(e,t){const a=[];this._createOccurrences(e);for(const r of e[Ss]()){if(r[os])continue;if(void 0===this._mergeMode&&"subform"===r[Ws]){this._mergeMode="consumeData"===r.mergeMode;const e=t[Ss]();if(e.length>0)this._bindOccurrences(r,[e[0]],null);else if(this.emptyMerge){const e=t[Hs]===Zo?-1:t[Hs],a=r[os]=new XmlObject(e,r.name||"root");t[Qn](a);this._bindElement(r,a)}continue}if(!r[Rs]())continue;let e=!1,i=null,n=null,s=null;if(r.bind){switch(r.bind.match){case"none":this._setAndBind(r,t);continue;case"global":e=!0;break;case"dataRef":if(!r.bind.ref){warn(`XFA - ref is empty in node ${r[Ws]}.`);this._setAndBind(r,t);continue}n=r.bind.ref}r.bind.picture&&(i=r.bind.picture[ss])}const[o,c]=this._getOccurInfo(r);if(n){s=searchNode(this.root,t,n,!0,!1);if(null===s){s=createDataNode(this.data,t,n);if(!s)continue;this._isConsumeData()&&(s[ns]=!0);this._setAndBind(r,s);continue}this._isConsumeData()&&(s=s.filter((e=>!e[ns])));s.length>c?s=s.slice(0,c):0===s.length&&(s=null);s&&this._isConsumeData()&&s.forEach((e=>{e[ns]=!0}))}else{if(!r.name){this._setAndBind(r,t);continue}if(this._isConsumeData()){const a=[];for(;a.length<c;){const i=this._findDataByNameToConsume(r.name,r[Ts](),t,e);if(!i)break;i[ns]=!0;a.push(i)}s=a.length>0?a:null}else{s=t[xs](r.name,!1,this.emptyMerge).next().value;if(!s){if(0===o){a.push(r);continue}const e=t[Hs]===Zo?-1:t[Hs];s=r[os]=new XmlObject(e,r.name);this.emptyMerge&&(s[ns]=!0);t[Qn](s);this._setAndBind(r,s);continue}this.emptyMerge&&(s[ns]=!0);s=[s]}}s?this._bindOccurrences(r,s,i):o>0?this._setAndBind(r,t):a.push(r)}a.forEach((e=>e[vs]()[Zs](e)))}}class DataHandler{constructor(e,t){this.data=t;this.dataset=e.datasets||null}serialize(e){const t=[[-1,this.data[Ss]()]];for(;t.length>0;){const a=t.at(-1),[r,i]=a;if(r+1===i.length){t.pop();continue}const n=i[++a[0]],s=e.get(n[uo]);if(s)n[io](s);else{const t=n[fs]();for(const a of t.values()){const t=e.get(a[uo]);if(t){a[io](t);break}}}const o=n[Ss]();o.length>0&&t.push([-1,o])}const a=[\'<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">\'];if(this.dataset)for(const e of this.dataset[Ss]())"data"!==e[Ws]&&e[lo](a);this.data[lo](a);a.push("</xfa:datasets>");return a.join("")}}const Qo=go.config.id;class Acrobat extends XFAObject{constructor(e){super(Qo,"acrobat",!0);this.acrobat7=null;this.autoSave=null;this.common=null;this.validate=null;this.validateApprovalSignatures=null;this.submitUrl=new XFAObjectArray}}class Acrobat7 extends XFAObject{constructor(e){super(Qo,"acrobat7",!0);this.dynamicRender=null}}class ADBE_JSConsole extends OptionObject{constructor(e){super(Qo,"ADBE_JSConsole",["delegate","Enable","Disable"])}}class ADBE_JSDebugger extends OptionObject{constructor(e){super(Qo,"ADBE_JSDebugger",["delegate","Enable","Disable"])}}class AddSilentPrint extends Option01{constructor(e){super(Qo,"addSilentPrint")}}class AddViewerPreferences extends Option01{constructor(e){super(Qo,"addViewerPreferences")}}class AdjustData extends Option10{constructor(e){super(Qo,"adjustData")}}class AdobeExtensionLevel extends IntegerObject{constructor(e){super(Qo,"adobeExtensionLevel",0,(e=>e>=1&&e<=8))}}class Agent extends XFAObject{constructor(e){super(Qo,"agent",!0);this.name=e.name?e.name.trim():"";this.common=new XFAObjectArray}}class AlwaysEmbed extends ContentObject{constructor(e){super(Qo,"alwaysEmbed")}}class Amd extends StringObject{constructor(e){super(Qo,"amd")}}class config_Area extends XFAObject{constructor(e){super(Qo,"area");this.level=getInteger({data:e.level,defaultValue:0,validate:e=>e>=1&&e<=3});this.name=getStringOption(e.name,["","barcode","coreinit","deviceDriver","font","general","layout","merge","script","signature","sourceSet","templateCache"])}}class Attributes extends OptionObject{constructor(e){super(Qo,"attributes",["preserve","delegate","ignore"])}}class AutoSave extends OptionObject{constructor(e){super(Qo,"autoSave",["disabled","enabled"])}}class Base extends StringObject{constructor(e){super(Qo,"base")}}class BatchOutput extends XFAObject{constructor(e){super(Qo,"batchOutput");this.format=getStringOption(e.format,["none","concat","zip","zipCompress"])}}class BehaviorOverride extends ContentObject{constructor(e){super(Qo,"behaviorOverride")}[hs](){this[ss]=new Map(this[ss].trim().split(/\\s+/).filter((e=>e.includes(":"))).map((e=>e.split(":",2))))}}class Cache extends XFAObject{constructor(e){super(Qo,"cache",!0);this.templateCache=null}}class Change extends Option01{constructor(e){super(Qo,"change")}}class Common extends XFAObject{constructor(e){super(Qo,"common",!0);this.data=null;this.locale=null;this.localeSet=null;this.messaging=null;this.suppressBanner=null;this.template=null;this.validationMessaging=null;this.versionControl=null;this.log=new XFAObjectArray}}class Compress extends XFAObject{constructor(e){super(Qo,"compress");this.scope=getStringOption(e.scope,["imageOnly","document"])}}class CompressLogicalStructure extends Option01{constructor(e){super(Qo,"compressLogicalStructure")}}class CompressObjectStream extends Option10{constructor(e){super(Qo,"compressObjectStream")}}class Compression extends XFAObject{constructor(e){super(Qo,"compression",!0);this.compressLogicalStructure=null;this.compressObjectStream=null;this.level=null;this.type=null}}class Config extends XFAObject{constructor(e){super(Qo,"config",!0);this.acrobat=null;this.present=null;this.trace=null;this.agent=new XFAObjectArray}}class Conformance extends OptionObject{constructor(e){super(Qo,"conformance",["A","B"])}}class ContentCopy extends Option01{constructor(e){super(Qo,"contentCopy")}}class Copies extends IntegerObject{constructor(e){super(Qo,"copies",1,(e=>e>=1))}}class Creator extends StringObject{constructor(e){super(Qo,"creator")}}class CurrentPage extends IntegerObject{constructor(e){super(Qo,"currentPage",0,(e=>e>=0))}}class Data extends XFAObject{constructor(e){super(Qo,"data",!0);this.adjustData=null;this.attributes=null;this.incrementalLoad=null;this.outputXSL=null;this.range=null;this.record=null;this.startNode=null;this.uri=null;this.window=null;this.xsl=null;this.excludeNS=new XFAObjectArray;this.transform=new XFAObjectArray}}class Debug extends XFAObject{constructor(e){super(Qo,"debug",!0);this.uri=null}}class DefaultTypeface extends ContentObject{constructor(e){super(Qo,"defaultTypeface");this.writingScript=getStringOption(e.writingScript,["*","Arabic","Cyrillic","EastEuropeanRoman","Greek","Hebrew","Japanese","Korean","Roman","SimplifiedChinese","Thai","TraditionalChinese","Vietnamese"])}}class Destination extends OptionObject{constructor(e){super(Qo,"destination",["pdf","pcl","ps","webClient","zpl"])}}class DocumentAssembly extends Option01{constructor(e){super(Qo,"documentAssembly")}}class Driver extends XFAObject{constructor(e){super(Qo,"driver",!0);this.name=e.name?e.name.trim():"";this.fontInfo=null;this.xdc=null}}class DuplexOption extends OptionObject{constructor(e){super(Qo,"duplexOption",["simplex","duplexFlipLongEdge","duplexFlipShortEdge"])}}class DynamicRender extends OptionObject{constructor(e){super(Qo,"dynamicRender",["forbidden","required"])}}class Embed extends Option01{constructor(e){super(Qo,"embed")}}class config_Encrypt extends Option01{constructor(e){super(Qo,"encrypt")}}class config_Encryption extends XFAObject{constructor(e){super(Qo,"encryption",!0);this.encrypt=null;this.encryptionLevel=null;this.permissions=null}}class EncryptionLevel extends OptionObject{constructor(e){super(Qo,"encryptionLevel",["40bit","128bit"])}}class Enforce extends StringObject{constructor(e){super(Qo,"enforce")}}class Equate extends XFAObject{constructor(e){super(Qo,"equate");this.force=getInteger({data:e.force,defaultValue:1,validate:e=>0===e});this.from=e.from||"";this.to=e.to||""}}class EquateRange extends XFAObject{constructor(e){super(Qo,"equateRange");this.from=e.from||"";this.to=e.to||"";this._unicodeRange=e.unicodeRange||""}get unicodeRange(){const e=[],t=/U\\+([0-9a-fA-F]+)/,a=this._unicodeRange;for(let r of a.split(",").map((e=>e.trim())).filter((e=>!!e))){r=r.split("-",2).map((e=>{const a=e.match(t);return a?parseInt(a[1],16):0}));1===r.length&&r.push(r[0]);e.push(r)}return shadow(this,"unicodeRange",e)}}class Exclude extends ContentObject{constructor(e){super(Qo,"exclude")}[hs](){this[ss]=this[ss].trim().split(/\\s+/).filter((e=>e&&["calculate","close","enter","exit","initialize","ready","validate"].includes(e)))}}class ExcludeNS extends StringObject{constructor(e){super(Qo,"excludeNS")}}class FlipLabel extends OptionObject{constructor(e){super(Qo,"flipLabel",["usePrinterSetting","on","off"])}}class config_FontInfo extends XFAObject{constructor(e){super(Qo,"fontInfo",!0);this.embed=null;this.map=null;this.subsetBelow=null;this.alwaysEmbed=new XFAObjectArray;this.defaultTypeface=new XFAObjectArray;this.neverEmbed=new XFAObjectArray}}class FormFieldFilling extends Option01{constructor(e){super(Qo,"formFieldFilling")}}class GroupParent extends StringObject{constructor(e){super(Qo,"groupParent")}}class IfEmpty extends OptionObject{constructor(e){super(Qo,"ifEmpty",["dataValue","dataGroup","ignore","remove"])}}class IncludeXDPContent extends StringObject{constructor(e){super(Qo,"includeXDPContent")}}class IncrementalLoad extends OptionObject{constructor(e){super(Qo,"incrementalLoad",["none","forwardOnly"])}}class IncrementalMerge extends Option01{constructor(e){super(Qo,"incrementalMerge")}}class Interactive extends Option01{constructor(e){super(Qo,"interactive")}}class Jog extends OptionObject{constructor(e){super(Qo,"jog",["usePrinterSetting","none","pageSet"])}}class LabelPrinter extends XFAObject{constructor(e){super(Qo,"labelPrinter",!0);this.name=getStringOption(e.name,["zpl","dpl","ipl","tcpl"]);this.batchOutput=null;this.flipLabel=null;this.fontInfo=null;this.xdc=null}}class Layout extends OptionObject{constructor(e){super(Qo,"layout",["paginate","panel"])}}class Level extends IntegerObject{constructor(e){super(Qo,"level",0,(e=>e>0))}}class Linearized extends Option01{constructor(e){super(Qo,"linearized")}}class Locale extends StringObject{constructor(e){super(Qo,"locale")}}class LocaleSet extends StringObject{constructor(e){super(Qo,"localeSet")}}class Log extends XFAObject{constructor(e){super(Qo,"log",!0);this.mode=null;this.threshold=null;this.to=null;this.uri=null}}class MapElement extends XFAObject{constructor(e){super(Qo,"map",!0);this.equate=new XFAObjectArray;this.equateRange=new XFAObjectArray}}class MediumInfo extends XFAObject{constructor(e){super(Qo,"mediumInfo",!0);this.map=null}}class config_Message extends XFAObject{constructor(e){super(Qo,"message",!0);this.msgId=null;this.severity=null}}class Messaging extends XFAObject{constructor(e){super(Qo,"messaging",!0);this.message=new XFAObjectArray}}class Mode extends OptionObject{constructor(e){super(Qo,"mode",["append","overwrite"])}}class ModifyAnnots extends Option01{constructor(e){super(Qo,"modifyAnnots")}}class MsgId extends IntegerObject{constructor(e){super(Qo,"msgId",1,(e=>e>=1))}}class NameAttr extends StringObject{constructor(e){super(Qo,"nameAttr")}}class NeverEmbed extends ContentObject{constructor(e){super(Qo,"neverEmbed")}}class NumberOfCopies extends IntegerObject{constructor(e){super(Qo,"numberOfCopies",null,(e=>e>=2&&e<=5))}}class OpenAction extends XFAObject{constructor(e){super(Qo,"openAction",!0);this.destination=null}}class Output extends XFAObject{constructor(e){super(Qo,"output",!0);this.to=null;this.type=null;this.uri=null}}class OutputBin extends StringObject{constructor(e){super(Qo,"outputBin")}}class OutputXSL extends XFAObject{constructor(e){super(Qo,"outputXSL",!0);this.uri=null}}class Overprint extends OptionObject{constructor(e){super(Qo,"overprint",["none","both","draw","field"])}}class Packets extends StringObject{constructor(e){super(Qo,"packets")}[hs](){"*"!==this[ss]&&(this[ss]=this[ss].trim().split(/\\s+/).filter((e=>["config","datasets","template","xfdf","xslt"].includes(e))))}}class PageOffset extends XFAObject{constructor(e){super(Qo,"pageOffset");this.x=getInteger({data:e.x,defaultValue:"useXDCSetting",validate:e=>!0});this.y=getInteger({data:e.y,defaultValue:"useXDCSetting",validate:e=>!0})}}class PageRange extends StringObject{constructor(e){super(Qo,"pageRange")}[hs](){const e=this[ss].trim().split(/\\s+/).map((e=>parseInt(e,10))),t=[];for(let a=0,r=e.length;a<r;a+=2)t.push(e.slice(a,a+2));this[ss]=t}}class Pagination extends OptionObject{constructor(e){super(Qo,"pagination",["simplex","duplexShortEdge","duplexLongEdge"])}}class PaginationOverride extends OptionObject{constructor(e){super(Qo,"paginationOverride",["none","forceDuplex","forceDuplexLongEdge","forceDuplexShortEdge","forceSimplex"])}}class Part extends IntegerObject{constructor(e){super(Qo,"part",1,(e=>!1))}}class Pcl extends XFAObject{constructor(e){super(Qo,"pcl",!0);this.name=e.name||"";this.batchOutput=null;this.fontInfo=null;this.jog=null;this.mediumInfo=null;this.outputBin=null;this.pageOffset=null;this.staple=null;this.xdc=null}}class Pdf extends XFAObject{constructor(e){super(Qo,"pdf",!0);this.name=e.name||"";this.adobeExtensionLevel=null;this.batchOutput=null;this.compression=null;this.creator=null;this.encryption=null;this.fontInfo=null;this.interactive=null;this.linearized=null;this.openAction=null;this.pdfa=null;this.producer=null;this.renderPolicy=null;this.scriptModel=null;this.silentPrint=null;this.submitFormat=null;this.tagged=null;this.version=null;this.viewerPreferences=null;this.xdc=null}}class Pdfa extends XFAObject{constructor(e){super(Qo,"pdfa",!0);this.amd=null;this.conformance=null;this.includeXDPContent=null;this.part=null}}class Permissions extends XFAObject{constructor(e){super(Qo,"permissions",!0);this.accessibleContent=null;this.change=null;this.contentCopy=null;this.documentAssembly=null;this.formFieldFilling=null;this.modifyAnnots=null;this.plaintextMetadata=null;this.print=null;this.printHighQuality=null}}class PickTrayByPDFSize extends Option01{constructor(e){super(Qo,"pickTrayByPDFSize")}}class config_Picture extends StringObject{constructor(e){super(Qo,"picture")}}class PlaintextMetadata extends Option01{constructor(e){super(Qo,"plaintextMetadata")}}class Presence extends OptionObject{constructor(e){super(Qo,"presence",["preserve","dissolve","dissolveStructure","ignore","remove"])}}class Present extends XFAObject{constructor(e){super(Qo,"present",!0);this.behaviorOverride=null;this.cache=null;this.common=null;this.copies=null;this.destination=null;this.incrementalMerge=null;this.layout=null;this.output=null;this.overprint=null;this.pagination=null;this.paginationOverride=null;this.script=null;this.validate=null;this.xdp=null;this.driver=new XFAObjectArray;this.labelPrinter=new XFAObjectArray;this.pcl=new XFAObjectArray;this.pdf=new XFAObjectArray;this.ps=new XFAObjectArray;this.submitUrl=new XFAObjectArray;this.webClient=new XFAObjectArray;this.zpl=new XFAObjectArray}}class Print extends Option01{constructor(e){super(Qo,"print")}}class PrintHighQuality extends Option01{constructor(e){super(Qo,"printHighQuality")}}class PrintScaling extends OptionObject{constructor(e){super(Qo,"printScaling",["appdefault","noScaling"])}}class PrinterName extends StringObject{constructor(e){super(Qo,"printerName")}}class Producer extends StringObject{constructor(e){super(Qo,"producer")}}class Ps extends XFAObject{constructor(e){super(Qo,"ps",!0);this.name=e.name||"";this.batchOutput=null;this.fontInfo=null;this.jog=null;this.mediumInfo=null;this.outputBin=null;this.staple=null;this.xdc=null}}class Range extends ContentObject{constructor(e){super(Qo,"range")}[hs](){this[ss]=this[ss].split(",",2).map((e=>e.split("-").map((e=>parseInt(e.trim(),10))))).filter((e=>e.every((e=>!isNaN(e))))).map((e=>{1===e.length&&e.push(e[0]);return e}))}}class Record extends ContentObject{constructor(e){super(Qo,"record")}[hs](){this[ss]=this[ss].trim();const e=parseInt(this[ss],10);!isNaN(e)&&e>=0&&(this[ss]=e)}}class Relevant extends ContentObject{constructor(e){super(Qo,"relevant")}[hs](){this[ss]=this[ss].trim().split(/\\s+/)}}class Rename extends ContentObject{constructor(e){super(Qo,"rename")}[hs](){this[ss]=this[ss].trim();(this[ss].toLowerCase().startsWith("xml")||new RegExp("[\\\\p{L}_][\\\\p{L}\\\\d._\\\\p{M}-]*","u").test(this[ss]))&&warn("XFA - Rename: invalid XFA name")}}class RenderPolicy extends OptionObject{constructor(e){super(Qo,"renderPolicy",["server","client"])}}class RunScripts extends OptionObject{constructor(e){super(Qo,"runScripts",["both","client","none","server"])}}class config_Script extends XFAObject{constructor(e){super(Qo,"script",!0);this.currentPage=null;this.exclude=null;this.runScripts=null}}class ScriptModel extends OptionObject{constructor(e){super(Qo,"scriptModel",["XFA","none"])}}class Severity extends OptionObject{constructor(e){super(Qo,"severity",["ignore","error","information","trace","warning"])}}class SilentPrint extends XFAObject{constructor(e){super(Qo,"silentPrint",!0);this.addSilentPrint=null;this.printerName=null}}class Staple extends XFAObject{constructor(e){super(Qo,"staple");this.mode=getStringOption(e.mode,["usePrinterSetting","on","off"])}}class StartNode extends StringObject{constructor(e){super(Qo,"startNode")}}class StartPage extends IntegerObject{constructor(e){super(Qo,"startPage",0,(e=>!0))}}class SubmitFormat extends OptionObject{constructor(e){super(Qo,"submitFormat",["html","delegate","fdf","xml","pdf"])}}class SubmitUrl extends StringObject{constructor(e){super(Qo,"submitUrl")}}class SubsetBelow extends IntegerObject{constructor(e){super(Qo,"subsetBelow",100,(e=>e>=0&&e<=100))}}class SuppressBanner extends Option01{constructor(e){super(Qo,"suppressBanner")}}class Tagged extends Option01{constructor(e){super(Qo,"tagged")}}class config_Template extends XFAObject{constructor(e){super(Qo,"template",!0);this.base=null;this.relevant=null;this.startPage=null;this.uri=null;this.xsl=null}}class Threshold extends OptionObject{constructor(e){super(Qo,"threshold",["trace","error","information","warning"])}}class To extends OptionObject{constructor(e){super(Qo,"to",["null","memory","stderr","stdout","system","uri"])}}class TemplateCache extends XFAObject{constructor(e){super(Qo,"templateCache");this.maxEntries=getInteger({data:e.maxEntries,defaultValue:5,validate:e=>e>=0})}}class Trace extends XFAObject{constructor(e){super(Qo,"trace",!0);this.area=new XFAObjectArray}}class Transform extends XFAObject{constructor(e){super(Qo,"transform",!0);this.groupParent=null;this.ifEmpty=null;this.nameAttr=null;this.picture=null;this.presence=null;this.rename=null;this.whitespace=null}}class Type extends OptionObject{constructor(e){super(Qo,"type",["none","ascii85","asciiHex","ccittfax","flate","lzw","runLength","native","xdp","mergedXDP"])}}class Uri extends StringObject{constructor(e){super(Qo,"uri")}}class config_Validate extends OptionObject{constructor(e){super(Qo,"validate",["preSubmit","prePrint","preExecute","preSave"])}}class ValidateApprovalSignatures extends ContentObject{constructor(e){super(Qo,"validateApprovalSignatures")}[hs](){this[ss]=this[ss].trim().split(/\\s+/).filter((e=>["docReady","postSign"].includes(e)))}}class ValidationMessaging extends OptionObject{constructor(e){super(Qo,"validationMessaging",["allMessagesIndividually","allMessagesTogether","firstMessageOnly","noMessages"])}}class Version extends OptionObject{constructor(e){super(Qo,"version",["1.7","1.6","1.5","1.4","1.3","1.2"])}}class VersionControl extends XFAObject{constructor(e){super(Qo,"VersionControl");this.outputBelow=getStringOption(e.outputBelow,["warn","error","update"]);this.sourceAbove=getStringOption(e.sourceAbove,["warn","error"]);this.sourceBelow=getStringOption(e.sourceBelow,["update","maintain"])}}class ViewerPreferences extends XFAObject{constructor(e){super(Qo,"viewerPreferences",!0);this.ADBE_JSConsole=null;this.ADBE_JSDebugger=null;this.addViewerPreferences=null;this.duplexOption=null;this.enforce=null;this.numberOfCopies=null;this.pageRange=null;this.pickTrayByPDFSize=null;this.printScaling=null}}class WebClient extends XFAObject{constructor(e){super(Qo,"webClient",!0);this.name=e.name?e.name.trim():"";this.fontInfo=null;this.xdc=null}}class Whitespace extends OptionObject{constructor(e){super(Qo,"whitespace",["preserve","ltrim","normalize","rtrim","trim"])}}class Window extends ContentObject{constructor(e){super(Qo,"window")}[hs](){const e=this[ss].split(",",2).map((e=>parseInt(e.trim(),10)));if(e.some((e=>isNaN(e))))this[ss]=[0,0];else{1===e.length&&e.push(e[0]);this[ss]=e}}}class Xdc extends XFAObject{constructor(e){super(Qo,"xdc",!0);this.uri=new XFAObjectArray;this.xsl=new XFAObjectArray}}class Xdp extends XFAObject{constructor(e){super(Qo,"xdp",!0);this.packets=null}}class Xsl extends XFAObject{constructor(e){super(Qo,"xsl",!0);this.debug=null;this.uri=null}}class Zpl extends XFAObject{constructor(e){super(Qo,"zpl",!0);this.name=e.name?e.name.trim():"";this.batchOutput=null;this.flipLabel=null;this.fontInfo=null;this.xdc=null}}class ConfigNamespace{static[fo](e,t){if(ConfigNamespace.hasOwnProperty(e))return ConfigNamespace[e](t)}static acrobat(e){return new Acrobat(e)}static acrobat7(e){return new Acrobat7(e)}static ADBE_JSConsole(e){return new ADBE_JSConsole(e)}static ADBE_JSDebugger(e){return new ADBE_JSDebugger(e)}static addSilentPrint(e){return new AddSilentPrint(e)}static addViewerPreferences(e){return new AddViewerPreferences(e)}static adjustData(e){return new AdjustData(e)}static adobeExtensionLevel(e){return new AdobeExtensionLevel(e)}static agent(e){return new Agent(e)}static alwaysEmbed(e){return new AlwaysEmbed(e)}static amd(e){return new Amd(e)}static area(e){return new config_Area(e)}static attributes(e){return new Attributes(e)}static autoSave(e){return new AutoSave(e)}static base(e){return new Base(e)}static batchOutput(e){return new BatchOutput(e)}static behaviorOverride(e){return new BehaviorOverride(e)}static cache(e){return new Cache(e)}static change(e){return new Change(e)}static common(e){return new Common(e)}static compress(e){return new Compress(e)}static compressLogicalStructure(e){return new CompressLogicalStructure(e)}static compressObjectStream(e){return new CompressObjectStream(e)}static compression(e){return new Compression(e)}static config(e){return new Config(e)}static conformance(e){return new Conformance(e)}static contentCopy(e){return new ContentCopy(e)}static copies(e){return new Copies(e)}static creator(e){return new Creator(e)}static currentPage(e){return new CurrentPage(e)}static data(e){return new Data(e)}static debug(e){return new Debug(e)}static defaultTypeface(e){return new DefaultTypeface(e)}static destination(e){return new Destination(e)}static documentAssembly(e){return new DocumentAssembly(e)}static driver(e){return new Driver(e)}static duplexOption(e){return new DuplexOption(e)}static dynamicRender(e){return new DynamicRender(e)}static embed(e){return new Embed(e)}static encrypt(e){return new config_Encrypt(e)}static encryption(e){return new config_Encryption(e)}static encryptionLevel(e){return new EncryptionLevel(e)}static enforce(e){return new Enforce(e)}static equate(e){return new Equate(e)}static equateRange(e){return new EquateRange(e)}static exclude(e){return new Exclude(e)}static excludeNS(e){return new ExcludeNS(e)}static flipLabel(e){return new FlipLabel(e)}static fontInfo(e){return new config_FontInfo(e)}static formFieldFilling(e){return new FormFieldFilling(e)}static groupParent(e){return new GroupParent(e)}static ifEmpty(e){return new IfEmpty(e)}static includeXDPContent(e){return new IncludeXDPContent(e)}static incrementalLoad(e){return new IncrementalLoad(e)}static incrementalMerge(e){return new IncrementalMerge(e)}static interactive(e){return new Interactive(e)}static jog(e){return new Jog(e)}static labelPrinter(e){return new LabelPrinter(e)}static layout(e){return new Layout(e)}static level(e){return new Level(e)}static linearized(e){return new Linearized(e)}static locale(e){return new Locale(e)}static localeSet(e){return new LocaleSet(e)}static log(e){return new Log(e)}static map(e){return new MapElement(e)}static mediumInfo(e){return new MediumInfo(e)}static message(e){return new config_Message(e)}static messaging(e){return new Messaging(e)}static mode(e){return new Mode(e)}static modifyAnnots(e){return new ModifyAnnots(e)}static msgId(e){return new MsgId(e)}static nameAttr(e){return new NameAttr(e)}static neverEmbed(e){return new NeverEmbed(e)}static numberOfCopies(e){return new NumberOfCopies(e)}static openAction(e){return new OpenAction(e)}static output(e){return new Output(e)}static outputBin(e){return new OutputBin(e)}static outputXSL(e){return new OutputXSL(e)}static overprint(e){return new Overprint(e)}static packets(e){return new Packets(e)}static pageOffset(e){return new PageOffset(e)}static pageRange(e){return new PageRange(e)}static pagination(e){return new Pagination(e)}static paginationOverride(e){return new PaginationOverride(e)}static part(e){return new Part(e)}static pcl(e){return new Pcl(e)}static pdf(e){return new Pdf(e)}static pdfa(e){return new Pdfa(e)}static permissions(e){return new Permissions(e)}static pickTrayByPDFSize(e){return new PickTrayByPDFSize(e)}static picture(e){return new config_Picture(e)}static plaintextMetadata(e){return new PlaintextMetadata(e)}static presence(e){return new Presence(e)}static present(e){return new Present(e)}static print(e){return new Print(e)}static printHighQuality(e){return new PrintHighQuality(e)}static printScaling(e){return new PrintScaling(e)}static printerName(e){return new PrinterName(e)}static producer(e){return new Producer(e)}static ps(e){return new Ps(e)}static range(e){return new Range(e)}static record(e){return new Record(e)}static relevant(e){return new Relevant(e)}static rename(e){return new Rename(e)}static renderPolicy(e){return new RenderPolicy(e)}static runScripts(e){return new RunScripts(e)}static script(e){return new config_Script(e)}static scriptModel(e){return new ScriptModel(e)}static severity(e){return new Severity(e)}static silentPrint(e){return new SilentPrint(e)}static staple(e){return new Staple(e)}static startNode(e){return new StartNode(e)}static startPage(e){return new StartPage(e)}static submitFormat(e){return new SubmitFormat(e)}static submitUrl(e){return new SubmitUrl(e)}static subsetBelow(e){return new SubsetBelow(e)}static suppressBanner(e){return new SuppressBanner(e)}static tagged(e){return new Tagged(e)}static template(e){return new config_Template(e)}static templateCache(e){return new TemplateCache(e)}static threshold(e){return new Threshold(e)}static to(e){return new To(e)}static trace(e){return new Trace(e)}static transform(e){return new Transform(e)}static type(e){return new Type(e)}static uri(e){return new Uri(e)}static validate(e){return new config_Validate(e)}static validateApprovalSignatures(e){return new ValidateApprovalSignatures(e)}static validationMessaging(e){return new ValidationMessaging(e)}static version(e){return new Version(e)}static versionControl(e){return new VersionControl(e)}static viewerPreferences(e){return new ViewerPreferences(e)}static webClient(e){return new WebClient(e)}static whitespace(e){return new Whitespace(e)}static window(e){return new Window(e)}static xdc(e){return new Xdc(e)}static xdp(e){return new Xdp(e)}static xsl(e){return new Xsl(e)}static zpl(e){return new Zpl(e)}}const ec=go.connectionSet.id;class ConnectionSet extends XFAObject{constructor(e){super(ec,"connectionSet",!0);this.wsdlConnection=new XFAObjectArray;this.xmlConnection=new XFAObjectArray;this.xsdConnection=new XFAObjectArray}}class EffectiveInputPolicy extends XFAObject{constructor(e){super(ec,"effectiveInputPolicy");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class EffectiveOutputPolicy extends XFAObject{constructor(e){super(ec,"effectiveOutputPolicy");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Operation extends StringObject{constructor(e){super(ec,"operation");this.id=e.id||"";this.input=e.input||"";this.name=e.name||"";this.output=e.output||"";this.use=e.use||"";this.usehref=e.usehref||""}}class RootElement extends StringObject{constructor(e){super(ec,"rootElement");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class SoapAction extends StringObject{constructor(e){super(ec,"soapAction");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class SoapAddress extends StringObject{constructor(e){super(ec,"soapAddress");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class connection_set_Uri extends StringObject{constructor(e){super(ec,"uri");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class WsdlAddress extends StringObject{constructor(e){super(ec,"wsdlAddress");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class WsdlConnection extends XFAObject{constructor(e){super(ec,"wsdlConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.effectiveInputPolicy=null;this.effectiveOutputPolicy=null;this.operation=null;this.soapAction=null;this.soapAddress=null;this.wsdlAddress=null}}class XmlConnection extends XFAObject{constructor(e){super(ec,"xmlConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.uri=null}}class XsdConnection extends XFAObject{constructor(e){super(ec,"xsdConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.rootElement=null;this.uri=null}}class ConnectionSetNamespace{static[fo](e,t){if(ConnectionSetNamespace.hasOwnProperty(e))return ConnectionSetNamespace[e](t)}static connectionSet(e){return new ConnectionSet(e)}static effectiveInputPolicy(e){return new EffectiveInputPolicy(e)}static effectiveOutputPolicy(e){return new EffectiveOutputPolicy(e)}static operation(e){return new Operation(e)}static rootElement(e){return new RootElement(e)}static soapAction(e){return new SoapAction(e)}static soapAddress(e){return new SoapAddress(e)}static uri(e){return new connection_set_Uri(e)}static wsdlAddress(e){return new WsdlAddress(e)}static wsdlConnection(e){return new WsdlConnection(e)}static xmlConnection(e){return new XmlConnection(e)}static xsdConnection(e){return new XsdConnection(e)}}const tc=go.datasets.id;class datasets_Data extends XmlObject{constructor(e){super(tc,"data",e)}[Ls](){return!0}}class Datasets extends XFAObject{constructor(e){super(tc,"datasets",!0);this.data=null;this.Signature=null}[$s](e){const t=e[Ws];("data"===t&&e[Hs]===tc||"Signature"===t&&e[Hs]===go.signature.id)&&(this[t]=e);this[Qn](e)}}class DatasetsNamespace{static[fo](e,t){if(DatasetsNamespace.hasOwnProperty(e))return DatasetsNamespace[e](t)}static datasets(e){return new Datasets(e)}static data(e){return new datasets_Data(e)}}const ac=go.localeSet.id;class CalendarSymbols extends XFAObject{constructor(e){super(ac,"calendarSymbols",!0);this.name="gregorian";this.dayNames=new XFAObjectArray(2);this.eraNames=null;this.meridiemNames=null;this.monthNames=new XFAObjectArray(2)}}class CurrencySymbol extends StringObject{constructor(e){super(ac,"currencySymbol");this.name=getStringOption(e.name,["symbol","isoname","decimal"])}}class CurrencySymbols extends XFAObject{constructor(e){super(ac,"currencySymbols",!0);this.currencySymbol=new XFAObjectArray(3)}}class DatePattern extends StringObject{constructor(e){super(ac,"datePattern");this.name=getStringOption(e.name,["full","long","med","short"])}}class DatePatterns extends XFAObject{constructor(e){super(ac,"datePatterns",!0);this.datePattern=new XFAObjectArray(4)}}class DateTimeSymbols extends ContentObject{constructor(e){super(ac,"dateTimeSymbols")}}class Day extends StringObject{constructor(e){super(ac,"day")}}class DayNames extends XFAObject{constructor(e){super(ac,"dayNames",!0);this.abbr=getInteger({data:e.abbr,defaultValue:0,validate:e=>1===e});this.day=new XFAObjectArray(7)}}class Era extends StringObject{constructor(e){super(ac,"era")}}class EraNames extends XFAObject{constructor(e){super(ac,"eraNames",!0);this.era=new XFAObjectArray(2)}}class locale_set_Locale extends XFAObject{constructor(e){super(ac,"locale",!0);this.desc=e.desc||"";this.name="isoname";this.calendarSymbols=null;this.currencySymbols=null;this.datePatterns=null;this.dateTimeSymbols=null;this.numberPatterns=null;this.numberSymbols=null;this.timePatterns=null;this.typeFaces=null}}class locale_set_LocaleSet extends XFAObject{constructor(e){super(ac,"localeSet",!0);this.locale=new XFAObjectArray}}class Meridiem extends StringObject{constructor(e){super(ac,"meridiem")}}class MeridiemNames extends XFAObject{constructor(e){super(ac,"meridiemNames",!0);this.meridiem=new XFAObjectArray(2)}}class Month extends StringObject{constructor(e){super(ac,"month")}}class MonthNames extends XFAObject{constructor(e){super(ac,"monthNames",!0);this.abbr=getInteger({data:e.abbr,defaultValue:0,validate:e=>1===e});this.month=new XFAObjectArray(12)}}class NumberPattern extends StringObject{constructor(e){super(ac,"numberPattern");this.name=getStringOption(e.name,["full","long","med","short"])}}class NumberPatterns extends XFAObject{constructor(e){super(ac,"numberPatterns",!0);this.numberPattern=new XFAObjectArray(4)}}class NumberSymbol extends StringObject{constructor(e){super(ac,"numberSymbol");this.name=getStringOption(e.name,["decimal","grouping","percent","minus","zero"])}}class NumberSymbols extends XFAObject{constructor(e){super(ac,"numberSymbols",!0);this.numberSymbol=new XFAObjectArray(5)}}class TimePattern extends StringObject{constructor(e){super(ac,"timePattern");this.name=getStringOption(e.name,["full","long","med","short"])}}class TimePatterns extends XFAObject{constructor(e){super(ac,"timePatterns",!0);this.timePattern=new XFAObjectArray(4)}}class TypeFace extends XFAObject{constructor(e){super(ac,"typeFace",!0);this.name=""|e.name}}class TypeFaces extends XFAObject{constructor(e){super(ac,"typeFaces",!0);this.typeFace=new XFAObjectArray}}class LocaleSetNamespace{static[fo](e,t){if(LocaleSetNamespace.hasOwnProperty(e))return LocaleSetNamespace[e](t)}static calendarSymbols(e){return new CalendarSymbols(e)}static currencySymbol(e){return new CurrencySymbol(e)}static currencySymbols(e){return new CurrencySymbols(e)}static datePattern(e){return new DatePattern(e)}static datePatterns(e){return new DatePatterns(e)}static dateTimeSymbols(e){return new DateTimeSymbols(e)}static day(e){return new Day(e)}static dayNames(e){return new DayNames(e)}static era(e){return new Era(e)}static eraNames(e){return new EraNames(e)}static locale(e){return new locale_set_Locale(e)}static localeSet(e){return new locale_set_LocaleSet(e)}static meridiem(e){return new Meridiem(e)}static meridiemNames(e){return new MeridiemNames(e)}static month(e){return new Month(e)}static monthNames(e){return new MonthNames(e)}static numberPattern(e){return new NumberPattern(e)}static numberPatterns(e){return new NumberPatterns(e)}static numberSymbol(e){return new NumberSymbol(e)}static numberSymbols(e){return new NumberSymbols(e)}static timePattern(e){return new TimePattern(e)}static timePatterns(e){return new TimePatterns(e)}static typeFace(e){return new TypeFace(e)}static typeFaces(e){return new TypeFaces(e)}}const rc=go.signature.id;class signature_Signature extends XFAObject{constructor(e){super(rc,"signature",!0)}}class SignatureNamespace{static[fo](e,t){if(SignatureNamespace.hasOwnProperty(e))return SignatureNamespace[e](t)}static signature(e){return new signature_Signature(e)}}const ic=go.stylesheet.id;class Stylesheet extends XFAObject{constructor(e){super(ic,"stylesheet",!0)}}class StylesheetNamespace{static[fo](e,t){if(StylesheetNamespace.hasOwnProperty(e))return StylesheetNamespace[e](t)}static stylesheet(e){return new Stylesheet(e)}}const nc=go.xdp.id;class xdp_Xdp extends XFAObject{constructor(e){super(nc,"xdp",!0);this.uuid=e.uuid||"";this.timeStamp=e.timeStamp||"";this.config=null;this.connectionSet=null;this.datasets=null;this.localeSet=null;this.stylesheet=new XFAObjectArray;this.template=null}[Gs](e){const t=go[e[Ws]];return t&&e[Hs]===t.id}}class XdpNamespace{static[fo](e,t){if(XdpNamespace.hasOwnProperty(e))return XdpNamespace[e](t)}static xdp(e){return new xdp_Xdp(e)}}const sc=go.xhtml.id,oc=Symbol(),cc=new Set(["color","font","font-family","font-size","font-stretch","font-style","font-weight","margin","margin-bottom","margin-left","margin-right","margin-top","letter-spacing","line-height","orphans","page-break-after","page-break-before","page-break-inside","tab-interval","tab-stop","text-align","text-decoration","text-indent","vertical-align","widows","kerning-mode","xfa-font-horizontal-scale","xfa-font-vertical-scale","xfa-spacerun","xfa-tab-stops"]),lc=new Map([["page-break-after","breakAfter"],["page-break-before","breakBefore"],["page-break-inside","breakInside"],["kerning-mode",e=>"none"===e?"none":"normal"],["xfa-font-horizontal-scale",e=>`scaleX(${Math.max(0,parseInt(e)/100).toFixed(2)})`],["xfa-font-vertical-scale",e=>`scaleY(${Math.max(0,parseInt(e)/100).toFixed(2)})`],["xfa-spacerun",""],["xfa-tab-stops",""],["font-size",(e,t)=>measureToString(.99*(e=t.fontSize=Math.abs(getMeasurement(e))))],["letter-spacing",e=>measureToString(getMeasurement(e))],["line-height",e=>measureToString(getMeasurement(e))],["margin",e=>measureToString(getMeasurement(e))],["margin-bottom",e=>measureToString(getMeasurement(e))],["margin-left",e=>measureToString(getMeasurement(e))],["margin-right",e=>measureToString(getMeasurement(e))],["margin-top",e=>measureToString(getMeasurement(e))],["text-indent",e=>measureToString(getMeasurement(e))],["font-family",e=>e],["vertical-align",e=>measureToString(getMeasurement(e))]]),hc=/\\s+/g,uc=/[\\r\\n]+/g,dc=/\\r\\n?/g;function mapStyle(e,t,a){const r=Object.create(null);if(!e)return r;const i=Object.create(null);for(const[t,a]of e.split(";").map((e=>e.split(":",2)))){const e=lc.get(t);if(""===e)continue;let n=a;e&&(n="string"==typeof e?e:e(a,i));t.endsWith("scale")?r.transform=r.transform?`${r[t]} ${n}`:n:r[t.replaceAll(/-([a-zA-Z])/g,((e,t)=>t.toUpperCase()))]=n}r.fontFamily&&setFontFamily({typeface:r.fontFamily,weight:r.fontWeight||"normal",posture:r.fontStyle||"normal",size:i.fontSize||0},t,t[Is].fontFinder,r);if(a&&r.verticalAlign&&"0px"!==r.verticalAlign&&r.fontSize){const e=.583,t=.333,a=getMeasurement(r.fontSize);r.fontSize=measureToString(a*e);r.verticalAlign=measureToString(Math.sign(getMeasurement(r.verticalAlign))*a*t)}a&&r.fontSize&&(r.fontSize=`calc(${r.fontSize} * var(--total-scale-factor))`);fixTextIndent(r);return r}const fc=new Set(["body","html"]);class XhtmlObject extends XmlObject{constructor(e,t){super(sc,t);this[oc]=!1;this.style=e.style||""}[ts](e){super[ts](e);this.style=function checkStyle(e){return e.style?e.style.split(";").filter((e=>!!e.trim())).map((e=>e.split(":",2).map((e=>e.trim())))).filter((([t,a])=>{"font-family"===t&&e[Is].usedTypefaces.add(a);return cc.has(t)})).map((e=>e.join(":"))).join(";"):""}(this)}[Yn](){return!fc.has(this[Ws])}[Vs](e,t=!1){if(t)this[oc]=!0;else{e=e.replaceAll(uc,"");this.style.includes("xfa-spacerun:yes")||(e=e.replaceAll(hc," "))}e&&(this[ss]+=e)}[Ks](e,t=!0){const a=Object.create(null),r={top:NaN,bottom:NaN,left:NaN,right:NaN};let i=null;for(const[e,t]of this.style.split(";").map((e=>e.split(":",2))))switch(e){case"font-family":a.typeface=stripQuotes(t);break;case"font-size":a.size=getMeasurement(t);break;case"font-weight":a.weight=t;break;case"font-style":a.posture=t;break;case"letter-spacing":a.letterSpacing=getMeasurement(t);break;case"margin":const e=t.split(/ \\t/).map((e=>getMeasurement(e)));switch(e.length){case 1:r.top=r.bottom=r.left=r.right=e[0];break;case 2:r.top=r.bottom=e[0];r.left=r.right=e[1];break;case 3:r.top=e[0];r.bottom=e[2];r.left=r.right=e[1];break;case 4:r.top=e[0];r.left=e[1];r.bottom=e[2];r.right=e[3]}break;case"margin-top":r.top=getMeasurement(t);break;case"margin-bottom":r.bottom=getMeasurement(t);break;case"margin-left":r.left=getMeasurement(t);break;case"margin-right":r.right=getMeasurement(t);break;case"line-height":i=getMeasurement(t)}e.pushData(a,r,i);if(this[ss])e.addString(this[ss]);else for(const t of this[Ss]())"#text"!==t[Ws]?t[Ks](e):e.addString(t[ss]);t&&e.popFont()}[co](e){const t=[];this[ls]={children:t};this[es]({});if(0===t.length&&!this[ss])return HTMLResult.EMPTY;let a;a=this[oc]?this[ss]?this[ss].replaceAll(dc,"\\n"):void 0:this[ss]||void 0;return HTMLResult.success({name:this[Ws],attributes:{href:this.href,style:mapStyle(this.style,this,this[oc])},children:t,value:a})}}class A extends XhtmlObject{constructor(e){super(e,"a");this.href=fixURL(e.href)||""}}class B extends XhtmlObject{constructor(e){super(e,"b")}[Ks](e){e.pushFont({weight:"bold"});super[Ks](e);e.popFont()}}class Body extends XhtmlObject{constructor(e){super(e,"body")}[co](e){const t=super[co](e),{html:a}=t;if(!a)return HTMLResult.EMPTY;a.name="div";a.attributes.class=["xfaRich"];return t}}class Br extends XhtmlObject{constructor(e){super(e,"br")}[so](){return"\\n"}[Ks](e){e.addString("\\n")}[co](e){return HTMLResult.success({name:"br"})}}class Html extends XhtmlObject{constructor(e){super(e,"html")}[co](e){const t=[];this[ls]={children:t};this[es]({});if(0===t.length)return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[ss]||""});if(1===t.length){const e=t[0];if(e.attributes?.class.includes("xfaRich"))return HTMLResult.success(e)}return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:t})}}class I extends XhtmlObject{constructor(e){super(e,"i")}[Ks](e){e.pushFont({posture:"italic"});super[Ks](e);e.popFont()}}class Li extends XhtmlObject{constructor(e){super(e,"li")}}class Ol extends XhtmlObject{constructor(e){super(e,"ol")}}class P extends XhtmlObject{constructor(e){super(e,"p")}[Ks](e){super[Ks](e,!1);e.addString("\\n");e.addPara();e.popFont()}[so](){return this[vs]()[Ss]().at(-1)===this?super[so]():super[so]()+"\\n"}}class Span extends XhtmlObject{constructor(e){super(e,"span")}}class Sub extends XhtmlObject{constructor(e){super(e,"sub")}}class Sup extends XhtmlObject{constructor(e){super(e,"sup")}}class Ul extends XhtmlObject{constructor(e){super(e,"ul")}}class XhtmlNamespace{static[fo](e,t){if(XhtmlNamespace.hasOwnProperty(e))return XhtmlNamespace[e](t)}static a(e){return new A(e)}static b(e){return new B(e)}static body(e){return new Body(e)}static br(e){return new Br(e)}static html(e){return new Html(e)}static i(e){return new I(e)}static li(e){return new Li(e)}static ol(e){return new Ol(e)}static p(e){return new P(e)}static span(e){return new Span(e)}static sub(e){return new Sub(e)}static sup(e){return new Sup(e)}static ul(e){return new Ul(e)}}const gc={config:ConfigNamespace,connection:ConnectionSetNamespace,datasets:DatasetsNamespace,localeSet:LocaleSetNamespace,signature:SignatureNamespace,stylesheet:StylesheetNamespace,template:TemplateNamespace,xdp:XdpNamespace,xhtml:XhtmlNamespace};class UnknownNamespace{constructor(e){this.namespaceId=e}[fo](e,t){return new XmlObject(this.namespaceId,e,t)}}class Root extends XFAObject{constructor(e){super(-1,"root",Object.create(null));this.element=null;this[Os]=e}[$s](e){this.element=e;return!0}[hs](){super[hs]();if(this.element.template instanceof Template){this[Os].set(Qs,this.element);this.element.template[eo](this[Os]);this.element.template[Os]=this[Os]}}}class Empty extends XFAObject{constructor(){super(-1,"",Object.create(null))}[$s](e){return!1}}class Builder{constructor(e=null){this._namespaceStack=[];this._nsAgnosticLevel=0;this._namespacePrefixes=new Map;this._namespaces=new Map;this._nextNsId=Math.max(...Object.values(go).map((({id:e})=>e)));this._currentNamespace=e||new UnknownNamespace(++this._nextNsId)}buildRoot(e){return new Root(e)}build({nsPrefix:e,name:t,attributes:a,namespace:r,prefixes:i}){const n=null!==r;if(n){this._namespaceStack.push(this._currentNamespace);this._currentNamespace=this._searchNamespace(r)}i&&this._addNamespacePrefix(i);if(a.hasOwnProperty(zs)){const e=gc.datasets,t=a[zs];let r=null;for(const[a,i]of Object.entries(t)){if(this._getNamespaceToUse(a)===e){r={xfa:i};break}}r?a[zs]=r:delete a[zs]}const s=this._getNamespaceToUse(e),o=s?.[fo](t,a)||new Empty;o[Ls]()&&this._nsAgnosticLevel++;(n||i||o[Ls]())&&(o[rs]={hasNamespace:n,prefixes:i,nsAgnostic:o[Ls]()});return o}isNsAgnostic(){return this._nsAgnosticLevel>0}_searchNamespace(e){let t=this._namespaces.get(e);if(t)return t;for(const[a,{check:r}]of Object.entries(go))if(r(e)){t=gc[a];if(t){this._namespaces.set(e,t);return t}break}t=new UnknownNamespace(++this._nextNsId);this._namespaces.set(e,t);return t}_addNamespacePrefix(e){for(const{prefix:t,value:a}of e){const e=this._searchNamespace(a);let r=this._namespacePrefixes.get(t);if(!r){r=[];this._namespacePrefixes.set(t,r)}r.push(e)}}_getNamespaceToUse(e){if(!e)return this._currentNamespace;const t=this._namespacePrefixes.get(e);if(t?.length>0)return t.at(-1);warn(`Unknown namespace prefix: ${e}.`);return null}clean(e){const{hasNamespace:t,prefixes:a,nsAgnostic:r}=e;t&&(this._currentNamespace=this._namespaceStack.pop());a&&a.forEach((({prefix:e})=>{this._namespacePrefixes.get(e).pop()}));r&&this._nsAgnosticLevel--}}class XFAParser extends XMLParserBase{constructor(e=null,t=!1){super();this._builder=new Builder(e);this._stack=[];this._globalData={usedTypefaces:new Set};this._ids=new Map;this._current=this._builder.buildRoot(this._ids);this._errorCode=jn;this._whiteRegex=/^\\s+$/;this._nbsps=/\\xa0+/g;this._richText=t}parse(e){this.parseXml(e);if(this._errorCode===jn){this._current[hs]();return this._current.element}}onText(e){e=e.replace(this._nbsps,(e=>e.slice(1)+" "));this._richText||this._current[Yn]()?this._current[Vs](e,this._richText):this._whiteRegex.test(e)||this._current[Vs](e.trim())}onCdata(e){this._current[Vs](e)}_mkAttributes(e,t){let a=null,r=null;const i=Object.create({});for(const{name:n,value:s}of e)if("xmlns"===n)a?warn(`XFA - multiple namespace definition in <${t}>`):a=s;else if(n.startsWith("xmlns:")){const e=n.substring(6);r??=[];r.push({prefix:e,value:s})}else{const e=n.indexOf(":");if(-1===e)i[n]=s;else{const t=i[zs]??=Object.create(null),[a,r]=[n.slice(0,e),n.slice(e+1)];(t[a]||=Object.create(null))[r]=s}}return[a,r,i]}_getNameAndPrefix(e,t){const a=e.indexOf(":");return-1===a?[e,null]:[e.substring(a+1),t?"":e.substring(0,a)]}onBeginElement(e,t,a){const[r,i,n]=this._mkAttributes(t,e),[s,o]=this._getNameAndPrefix(e,this._builder.isNsAgnostic()),c=this._builder.build({nsPrefix:o,name:s,attributes:n,namespace:r,prefixes:i});c[Is]=this._globalData;if(a){c[hs]();this._current[$s](c)&&c[ao](this._ids);c[ts](this._builder)}else{this._stack.push(this._current);this._current=c}}onEndElement(e){const t=this._current;if(t[Bs]()&&"string"==typeof t[ss]){const e=new XFAParser;e._globalData=this._globalData;const a=e.parse(t[ss]);t[ss]=null;t[$s](a)}t[hs]();this._current=this._stack.pop();this._current[$s](t)&&t[ao](this._ids);t[ts](this._builder)}onError(e){this._errorCode=e}}class XFAFactory{constructor(e){try{this.root=(new XFAParser).parse(XFAFactory._createDocument(e));const t=new Binder(this.root);this.form=t.bind();this.dataHandler=new DataHandler(this.root,t.getData());this.form[Is].template=this.form}catch(e){warn(`XFA - an error occurred during parsing and binding: ${e}`)}}isValid(){return!(!this.root||!this.form)}_createPagesHelper(){const e=this.form[oo]();return new Promise(((t,a)=>{const nextIteration=()=>{try{const a=e.next();a.done?t(a.value):setTimeout(nextIteration,0)}catch(e){a(e)}};setTimeout(nextIteration,0)}))}async _createPages(){try{this.pages=await this._createPagesHelper();this.dims=this.pages.children.map((e=>{const{width:t,height:a}=e.attributes.style;return[0,0,parseInt(t),parseInt(a)]}))}catch(e){warn(`XFA - an error occurred during layout: ${e}`)}}getBoundingBox(e){return this.dims[e]}async getNumPages(){this.pages||await this._createPages();return this.dims.length}setImages(e){this.form[Is].images=e}setFonts(e){this.form[Is].fontFinder=new FontFinder(e);const t=[];for(let e of this.form[Is].usedTypefaces){e=stripQuotes(e);this.form[Is].fontFinder.find(e)||t.push(e)}return t.length>0?t:null}appendFonts(e,t){this.form[Is].fontFinder.add(e,t)}async getPages(){this.pages||await this._createPages();const e=this.pages;this.pages=null;return e}serializeData(e){return this.dataHandler.serialize(e)}static _createDocument(e){return e["/xdp:xdp"]?Object.values(e).join(""):e["xdp:xdp"]}static getRichTextAsHtml(e){if(!e||"string"!=typeof e)return null;try{let t=new XFAParser(XhtmlNamespace,!0).parse(e);if(!["body","xhtml"].includes(t[Ws])){const e=XhtmlNamespace.body({});e[Qn](t);t=e}const a=t[co]();if(!a.success)return null;const{html:r}=a,{attributes:i}=r;if(i){i.class&&(i.class=i.class.filter((e=>!e.startsWith("xfa"))));i.dir="auto"}return{html:r,str:t[so]()}}catch(e){warn(`XFA - an error occurred during parsing of rich text: ${e}`)}return null}}class AnnotationFactory{static createGlobals(e){return Promise.all([e.ensureCatalog("acroForm"),e.ensureDoc("xfaDatasets"),e.ensureCatalog("structTreeRoot"),e.ensureCatalog("baseUrl"),e.ensureCatalog("attachments"),e.ensureCatalog("globalColorSpaceCache")]).then((([t,a,r,i,n,s])=>({pdfManager:e,acroForm:t instanceof Dict?t:Dict.empty,xfaDatasets:a,structTreeRoot:r,baseUrl:i,attachments:n,globalColorSpaceCache:s})),(e=>{warn(`createGlobals: "${e}".`);return null}))}static async create(e,t,a,r,i,n,s){const o=i?await this._getPageIndex(e,t,a.pdfManager):null;return a.pdfManager.ensure(this,"_create",[e,t,a,r,i,n,o,s])}static _create(e,t,a,r,i=!1,n=null,s=null,o=null){const c=e.fetchIfRef(t);if(!(c instanceof Dict))return;const{acroForm:l,pdfManager:h}=a,u=t instanceof Ref?t.toString():`annot_${r.createObjId()}`;let d=c.get("Subtype");d=d instanceof Name?d.name:null;const f={xref:e,ref:t,dict:c,subtype:d,id:u,annotationGlobals:a,collectFields:i,orphanFields:n,needAppearances:!i&&!0===l.get("NeedAppearances"),pageIndex:s,evaluatorOptions:h.evaluatorOptions,pageRef:o};switch(d){case"Link":return new LinkAnnotation(f);case"Text":return new TextAnnotation(f);case"Widget":let e=getInheritableProperty({dict:c,key:"FT"});e=e instanceof Name?e.name:null;switch(e){case"Tx":return new TextWidgetAnnotation(f);case"Btn":return new ButtonWidgetAnnotation(f);case"Ch":return new ChoiceWidgetAnnotation(f);case"Sig":return new SignatureWidgetAnnotation(f)}warn(`Unimplemented widget field type "${e}", falling back to base field type.`);return new WidgetAnnotation(f);case"Popup":return new PopupAnnotation(f);case"FreeText":return new FreeTextAnnotation(f);case"Line":return new LineAnnotation(f);case"Square":return new SquareAnnotation(f);case"Circle":return new CircleAnnotation(f);case"PolyLine":return new PolylineAnnotation(f);case"Polygon":return new PolygonAnnotation(f);case"Caret":return new CaretAnnotation(f);case"Ink":return new InkAnnotation(f);case"Highlight":return new HighlightAnnotation(f);case"Underline":return new UnderlineAnnotation(f);case"Squiggly":return new SquigglyAnnotation(f);case"StrikeOut":return new StrikeOutAnnotation(f);case"Stamp":return new StampAnnotation(f);case"FileAttachment":return new FileAttachmentAnnotation(f);default:i||warn(d?`Unimplemented annotation type "${d}", falling back to base annotation.`:"Annotation is missing the required /Subtype.");return new Annotation(f)}}static async _getPageIndex(e,t,a){try{const r=await e.fetchIfRefAsync(t);if(!(r instanceof Dict))return-1;const i=r.getRaw("P");if(i instanceof Ref)try{return await a.ensureCatalog("getPageIndex",[i])}catch(e){info(`_getPageIndex -- not a valid page reference: "${e}".`)}if(r.has("Kids"))return-1;const n=await a.ensureDoc("numPages");for(let e=0;e<n;e++){const r=await a.getPage(e),i=await a.ensure(r,"annotations");for(const a of i)if(a instanceof Ref&&isRefsEqual(a,t))return e}}catch(e){warn(`_getPageIndex: "${e}".`)}return-1}static generateImages(e,t,a){if(!a){warn("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images.");return null}let r;for(const{bitmapId:a,bitmap:i}of e)if(i){r||=new Map;r.set(a,StampAnnotation.createImage(i,t))}return r}static async saveNewAnnotations(e,t,a,r,i){const n=e.xref;let s;const o=[],{isOffscreenCanvasSupported:c}=e.options;for(const l of a)if(!l.deleted)switch(l.annotationType){case g:if(!s){const e=new Dict(n);e.setIfName("BaseFont","Helvetica");e.setIfName("Type","Font");e.setIfName("Subtype","Type1");e.setIfName("Encoding","WinAnsiEncoding");s=n.getNewTemporaryRef();i.put(s,{data:e})}o.push(FreeTextAnnotation.createNewAnnotation(n,l,i,{evaluator:e,task:t,baseFontRef:s}));break;case p:l.quadPoints?o.push(HighlightAnnotation.createNewAnnotation(n,l,i)):o.push(InkAnnotation.createNewAnnotation(n,l,i));break;case b:o.push(InkAnnotation.createNewAnnotation(n,l,i));break;case m:const a=c?await(r?.get(l.bitmapId)):null;if(a?.imageStream){const{imageStream:e,smaskStream:t}=a;if(t){const a=n.getNewTemporaryRef();i.put(a,{data:t});e.dict.set("SMask",a)}const r=a.imageRef=n.getNewTemporaryRef();i.put(r,{data:e});a.imageStream=a.smaskStream=null}o.push(StampAnnotation.createNewAnnotation(n,l,i,{image:a}));break;case y:o.push(StampAnnotation.createNewAnnotation(n,l,i,{}))}return{annotations:(await Promise.all(o)).flat()}}static async printNewAnnotations(e,t,a,r,i){if(!r)return null;const{options:n,xref:s}=t,o=[];for(const c of r)if(!c.deleted)switch(c.annotationType){case g:o.push(FreeTextAnnotation.createNewPrintAnnotation(e,s,c,{evaluator:t,task:a,evaluatorOptions:n}));break;case p:c.quadPoints?o.push(HighlightAnnotation.createNewPrintAnnotation(e,s,c,{evaluatorOptions:n})):o.push(InkAnnotation.createNewPrintAnnotation(e,s,c,{evaluatorOptions:n}));break;case b:o.push(InkAnnotation.createNewPrintAnnotation(e,s,c,{evaluatorOptions:n}));break;case m:const r=n.isOffscreenCanvasSupported?await(i?.get(c.bitmapId)):null;if(r?.imageStream){const{imageStream:e,smaskStream:t}=r;t&&e.dict.set("SMask",t);r.imageRef=new JpegStream(e,e.length);r.imageStream=r.smaskStream=null}o.push(StampAnnotation.createNewPrintAnnotation(e,s,c,{image:r,evaluatorOptions:n}));break;case y:o.push(StampAnnotation.createNewPrintAnnotation(e,s,c,{evaluatorOptions:n}))}return Promise.all(o)}}function getRgbColor(e,t=new Uint8ClampedArray(3)){if(!Array.isArray(e))return t;const a=t||new Uint8ClampedArray(3);switch(e.length){case 0:return null;case 1:ColorSpaceUtils.gray.getRgbItem(e,0,a,0);return a;case 3:ColorSpaceUtils.rgb.getRgbItem(e,0,a,0);return a;case 4:ColorSpaceUtils.cmyk.getRgbItem(e,0,a,0);return a;default:return t}}function getPdfColorArray(e,t=null){return e&&Array.from(e,(e=>e/255))||t}function getQuadPoints(e,t){const a=e.getArray("QuadPoints");if(!isNumberArray(a,null)||0===a.length||a.length%8>0)return null;const r=new Float32Array(a.length);for(let e=0,i=a.length;e<i;e+=8){const[i,n,s,o,c,l,h,u]=a.slice(e,e+8),d=Math.min(i,s,c,h),f=Math.max(i,s,c,h),g=Math.min(n,o,l,u),p=Math.max(n,o,l,u);if(null!==t&&(d<t[0]||f>t[2]||g<t[1]||p>t[3]))return null;r.set([d,p,f,p,d,g,f,g],e)}return r}function getTransformMatrix(e,t,a){const r=new Float32Array([1/0,1/0,-1/0,-1/0]);Util.axialAlignedBoundingBox(t,a,r);const[i,n,s,o]=r;if(i===s||n===o)return[1,0,0,1,e[0],e[1]];const c=(e[2]-e[0])/(s-i),l=(e[3]-e[1])/(o-n);return[c,0,0,l,e[0]-i*c,e[1]-n*l]}class Annotation{constructor(e){const{dict:t,xref:a,annotationGlobals:r,ref:i,orphanFields:n}=e,s=n?.get(i);s&&t.set("Parent",s);this.setTitle(t.get("T"));this.setContents(t.get("Contents"));this.setModificationDate(t.get("M"));this.setFlags(t.get("F"));this.setRectangle(t.getArray("Rect"));this.setColor(t.getArray("C"));this.setBorderStyle(t);this.setAppearance(t);this.setOptionalContent(t);const o=t.get("MK");this.setBorderAndBackgroundColors(o);this.setRotation(o,t);this.ref=e.ref instanceof Ref?e.ref:null;this._streams=[];this.appearance&&this._streams.push(this.appearance);const c=!!(this.flags&ee),l=!!(this.flags&te);this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,backgroundColor:this.backgroundColor,borderColor:this.borderColor,rotation:this.rotation,contentsObj:this._contents,hasAppearance:!!this.appearance,id:e.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:e.subtype,hasOwnCanvas:!1,noRotate:!!(this.flags&Z),noHTML:c&&l,isEditable:!1,structParent:-1};if(r.structTreeRoot){let a=t.get("StructParent");this.data.structParent=a=Number.isInteger(a)&&a>=0?a:-1;r.structTreeRoot.addAnnotationIdToPage(e.pageRef,a)}if(e.collectFields){const r=t.get("Kids");if(Array.isArray(r)){const e=[];for(const t of r)t instanceof Ref&&e.push(t.toString());0!==e.length&&(this.data.kidIds=e)}this.data.actions=collectActions(a,t,ye);this.data.fieldName=this._constructFieldName(t);this.data.pageIndex=e.pageIndex}const h=t.get("IT");h instanceof Name&&(this.data.it=h.name);this._isOffscreenCanvasSupported=e.evaluatorOptions.isOffscreenCanvasSupported;this._fallbackFontDict=null;this._needAppearances=!1}_hasFlag(e,t){return!!(e&t)}_buildFlags(e,t){let{flags:a}=this;if(void 0===e){if(void 0===t)return;return t?a&~Y:a&~J|Y}if(e){a|=Y;return t?a&~Q|J:a&~J|Q}a&=~(J|Q);return t?a&~Y:a|Y}_isViewable(e){return!this._hasFlag(e,K)&&!this._hasFlag(e,Q)}_isPrintable(e){return this._hasFlag(e,Y)&&!this._hasFlag(e,J)&&!this._hasFlag(e,K)}mustBeViewed(e,t){const a=e?.get(this.data.id)?.noView;return void 0!==a?!a:this.viewable&&!this._hasFlag(this.flags,J)}mustBePrinted(e){const t=e?.get(this.data.id)?.noPrint;return void 0!==t?!t:this.printable}mustBeViewedWhenEditing(e,t=null){return e?!this.data.isEditable:!t?.has(this.data.id)}get viewable(){return null!==this.data.quadPoints&&(0===this.flags||this._isViewable(this.flags))}get printable(){return null!==this.data.quadPoints&&(0!==this.flags&&this._isPrintable(this.flags))}_parseStringHelper(e){const t="string"==typeof e?stringToPDFString(e):"";return{str:t,dir:t&&"rtl"===bidi(t).dir?"rtl":"ltr"}}setDefaultAppearance(e){const{dict:t,annotationGlobals:a}=e,r=getInheritableProperty({dict:t,key:"DA"})||a.acroForm.get("DA");this._defaultAppearance="string"==typeof r?r:"";this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance)}setTitle(e){this._title=this._parseStringHelper(e)}setContents(e){this._contents=this._parseStringHelper(e)}setModificationDate(e){this.modificationDate="string"==typeof e?e:null}setFlags(e){this.flags=Number.isInteger(e)&&e>0?e:0;this.flags&K&&"Annotation"!==this.constructor.name&&(this.flags^=K)}hasFlag(e){return this._hasFlag(this.flags,e)}setRectangle(e){this.rectangle=lookupNormalRect(e,[0,0,0,0])}setColor(e){this.color=getRgbColor(e)}setLineEndings(e){this.lineEndings=["None","None"];if(Array.isArray(e)&&2===e.length)for(let t=0;t<2;t++){const a=e[t];if(a instanceof Name)switch(a.name){case"None":continue;case"Square":case"Circle":case"Diamond":case"OpenArrow":case"ClosedArrow":case"Butt":case"ROpenArrow":case"RClosedArrow":case"Slash":this.lineEndings[t]=a.name;continue}warn(`Ignoring invalid lineEnding: ${a}`)}}setRotation(e,t){this.rotation=0;let a=e instanceof Dict?e.get("R")||0:t.get("Rotate")||0;if(Number.isInteger(a)&&0!==a){a%=360;a<0&&(a+=360);a%90==0&&(this.rotation=a)}}setBorderAndBackgroundColors(e){if(e instanceof Dict){this.borderColor=getRgbColor(e.getArray("BC"),null);this.backgroundColor=getRgbColor(e.getArray("BG"),null)}else this.borderColor=this.backgroundColor=null}setBorderStyle(e){this.borderStyle=new AnnotationBorderStyle;if(e instanceof Dict)if(e.has("BS")){const t=e.get("BS");if(t instanceof Dict){const e=t.get("Type");if(!e||isName(e,"Border")){this.borderStyle.setWidth(t.get("W"),this.rectangle);this.borderStyle.setStyle(t.get("S"));this.borderStyle.setDashArray(t.getArray("D"))}}}else if(e.has("Border")){const t=e.getArray("Border");if(Array.isArray(t)&&t.length>=3){this.borderStyle.setHorizontalCornerRadius(t[0]);this.borderStyle.setVerticalCornerRadius(t[1]);this.borderStyle.setWidth(t[2],this.rectangle);4===t.length&&this.borderStyle.setDashArray(t[3],!0)}}else this.borderStyle.setWidth(0)}setAppearance(e){this.appearance=null;const t=e.get("AP");if(!(t instanceof Dict))return;const a=t.get("N");if(a instanceof BaseStream){this.appearance=a;return}if(!(a instanceof Dict))return;const r=e.get("AS");if(!(r instanceof Name&&a.has(r.name)))return;const i=a.get(r.name);i instanceof BaseStream&&(this.appearance=i)}setOptionalContent(e){this.oc=null;const t=e.get("OC");t instanceof Name?warn("setOptionalContent: Support for /Name-entry is not implemented."):t instanceof Dict&&(this.oc=t)}async loadResources(e,t){const a=await t.dict.getAsync("Resources");a&&await ObjectLoader.load(a,e,a.xref);return a}async getOperatorList(e,t,a,r){const{hasOwnCanvas:i,id:n,rect:o}=this.data;let c=this.appearance;const l=!!(i&&a&s);if(l&&(0===this.width||0===this.height)){this.data.hasOwnCanvas=!1;return{opList:new OperatorList,separateForm:!1,separateCanvas:!1}}if(!c){if(!l)return{opList:new OperatorList,separateForm:!1,separateCanvas:!1};c=new StringStream("");c.dict=new Dict}const h=c.dict,u=await this.loadResources(Ia,c),d=lookupRect(h.getArray("BBox"),[0,0,1,1]),f=lookupMatrix(h.getArray("Matrix"),Fa),g=getTransformMatrix(o,d,f),p=new OperatorList;let m;this.oc&&(m=await e.parseMarkedContentProps(this.oc,null));void 0!==m&&p.addOp(jt,["OC",m]);p.addOp($t,[n,o,g,f,l]);await e.getOperatorList({stream:c,task:t,resources:u,operatorList:p,fallbackFontDict:this._fallbackFontDict});p.addOp(Gt,[]);void 0!==m&&p.addOp(_t,[]);this.reset();return{opList:p,separateForm:!1,separateCanvas:l}}async save(e,t,a,r){return null}get overlaysTextContent(){return!1}get hasTextContent(){return!1}async extractTextContent(e,t,a){if(!this.appearance)return;const r=await this.loadResources(Ta,this.appearance),i=[],n=[];let s=null;const o={desiredSize:Math.Infinity,ready:!0,enqueue(e,t){for(const t of e.items)if(void 0!==t.str){s||=t.transform.slice(-2);n.push(t.str);if(t.hasEOL){i.push(n.join("").trimEnd());n.length=0}}}};await e.getTextContent({stream:this.appearance,task:t,resources:r,includeMarkedContent:!0,keepWhiteSpace:!0,sink:o,viewBox:a});this.reset();n.length&&i.push(n.join("").trimEnd());if(i.length>1||i[0]){const e=this.appearance.dict,t=lookupRect(e.getArray("BBox"),null),a=lookupMatrix(e.getArray("Matrix"),null);this.data.textPosition=this._transformPoint(s,t,a);this.data.textContent=i}}_transformPoint(e,t,a){const{rect:r}=this.data;t||=[0,0,1,1];a||=[1,0,0,1,0,0];const i=getTransformMatrix(r,t,a);i[4]-=r[0];i[5]-=r[1];const n=e.slice();Util.applyTransform(n,i);Util.applyTransform(n,a);return n}getFieldObject(){return this.data.kidIds?{id:this.data.id,actions:this.data.actions,name:this.data.fieldName,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:"",kidIds:this.data.kidIds,page:this.data.pageIndex,rotation:this.rotation}:null}reset(){for(const e of this._streams)e.reset()}_constructFieldName(e){if(!e.has("T")&&!e.has("Parent")){warn("Unknown field name, falling back to empty field name.");return""}if(!e.has("Parent"))return stringToPDFString(e.get("T"));const t=[];e.has("T")&&t.unshift(stringToPDFString(e.get("T")));let a=e;const r=new RefSet;e.objId&&r.put(e.objId);for(;a.has("Parent");){a=a.get("Parent");if(!(a instanceof Dict)||a.objId&&r.has(a.objId))break;a.objId&&r.put(a.objId);a.has("T")&&t.unshift(stringToPDFString(a.get("T")))}return t.join(".")}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class AnnotationBorderStyle{constructor(){this.width=1;this.rawWidth=1;this.style=fe;this.dashArray=[3];this.horizontalCornerRadius=0;this.verticalCornerRadius=0}setWidth(e,t=[0,0,0,0]){if(e instanceof Name)this.width=0;else if("number"==typeof e){if(e>0){this.rawWidth=e;const a=(t[2]-t[0])/2,r=(t[3]-t[1])/2;if(a>0&&r>0&&(e>a||e>r)){warn(`AnnotationBorderStyle.setWidth - ignoring width: ${e}`);e=1}}this.width=e}}setStyle(e){if(e instanceof Name)switch(e.name){case"S":this.style=fe;break;case"D":this.style=ge;break;case"B":this.style=pe;break;case"I":this.style=me;break;case"U":this.style=be}}setDashArray(e,t=!1){if(Array.isArray(e)){let a=!0,r=!0;for(const t of e){if(!(+t>=0)){a=!1;break}t>0&&(r=!1)}if(0===e.length||a&&!r){this.dashArray=e;t&&this.setStyle(Name.get("D"))}else this.width=0}else e&&(this.width=0)}setHorizontalCornerRadius(e){Number.isInteger(e)&&(this.horizontalCornerRadius=e)}setVerticalCornerRadius(e){Number.isInteger(e)&&(this.verticalCornerRadius=e)}}class MarkupAnnotation extends Annotation{constructor(e){super(e);const{dict:t}=e;if(t.has("IRT")){const e=t.getRaw("IRT");this.data.inReplyTo=e instanceof Ref?e.toString():null;const a=t.get("RT");this.data.replyType=a instanceof Name?a.name:V}let a=null;if(this.data.replyType===G){const e=t.get("IRT");this.setTitle(e.get("T"));this.data.titleObj=this._title;this.setContents(e.get("Contents"));this.data.contentsObj=this._contents;if(e.has("CreationDate")){this.setCreationDate(e.get("CreationDate"));this.data.creationDate=this.creationDate}else this.data.creationDate=null;if(e.has("M")){this.setModificationDate(e.get("M"));this.data.modificationDate=this.modificationDate}else this.data.modificationDate=null;a=e.getRaw("Popup");if(e.has("C")){this.setColor(e.getArray("C"));this.data.color=this.color}else this.data.color=null}else{this.data.titleObj=this._title;this.setCreationDate(t.get("CreationDate"));this.data.creationDate=this.creationDate;a=t.getRaw("Popup");t.has("C")||(this.data.color=null)}this.data.popupRef=a instanceof Ref?a.toString():null;t.has("RC")&&(this.data.richText=XFAFactory.getRichTextAsHtml(t.get("RC")))}setCreationDate(e){this.creationDate="string"==typeof e?e:null}_setDefaultAppearance({xref:e,extra:t,strokeColor:a,fillColor:r,blendMode:i,strokeAlpha:n,fillAlpha:s,pointsCallback:o}){const c=this.data.rect=[1/0,1/0,-1/0,-1/0],l=["q"];t&&l.push(t);a&&l.push(`${a[0]} ${a[1]} ${a[2]} RG`);r&&l.push(`${r[0]} ${r[1]} ${r[2]} rg`);const h=this.data.quadPoints||Float32Array.from([this.rectangle[0],this.rectangle[3],this.rectangle[2],this.rectangle[3],this.rectangle[0],this.rectangle[1],this.rectangle[2],this.rectangle[1]]);for(let e=0,t=h.length;e<t;e+=8){const t=o(l,h.subarray(e,e+8));Util.rectBoundingBox(...t,c)}l.push("Q");const u=new Dict(e),d=new Dict(e);d.setIfName("Subtype","Form");const f=new StringStream(l.join(" "));f.dict=d;u.set("Fm0",f);const g=new Dict(e);i&&g.setIfName("BM",i);g.setIfNumber("CA",n);g.setIfNumber("ca",s);const p=new Dict(e);p.set("GS0",g);const m=new Dict(e);m.set("ExtGState",p);m.set("XObject",u);const b=new Dict(e);b.set("Resources",m);b.set("BBox",c);this.appearance=new StringStream("/GS0 gs /Fm0 Do");this.appearance.dict=b;this._streams.push(this.appearance,f)}static async createNewAnnotation(e,t,a,r){const i=t.ref||=e.getNewTemporaryRef(),n=await this.createNewAppearanceStream(t,e,r);let s;if(n){const r=e.getNewTemporaryRef();s=this.createNewDict(t,e,{apRef:r});a.put(r,{data:n})}else s=this.createNewDict(t,e,{});Number.isInteger(t.parentTreeId)&&s.set("StructParent",t.parentTreeId);a.put(i,{data:s});const o={ref:i};if(t.popup){const r=t.popup;if(r.deleted){s.delete("Popup");s.delete("Contents");s.delete("RC");return o}const n=r.ref||=e.getNewTemporaryRef();r.parent=i;const c=PopupAnnotation.createNewDict(r,e);a.put(n,{data:c});s.setIfDefined("Contents",stringToAsciiOrUTF16BE(r.contents));s.set("Popup",n);return[o,{ref:n}]}return o}static async createNewPrintAnnotation(e,t,a,r){const i=await this.createNewAppearanceStream(a,t,r),n=this.createNewDict(a,t,i?{ap:i}:{}),s=new this.prototype.constructor({dict:n,xref:t,annotationGlobals:e,evaluatorOptions:r.evaluatorOptions});a.ref&&(s.ref=s.refToReplace=a.ref);return s}}class WidgetAnnotation extends Annotation{constructor(e){super(e);const{dict:t,xref:a,annotationGlobals:r}=e,i=this.data;this._needAppearances=e.needAppearances;i.annotationType=$;void 0===i.fieldName&&(i.fieldName=this._constructFieldName(t));void 0===i.actions&&(i.actions=collectActions(a,t,ye));let n=getInheritableProperty({dict:t,key:"V",getArray:!0});i.fieldValue=this._decodeFormValue(n);const s=getInheritableProperty({dict:t,key:"DV",getArray:!0});i.defaultFieldValue=this._decodeFormValue(s);if(void 0===n&&r.xfaDatasets){const e=this._title.str;if(e){this._hasValueFromXFA=!0;i.fieldValue=n=r.xfaDatasets.getValue(e)}}void 0===n&&null!==i.defaultFieldValue&&(i.fieldValue=i.defaultFieldValue);i.alternativeText=stringToPDFString(t.get("TU")||"");this.setDefaultAppearance(e);i.hasAppearance||=this._needAppearances&&void 0!==i.fieldValue&&null!==i.fieldValue;const o=getInheritableProperty({dict:t,key:"FT"});i.fieldType=o instanceof Name?o.name:null;const c=getInheritableProperty({dict:t,key:"DR"}),l=r.acroForm.get("DR"),h=this.appearance?.dict.get("Resources");this._fieldResources={localResources:c,acroFormResources:l,appearanceResources:h,mergedResources:Dict.merge({xref:a,dictArray:[c,h,l],mergeSubDicts:!0})};i.fieldFlags=getInheritableProperty({dict:t,key:"Ff"});(!Number.isInteger(i.fieldFlags)||i.fieldFlags<0)&&(i.fieldFlags=0);i.password=this.hasFieldFlag(ne);i.readOnly=this.hasFieldFlag(ae);i.required=this.hasFieldFlag(re);i.hidden=this._hasFlag(i.annotationFlags,J)||this._hasFlag(i.annotationFlags,Q)}_decodeFormValue(e){return Array.isArray(e)?e.filter((e=>"string"==typeof e)).map((e=>stringToPDFString(e))):e instanceof Name?stringToPDFString(e.name):"string"==typeof e?stringToPDFString(e):null}hasFieldFlag(e){return!!(this.data.fieldFlags&e)}_isViewable(e){return!0}mustBeViewed(e,t){return t?this.viewable:super.mustBeViewed(e,t)&&!this._hasFlag(this.flags,Q)}getRotationMatrix(e){let t=e?.get(this.data.id)?.rotation;void 0===t&&(t=this.rotation);return 0===t?Fa:getRotationMatrix(t,this.width,this.height)}getBorderAndBackgroundAppearances(e){let t=e?.get(this.data.id)?.rotation;void 0===t&&(t=this.rotation);if(!this.backgroundColor&&!this.borderColor)return"";const a=0===t||180===t?`0 0 ${this.width} ${this.height} re`:`0 0 ${this.height} ${this.width} re`;let r="";this.backgroundColor&&(r=`${getPdfColor(this.backgroundColor,!0)} ${a} f `);if(this.borderColor){r+=`${this.borderStyle.width||1} w ${getPdfColor(this.borderColor,!1)} ${a} S `}return r}async getOperatorList(e,t,a,r){if(a&l&&!(this instanceof SignatureWidgetAnnotation)&&!this.data.noHTML&&!this.data.hasOwnCanvas)return{opList:new OperatorList,separateForm:!0,separateCanvas:!1};if(!this._hasText)return super.getOperatorList(e,t,a,r);const i=await this._getAppearance(e,t,a,r);if(this.appearance&&null===i)return super.getOperatorList(e,t,a,r);const n=new OperatorList;if(!this._defaultAppearance||null===i)return{opList:n,separateForm:!1,separateCanvas:!1};const o=!!(this.data.hasOwnCanvas&&a&s),c=[0,0,this.width,this.height],h=getTransformMatrix(this.data.rect,c,[1,0,0,1,0,0]);let u;this.oc&&(u=await e.parseMarkedContentProps(this.oc,null));void 0!==u&&n.addOp(jt,["OC",u]);n.addOp($t,[this.data.id,this.data.rect,h,this.getRotationMatrix(r),o]);const d=new StringStream(i);await e.getOperatorList({stream:d,task:t,resources:this._fieldResources.mergedResources,operatorList:n});n.addOp(Gt,[]);void 0!==u&&n.addOp(_t,[]);return{opList:n,separateForm:!1,separateCanvas:o}}_getMKDict(e){const t=new Dict(null);e&&t.set("R",e);t.setIfArray("BC",getPdfColorArray(this.borderColor));t.setIfArray("BG",getPdfColorArray(this.backgroundColor));return t.size>0?t:null}amendSavedDict(e,t){}setValue(e,t,a,r){const{dict:i,ref:n}=function getParentToUpdate(e,t,a){const r=new RefSet,i=e,n={dict:null,ref:null};for(;e instanceof Dict&&!r.has(t);){r.put(t);if(e.has("T"))break;if(!((t=e.getRaw("Parent"))instanceof Ref))return n;e=a.fetch(t)}if(e instanceof Dict&&e!==i){n.dict=e;n.ref=t}return n}(e,this.ref,a);if(i){if(!r.has(n)){const e=i.clone();e.set("V",t);r.put(n,{data:e});return e}}else e.set("V",t);return null}async save(e,t,a,r){const i=a?.get(this.data.id),n=this._buildFlags(i?.noView,i?.noPrint);let s=i?.value,o=i?.rotation;if(s===this.data.fieldValue||void 0===s){if(!this._hasValueFromXFA&&void 0===o&&void 0===n)return;s||=this.data.fieldValue}if(void 0===o&&!this._hasValueFromXFA&&Array.isArray(s)&&Array.isArray(this.data.fieldValue)&&isArrayEqual(s,this.data.fieldValue)&&void 0===n)return;void 0===o&&(o=this.rotation);let l=null;if(!this._needAppearances){l=await this._getAppearance(e,t,c,a);if(null===l&&void 0===n)return}let h=!1;if(l?.needAppearances){h=!0;l=null}const{xref:u}=e,d=u.fetchIfRef(this.ref);if(!(d instanceof Dict))return;const f=new Dict(u);for(const e of d.getKeys())"AP"!==e&&f.set(e,d.getRaw(e));if(void 0!==n){f.set("F",n);if(null===l&&!h){const e=d.getRaw("AP");e&&f.set("AP",e)}}const g={path:this.data.fieldName,value:s},p=this.setValue(f,Array.isArray(s)?s.map(stringToAsciiOrUTF16BE):stringToAsciiOrUTF16BE(s),u,r);this.amendSavedDict(a,p||f);const m=this._getMKDict(o);m&&f.set("MK",m);r.put(this.ref,{data:f,xfa:g,needAppearances:h});if(null!==l){const e=u.getNewTemporaryRef(),t=new Dict(u);f.set("AP",t);t.set("N",e);const i=this._getSaveFieldResources(u),n=new StringStream(l),s=n.dict=new Dict(u);s.setIfName("Subtype","Form");s.set("Resources",i);const c=o%180==0?[0,0,this.width,this.height]:[0,0,this.height,this.width];s.set("BBox",c);const h=this.getRotationMatrix(a);h!==Fa&&s.set("Matrix",h);r.put(e,{data:n,xfa:null,needAppearances:!1})}f.set("M",`D:${getModificationDate()}`)}async _getAppearance(e,t,a,r){if(this.data.password)return null;const n=r?.get(this.data.id);let s,o;if(n){s=n.formattedValue||n.value;o=n.rotation}if(void 0===o&&void 0===s&&!this._needAppearances&&(!this._hasValueFromXFA||this.appearance))return null;const l=this.getBorderAndBackgroundAppearances(r);if(void 0===s){s=this.data.fieldValue;if(!s)return`/Tx BMC q ${l}Q EMC`}Array.isArray(s)&&1===s.length&&(s=s[0]);assert("string"==typeof s,"Expected `value` to be a string.");s=s.trimEnd();if(this.data.combo){const e=this.data.options.find((({exportValue:e})=>s===e));s=e?.displayValue||s}if(""===s)return`/Tx BMC q ${l}Q EMC`;void 0===o&&(o=this.rotation);let h,u=-1;if(this.data.multiLine){h=s.split(/\\r\\n?|\\n/).map((e=>e.normalize("NFC")));u=h.length}else h=[s.replace(/\\r\\n?|\\n/,"").normalize("NFC")];let{width:d,height:f}=this;90!==o&&270!==o||([d,f]=[f,d]);this._defaultAppearance||(this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance="/Helvetica 0 Tf 0 g"));let g,p,m,b=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources);const y=[];let w=!1;for(const e of h){const t=b.encodeString(e);t.length>1&&(w=!0);y.push(t.join(""))}if(w&&a&c)return{needAppearances:!0};if(w&&this._isOffscreenCanvasSupported){const a=this.data.comb?"monospace":"sans-serif",r=new FakeUnicodeFont(e.xref,a),i=r.createFontResources(h.join("")),n=i.getRaw("Font");if(this._fieldResources.mergedResources.has("Font")){const e=this._fieldResources.mergedResources.get("Font");for(const t of n.getKeys())e.set(t,n.getRaw(t))}else this._fieldResources.mergedResources.set("Font",n);const o=r.fontName.name;b=await WidgetAnnotation._getFontData(e,t,{fontName:o,fontSize:0},i);for(let e=0,t=y.length;e<t;e++)y[e]=stringToUTF16String(h[e]);const c=Object.assign(Object.create(null),this.data.defaultAppearanceData);this.data.defaultAppearanceData.fontSize=0;this.data.defaultAppearanceData.fontName=o;[g,p,m]=this._computeFontSize(f-2,d-4,s,b,u);this.data.defaultAppearanceData=c}else{this._isOffscreenCanvasSupported||warn("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly.");[g,p,m]=this._computeFontSize(f-2,d-4,s,b,u)}let x=b.descent;x=isNaN(x)?i*m:Math.max(i*m,Math.abs(x)*p);const S=Math.min(Math.floor((f-p)/2),1),k=this.data.textAlignment;if(this.data.multiLine)return this._getMultilineAppearance(g,y,b,p,d,f,k,2,S,x,m,r);if(this.data.comb)return this._getCombAppearance(g,b,y[0],p,d,f,2,S,x,m,r);const C=S+x;if(0===k||k>2)return`/Tx BMC q ${l}BT `+g+` 1 0 0 1 ${numberToString(2)} ${numberToString(C)} Tm (${escapeString(y[0])}) Tj ET Q EMC`;return`/Tx BMC q ${l}BT `+g+` 1 0 0 1 0 0 Tm ${this._renderText(y[0],b,p,d,k,{shift:0},2,C)} ET Q EMC`}static async _getFontData(e,t,a,r){const i=new OperatorList,n={font:null,clone(){return this}},{fontName:s,fontSize:o}=a;await e.handleSetFont(r,[s&&Name.get(s),o],null,i,t,n,null);return n.font}_getTextWidth(e,t){return Math.sumPrecise(t.charsToGlyphs(e).map((e=>e.width)))/1e3}_computeFontSize(e,t,r,i,n){let{fontSize:s}=this.data.defaultAppearanceData,o=(s||12)*a,c=Math.round(e/o);if(!s){const roundWithTwoDigits=e=>Math.floor(100*e)/100;if(-1===n){const n=this._getTextWidth(r,i);s=roundWithTwoDigits(Math.min(e/a,t/n));c=1}else{const l=r.split(/\\r\\n?|\\n/),h=[];for(const e of l){const t=i.encodeString(e).join(""),a=i.charsToGlyphs(t),r=i.getCharPositions(t);h.push({line:t,glyphs:a,positions:r})}const isTooBig=a=>{let r=0;for(const n of h){r+=this._splitLine(null,i,a,t,n).length*a;if(r>e)return!0}return!1};c=Math.max(c,n);for(;;){o=e/c;s=roundWithTwoDigits(o/a);if(!isTooBig(s))break;c++}}const{fontName:l,fontColor:h}=this.data.defaultAppearanceData;this._defaultAppearance=function createDefaultAppearance({fontSize:e,fontName:t,fontColor:a}){return`/${escapePDFName(t)} ${e} Tf ${getPdfColor(a,!0)}`}({fontSize:s,fontName:l,fontColor:h})}return[this._defaultAppearance,s,e/c]}_renderText(e,t,a,r,i,n,s,o){let c;if(1===i){c=(r-this._getTextWidth(e,t)*a)/2}else if(2===i){c=r-this._getTextWidth(e,t)*a-s}else c=s;const l=numberToString(c-n.shift);n.shift=c;return`${l} ${o=numberToString(o)} Td (${escapeString(e)}) Tj`}_getSaveFieldResources(e){const{localResources:t,appearanceResources:a,acroFormResources:r}=this._fieldResources,i=this.data.defaultAppearanceData?.fontName;if(!i)return t||Dict.empty;for(const e of[t,a])if(e instanceof Dict){const t=e.get("Font");if(t instanceof Dict&&t.has(i))return e}if(r instanceof Dict){const a=r.get("Font");if(a instanceof Dict&&a.has(i)){const r=new Dict(e);r.set(i,a.getRaw(i));const n=new Dict(e);n.set("Font",r);return Dict.merge({xref:e,dictArray:[n,t],mergeSubDicts:!0})}}return t||Dict.empty}getFieldObject(){return null}}class TextWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);const{dict:t}=e;if(t.has("PMD")){this.flags|=J;this.data.hidden=!0;warn("Barcodes are not supported")}this.data.hasOwnCanvas=this.data.readOnly&&!this.data.noHTML;this._hasText=!0;"string"!=typeof this.data.fieldValue&&(this.data.fieldValue="");let a=getInheritableProperty({dict:t,key:"Q"});(!Number.isInteger(a)||a<0||a>2)&&(a=null);this.data.textAlignment=a;let r=getInheritableProperty({dict:t,key:"MaxLen"});(!Number.isInteger(r)||r<0)&&(r=0);this.data.maxLen=r;this.data.multiLine=this.hasFieldFlag(ie);this.data.comb=this.hasFieldFlag(de)&&!this.data.multiLine&&!this.data.password&&!this.hasFieldFlag(le)&&0!==this.data.maxLen;this.data.doNotScroll=this.hasFieldFlag(ue);const{data:{actions:i}}=this;if(!i)return;const n=/^AF(Date|Time)_(?:Keystroke|Format)(?:Ex)?\\([\'"]?([^\'"]+)[\'"]?\\);$/;let s=!1;(1===i.Format?.length&&1===i.Keystroke?.length&&n.test(i.Format[0])&&n.test(i.Keystroke[0])||0===i.Format?.length&&1===i.Keystroke?.length&&n.test(i.Keystroke[0])||0===i.Keystroke?.length&&1===i.Format?.length&&n.test(i.Format[0]))&&(s=!0);const o=[];i.Format&&o.push(...i.Format);i.Keystroke&&o.push(...i.Keystroke);if(s){delete i.Keystroke;i.Format=o}for(const e of o){const t=e.match(n);if(!t)continue;const a="Date"===t[1];let r=t[2];const i=parseInt(r,10);isNaN(i)||Math.floor(Math.log10(i))+1!==t[2].length||(r=(a?Pn:Ln)[i]??r);this.data.datetimeFormat=r;if(!s)break;if(a){if(/HH|MM|ss|h/.test(r)){this.data.datetimeType="datetime-local";this.data.timeStep=/ss/.test(r)?1:60}else this.data.datetimeType="date";break}this.data.datetimeType="time";this.data.timeStep=/ss/.test(r)?1:60;break}}get hasTextContent(){return!!this.appearance&&!this._needAppearances}_getCombAppearance(e,t,a,r,i,n,s,o,c,l,h){const u=i/this.data.maxLen,d=this.getBorderAndBackgroundAppearances(h),f=[],g=t.getCharPositions(a);for(const[e,t]of g)f.push(`(${escapeString(a.substring(e,t))}) Tj`);const p=f.join(` ${numberToString(u)} 0 Td `);return`/Tx BMC q ${d}BT `+e+` 1 0 0 1 ${numberToString(s)} ${numberToString(o+c)} Tm ${p} ET Q EMC`}_getMultilineAppearance(e,t,a,r,i,n,s,o,c,l,h,u){const d=[],f=i-2*o,g={shift:0};for(let e=0,n=t.length;e<n;e++){const n=t[e],u=this._splitLine(n,a,r,f);for(let t=0,n=u.length;t<n;t++){const n=u[t],f=0===e&&0===t?-c-(h-l):-h;d.push(this._renderText(n,a,r,i,s,g,o,f))}}const p=this.getBorderAndBackgroundAppearances(u),m=d.join("\\n");return`/Tx BMC q ${p}BT `+e+` 1 0 0 1 0 ${numberToString(n)} Tm ${m} ET Q EMC`}_splitLine(e,t,a,r,i={}){e=i.line||e;const n=i.glyphs||t.charsToGlyphs(e);if(n.length<=1)return[e];const s=i.positions||t.getCharPositions(e),o=a/1e3,c=[];let l=-1,h=-1,u=-1,d=0,f=0;for(let t=0,a=n.length;t<a;t++){const[a,i]=s[t],g=n[t],p=g.width*o;if(" "===g.unicode)if(f+p>r){c.push(e.substring(d,a));d=a;f=p;l=-1;u=-1}else{f+=p;l=a;h=i;u=t}else if(f+p>r)if(-1!==l){c.push(e.substring(d,h));d=h;t=u+1;l=-1;f=0}else{c.push(e.substring(d,a));d=a;f=p}else f+=p}d<e.length&&c.push(e.substring(d,e.length));return c}async extractTextContent(e,t,a){await super.extractTextContent(e,t,a);const r=this.data.textContent;if(!r)return;const i=r.join("\\n");if(i===this.data.fieldValue)return;const n=i.replaceAll(/([.*+?^${}()|[\\]\\\\])|(\\s+)/g,((e,t)=>t?`\\\\${t}`:"\\\\s+"));new RegExp(`^\\\\s*${n}\\\\s*$`).test(this.data.fieldValue)&&(this.data.textContent=this.data.fieldValue.split("\\n"))}getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue||"",multiline:this.data.multiLine,password:this.data.password,charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,datetimeFormat:this.data.datetimeFormat,hasDatetimeHTML:!!this.data.datetimeType,type:"text"}}}class ButtonWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this.checkedAppearance=null;this.uncheckedAppearance=null;const t=this.hasFieldFlag(se),a=this.hasFieldFlag(oe);this.data.checkBox=!t&&!a;this.data.radioButton=t&&!a;this.data.pushButton=a;this.data.isTooltipOnly=!1;if(this.data.checkBox)this._processCheckBox(e);else if(this.data.radioButton)this._processRadioButton(e);else if(this.data.pushButton){this.data.hasOwnCanvas=!0;this.data.noHTML=!1;this._processPushButton(e)}else warn("Invalid field flags for button widget annotation")}async getOperatorList(e,t,a,r){if(this.data.pushButton)return super.getOperatorList(e,t,a,!1,r);let i=null,n=null;if(r){const e=r.get(this.data.id);i=e?e.value:null;n=e?e.rotation:null}if(null===i&&this.appearance)return super.getOperatorList(e,t,a,r);null==i&&(i=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue);const s=i?this.checkedAppearance:this.uncheckedAppearance;if(s){const i=this.appearance,o=lookupMatrix(s.dict.getArray("Matrix"),Fa);n&&s.dict.set("Matrix",this.getRotationMatrix(r));this.appearance=s;const c=super.getOperatorList(e,t,a,r);this.appearance=i;s.dict.set("Matrix",o);return c}return{opList:new OperatorList,separateForm:!1,separateCanvas:!1}}async save(e,t,a,r){this.data.checkBox?this._saveCheckbox(e,t,a,r):this.data.radioButton&&this._saveRadioButton(e,t,a,r)}async _saveCheckbox(e,t,a,r){if(!a)return;const i=a.get(this.data.id),n=this._buildFlags(i?.noView,i?.noPrint);let s=i?.rotation,o=i?.value;if(void 0===s&&void 0===n){if(void 0===o)return;if(this.data.fieldValue===this.data.exportValue===o)return}let c=e.xref.fetchIfRef(this.ref);if(!(c instanceof Dict))return;c=c.clone();void 0===s&&(s=this.rotation);void 0===o&&(o=this.data.fieldValue===this.data.exportValue);const l={path:this.data.fieldName,value:o?this.data.exportValue:""},h=Name.get(o?this.data.exportValue:"Off");this.setValue(c,h,e.xref,r);c.set("AS",h);c.set("M",`D:${getModificationDate()}`);void 0!==n&&c.set("F",n);const u=this._getMKDict(s);u&&c.set("MK",u);r.put(this.ref,{data:c,xfa:l,needAppearances:!1})}async _saveRadioButton(e,t,a,r){if(!a)return;const i=a.get(this.data.id),n=this._buildFlags(i?.noView,i?.noPrint);let s=i?.rotation,o=i?.value;if(void 0===s&&void 0===n){if(void 0===o)return;if(this.data.fieldValue===this.data.buttonValue===o)return}let c=e.xref.fetchIfRef(this.ref);if(!(c instanceof Dict))return;c=c.clone();void 0===o&&(o=this.data.fieldValue===this.data.buttonValue);void 0===s&&(s=this.rotation);const l={path:this.data.fieldName,value:o?this.data.buttonValue:""},h=Name.get(o?this.data.buttonValue:"Off");o&&this.setValue(c,h,e.xref,r);c.set("AS",h);c.set("M",`D:${getModificationDate()}`);void 0!==n&&c.set("F",n);const u=this._getMKDict(s);u&&c.set("MK",u);r.put(this.ref,{data:c,xfa:l,needAppearances:!1})}_getDefaultCheckedAppearance(e,t){const{width:a,height:r}=this,i=[0,0,a,r],n=.8*Math.min(a,r);let s,o;if("check"===t){s={width:.755*n,height:.705*n};o="3"}else if("disc"===t){s={width:.791*n,height:.705*n};o="l"}else unreachable(`_getDefaultCheckedAppearance - unsupported type: ${t}`);const c=`q BT /PdfJsZaDb ${n} Tf 0 g ${numberToString((a-s.width)/2)} ${numberToString((r-s.height)/2)} Td (${o}) Tj ET Q`,l=new Dict(e.xref);l.set("FormType",1);l.setIfName("Subtype","Form");l.setIfName("Type","XObject");l.set("BBox",i);l.set("Matrix",[1,0,0,1,0,0]);l.set("Length",c.length);const h=new Dict(e.xref),u=new Dict(e.xref);u.set("PdfJsZaDb",this.fallbackFontDict);h.set("Font",u);l.set("Resources",h);this.checkedAppearance=new StringStream(c);this.checkedAppearance.dict=l;this._streams.push(this.checkedAppearance)}_processCheckBox(e){const t=e.dict.get("AP");if(!(t instanceof Dict))return;const a=t.get("N");if(!(a instanceof Dict))return;const r=this._decodeFormValue(e.dict.get("AS"));"string"==typeof r&&(this.data.fieldValue=r);const i=null!==this.data.fieldValue&&"Off"!==this.data.fieldValue?this.data.fieldValue:"Yes",n=this._decodeFormValue(a.getKeys());if(0===n.length)n.push("Off",i);else if(1===n.length)"Off"===n[0]?n.push(i):n.unshift("Off");else if(n.includes(i)){n.length=0;n.push("Off",i)}else{const e=n.find((e=>"Off"!==e));n.length=0;n.push("Off",e)}n.includes(this.data.fieldValue)||(this.data.fieldValue="Off");this.data.exportValue=n[1];const s=a.get(this.data.exportValue);this.checkedAppearance=s instanceof BaseStream?s:null;const o=a.get("Off");this.uncheckedAppearance=o instanceof BaseStream?o:null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"check");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict;null===this.data.defaultFieldValue&&(this.data.defaultFieldValue="Off")}_processRadioButton(e){this.data.buttonValue=null;const t=e.dict.get("Parent");if(t instanceof Dict){this.parent=e.dict.getRaw("Parent");const a=t.get("V");a instanceof Name&&(this.data.fieldValue=this._decodeFormValue(a))}const a=e.dict.get("AP");if(!(a instanceof Dict))return;const r=a.get("N");if(!(r instanceof Dict))return;for(const e of r.getKeys())if("Off"!==e){this.data.buttonValue=this._decodeFormValue(e);break}const i=r.get(this.data.buttonValue);this.checkedAppearance=i instanceof BaseStream?i:null;const n=r.get("Off");this.uncheckedAppearance=n instanceof BaseStream?n:null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"disc");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict;null===this.data.defaultFieldValue&&(this.data.defaultFieldValue="Off")}_processPushButton(e){const{dict:t,annotationGlobals:a}=e;if(t.has("A")||t.has("AA")||this.data.alternativeText){this.data.isTooltipOnly=!t.has("A")&&!t.has("AA");Catalog.parseDestDictionary({destDict:t,resultObj:this.data,docBaseUrl:a.baseUrl,docAttachments:a.attachments})}else warn("Push buttons without action dictionaries are not supported")}getFieldObject(){let e,t="button";if(this.data.checkBox){t="checkbox";e=this.data.exportValue}else if(this.data.radioButton){t="radiobutton";e=this.data.buttonValue}return{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:e,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,hidden:this.data.hidden,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:t}}get fallbackFontDict(){const e=new Dict;e.setIfName("BaseFont","ZapfDingbats");e.setIfName("Type","FallbackType");e.setIfName("Subtype","FallbackType");e.setIfName("Encoding","ZapfDingbatsEncoding");return shadow(this,"fallbackFontDict",e)}}class ChoiceWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.indices=t.getArray("I");this.hasIndices=Array.isArray(this.indices)&&this.indices.length>0;this.data.options=[];const r=getInheritableProperty({dict:t,key:"Opt"});if(Array.isArray(r))for(let e=0,t=r.length;e<t;e++){const t=a.fetchIfRef(r[e]),i=Array.isArray(t);this.data.options[e]={exportValue:this._decodeFormValue(i?a.fetchIfRef(t[0]):t),displayValue:this._decodeFormValue(i?a.fetchIfRef(t[1]):t)}}if(this.hasIndices){this.data.fieldValue=[];const e=this.data.options.length;for(const t of this.indices)Number.isInteger(t)&&t>=0&&t<e&&this.data.fieldValue.push(this.data.options[t].exportValue)}else"string"==typeof this.data.fieldValue?this.data.fieldValue=[this.data.fieldValue]:this.data.fieldValue||=[];0===this.data.options.length&&this.data.fieldValue.length>0&&(this.data.options=this.data.fieldValue.map((e=>({exportValue:e,displayValue:e}))));this.data.combo=this.hasFieldFlag(ce);this.data.multiSelect=this.hasFieldFlag(he);this._hasText=!0}getFieldObject(){const e=this.data.combo?"combobox":"listbox",t=this.data.fieldValue.length>0?this.data.fieldValue[0]:null;return{id:this.data.id,value:t,defaultValue:this.data.defaultFieldValue,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,numItems:this.data.fieldValue.length,multipleSelection:this.data.multiSelect,hidden:this.data.hidden,actions:this.data.actions,items:this.data.options,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:e}}amendSavedDict(e,t){if(!this.hasIndices)return;let a=e?.get(this.data.id)?.value;Array.isArray(a)||(a=[a]);const r=[],{options:i}=this.data;for(let e=0,t=0,n=i.length;e<n;e++)if(i[e].exportValue===a[t]){r.push(e);t+=1}t.set("I",r)}async _getAppearance(e,t,r,i){if(this.data.combo)return super._getAppearance(e,t,r,i);let n,s;const o=i?.get(this.data.id);if(o){s=o.rotation;n=o.value}if(void 0===s&&void 0===n&&!this._needAppearances)return null;void 0===n?n=this.data.fieldValue:Array.isArray(n)||(n=[n]);let{width:c,height:l}=this;90!==s&&270!==s||([c,l]=[l,c]);const h=this.data.options.length,u=[];for(let e=0;e<h;e++){const{exportValue:t}=this.data.options[e];n.includes(t)&&u.push(e)}this._defaultAppearance||(this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance="/Helvetica 0 Tf 0 g"));const d=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources);let f,{fontSize:g}=this.data.defaultAppearanceData;if(g)f=this._defaultAppearance;else{const e=(l-1)/h;let t,a=-1;for(const{displayValue:e}of this.data.options){const r=this._getTextWidth(e,d);if(r>a){a=r;t=e}}[f,g]=this._computeFontSize(e,c-4,t,d,-1)}const p=g*a,m=(p-g)/2,b=Math.floor(l/p);let y=0;if(u.length>0){const e=Math.min(...u),t=Math.max(...u);y=Math.max(0,t-b+1);y>e&&(y=e)}const w=Math.min(y+b+1,h),x=["/Tx BMC q",`1 1 ${c} ${l} re W n`];if(u.length){x.push("0.600006 0.756866 0.854904 rg");for(const e of u)y<=e&&e<w&&x.push(`1 ${l-(e-y+1)*p} ${c} ${p} re f`)}x.push("BT",f,`1 0 0 1 0 ${l} Tm`);const S={shift:0};for(let e=y;e<w;e++){const{displayValue:t}=this.data.options[e],a=e===y?m:0;x.push(this._renderText(t,d,g,c,0,S,2,-p+a))}x.push("ET Q EMC");return x.join("\\n")}}class SignatureWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this.data.fieldValue=null;this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!this.data.hasOwnCanvas}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:"signature"}}}class TextAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.noRotate=!0;this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;const{dict:t}=e;this.data.annotationType=F;if(this.data.hasAppearance)this.data.name="NoIcon";else{this.data.rect[1]=this.data.rect[3]-22;this.data.rect[2]=this.data.rect[0]+22;this.data.name=t.has("Name")?t.get("Name").name:"Note"}if(t.has("State")){this.data.state=t.get("State")||null;this.data.stateModel=t.get("StateModel")||null}else{this.data.state=null;this.data.stateModel=null}}}class LinkAnnotation extends Annotation{constructor(e){super(e);const{dict:t,annotationGlobals:a}=e;this.data.annotationType=T;this.data.noHTML=!1;const r=getQuadPoints(t,this.rectangle);r&&(this.data.quadPoints=r);this.data.borderColor||=this.data.color;Catalog.parseDestDictionary({destDict:t,resultObj:this.data,docBaseUrl:a.baseUrl,docAttachments:a.attachments})}get overlaysTextContent(){return!0}}class PopupAnnotation extends Annotation{constructor(e){super(e);const{dict:t}=e;this.data.annotationType=W;this.data.noHTML=!1;0!==this.width&&0!==this.height||(this.data.rect=null);let a=t.get("Parent");if(!a){warn("Popup annotation has a missing or invalid parent annotation.");return}this.data.parentRect=lookupNormalRect(a.getArray("Rect"),null);this.data.creationDate=a.get("CreationDate")||"";isName(a.get("RT"),G)&&(a=a.get("IRT"));if(a.has("M")){this.setModificationDate(a.get("M"));this.data.modificationDate=this.modificationDate}else this.data.modificationDate=null;if(a.has("C")){this.setColor(a.getArray("C"));this.data.color=this.color}else this.data.color=null;if(!this.viewable){const e=a.get("F");this._isViewable(e)&&this.setFlags(e)}this.setTitle(a.get("T"));this.data.titleObj=this._title;this.setContents(a.get("Contents"));this.data.contentsObj=this._contents;a.has("RC")&&(this.data.richText=XFAFactory.getRichTextAsHtml(a.get("RC")));this.data.open=!!t.get("Open")}static createNewDict(e,t,a){const{oldAnnotation:r,rect:i,parent:n}=e,s=r||new Dict(t);s.setIfNotExists("Type",Name.get("Annot"));s.setIfNotExists("Subtype",Name.get("Popup"));s.setIfNotExists("Open",!1);s.setIfArray("Rect",i);s.set("Parent",n);return s}static async createNewAppearanceStream(e,t,a){return null}}class FreeTextAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.hasOwnCanvas=this.data.noRotate;this.data.isEditable=!this.data.noHTML;this.data.noHTML=!1;const{annotationGlobals:t,evaluatorOptions:a,xref:r}=e;this.data.annotationType=O;this.setDefaultAppearance(e);this._hasAppearance=!!this.appearance;if(this._hasAppearance){const{fontColor:e,fontSize:i}=function parseAppearanceStream(e,t,a,r){return new AppearanceStreamEvaluator(e,t,a,r).parse()}(this.appearance,a,r,t.globalColorSpaceCache);this.data.defaultAppearanceData.fontColor=e;this.data.defaultAppearanceData.fontSize=i||10}else{this.data.defaultAppearanceData.fontSize||=10;const{fontColor:t,fontSize:a}=this.data.defaultAppearanceData;if(this._contents.str){this.data.textContent=this._contents.str.split(/\\r\\n?|\\n/).map((e=>e.trimEnd()));const{coords:e,bbox:t,matrix:r}=FakeUnicodeFont.getFirstPositionInfo(this.rectangle,this.rotation,a);this.data.textPosition=this._transformPoint(e,t,r)}if(this._isOffscreenCanvasSupported){const i=e.dict.get("CA"),n=new FakeUnicodeFont(r,"sans-serif");this.appearance=n.createAppearance(this._contents.str,this.rectangle,this.rotation,a,t,i);this._streams.push(this.appearance)}else warn("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.")}}get hasTextContent(){return this._hasAppearance}static createNewDict(e,t,{apRef:a,ap:r}){const{color:i,date:n,fontSize:s,oldAnnotation:o,rect:c,rotation:l,user:h,value:u}=e,d=o||new Dict(t);d.setIfNotExists("Type",Name.get("Annot"));d.setIfNotExists("Subtype",Name.get("FreeText"));d.set(o?"M":"CreationDate",`D:${getModificationDate(n)}`);o&&d.delete("RC");d.setIfArray("Rect",c);const f=`/Helv ${s} Tf ${getPdfColor(i,!0)}`;d.set("DA",f);d.setIfDefined("Contents",stringToAsciiOrUTF16BE(u));d.setIfNotExists("F",4);d.setIfNotExists("Border",[0,0,0]);d.setIfNumber("Rotate",l);d.setIfDefined("T",stringToAsciiOrUTF16BE(h));if(a||r){const e=new Dict(t);d.set("AP",e);e.set("N",a||r)}return d}static async createNewAppearanceStream(e,t,r){const{baseFontRef:i,evaluator:n,task:s}=r,{color:o,fontSize:c,rect:l,rotation:h,value:u}=e;if(!o)return null;const d=new Dict(t),f=new Dict(t);if(i)f.set("Helv",i);else{const e=new Dict(t);e.setIfName("BaseFont","Helvetica");e.setIfName("Type","Font");e.setIfName("Subtype","Type1");e.setIfName("Encoding","WinAnsiEncoding");f.set("Helv",e)}d.set("Font",f);const g=await WidgetAnnotation._getFontData(n,s,{fontName:"Helv",fontSize:c},d),[p,m,b,y]=l;let w=b-p,x=y-m;h%180!=0&&([w,x]=[x,w]);const S=u.split("\\n"),k=c/1e3;let C=-1/0;const v=[];for(let e of S){const t=g.encodeString(e);if(t.length>1)return null;e=t.join("");v.push(e);let a=0;const r=g.charsToGlyphs(e);for(const e of r)a+=e.width*k;C=Math.max(C,a)}let F=1;C>w&&(F=w/C);let T=1;const O=a*c,M=1*c,D=O*S.length;D>x&&(T=x/D);const R=c*Math.min(F,T);let N,E,L;switch(h){case 0:L=[1,0,0,1];E=[l[0],l[1],w,x];N=[l[0],l[3]-M];break;case 90:L=[0,1,-1,0];E=[l[1],-l[2],w,x];N=[l[1],-l[0]-M];break;case 180:L=[-1,0,0,-1];E=[-l[2],-l[3],w,x];N=[-l[2],-l[1]-M];break;case 270:L=[0,-1,1,0];E=[-l[3],l[0],w,x];N=[-l[3],l[2]-M]}const j=["q",`${L.join(" ")} 0 0 cm`,`${E.join(" ")} re W n`,"BT",`${getPdfColor(o,!0)}`,`0 Tc /Helv ${numberToString(R)} Tf`];j.push(`${N.join(" ")} Td (${escapeString(v[0])}) Tj`);const _=numberToString(O);for(let e=1,t=v.length;e<t;e++){const t=v[e];j.push(`0 -${_} Td (${escapeString(t)}) Tj`)}j.push("ET","Q");const U=j.join("\\n"),X=new Dict(t);X.set("FormType",1);X.setIfName("Subtype","Form");X.setIfName("Type","XObject");X.set("BBox",l);X.set("Resources",d);X.set("Matrix",[1,0,0,1,-l[0],-l[1]]);const q=new StringStream(U);q.dict=X;return q}}class LineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=M;this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;const r=lookupRect(t.getArray("L"),[0,0,0,0]);this.data.lineCoordinates=Util.normalizeRect(r);this.setLineEndings(t.getArray("LE"));this.data.lineEndings=this.lineEndings;if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),i=t.get("CA"),n=getPdfColorArray(getRgbColor(t.getArray("IC"),null)),s=n?i:null,o=this.borderStyle.width||1,c=2*o,l=[this.data.lineCoordinates[0]-c,this.data.lineCoordinates[1]-c,this.data.lineCoordinates[2]+c,this.data.lineCoordinates[3]+c];Util.intersect(this.rectangle,l)||(this.rectangle=l);this._setDefaultAppearance({xref:a,extra:`${o} w`,strokeColor:e,fillColor:n,strokeAlpha:i,fillAlpha:s,pointsCallback:(e,t)=>{e.push(`${r[0]} ${r[1]} m`,`${r[2]} ${r[3]} l`,"S");return[t[0]-o,t[7]-o,t[2]+o,t[3]+o]}})}}}class SquareAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=D;this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA"),i=getPdfColorArray(getRgbColor(t.getArray("IC"),null)),n=i?r:null;if(0===this.borderStyle.width&&!i)return;this._setDefaultAppearance({xref:a,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:i,strokeAlpha:r,fillAlpha:n,pointsCallback:(e,t)=>{const a=t[4]+this.borderStyle.width/2,r=t[5]+this.borderStyle.width/2,n=t[6]-t[4]-this.borderStyle.width,s=t[3]-t[7]-this.borderStyle.width;e.push(`${a} ${r} ${n} ${s} re`);i?e.push("B"):e.push("S");return[t[0],t[7],t[2],t[3]]}})}}}class CircleAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=R;if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA"),i=getPdfColorArray(getRgbColor(t.getArray("IC"),null)),n=i?r:null;if(0===this.borderStyle.width&&!i)return;const s=4/3*Math.tan(Math.PI/8);this._setDefaultAppearance({xref:a,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:i,strokeAlpha:r,fillAlpha:n,pointsCallback:(e,t)=>{const a=t[0]+this.borderStyle.width/2,r=t[1]-this.borderStyle.width/2,n=t[6]-this.borderStyle.width/2,o=t[7]+this.borderStyle.width/2,c=a+(n-a)/2,l=r+(o-r)/2,h=(n-a)/2*s,u=(o-r)/2*s;e.push(`${c} ${o} m`,`${c+h} ${o} ${n} ${l+u} ${n} ${l} c`,`${n} ${l-u} ${c+h} ${r} ${c} ${r} c`,`${c-h} ${r} ${a} ${l-u} ${a} ${l} c`,`${a} ${l+u} ${c-h} ${o} ${c} ${o} c`,"h");i?e.push("B"):e.push("S");return[t[0],t[7],t[2],t[3]]}})}}}class PolylineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=E;this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;this.data.vertices=null;if(!(this instanceof PolygonAnnotation)){this.setLineEndings(t.getArray("LE"));this.data.lineEndings=this.lineEndings}const r=t.getArray("Vertices");if(!isNumberArray(r,null))return;const i=this.data.vertices=Float32Array.from(r);if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA");let n,s=getRgbColor(t.getArray("IC"),null);s&&(s=getPdfColorArray(s));n=s?this.color?s.every(((t,a)=>t===e[a]))?"f":"B":"f":"S";const o=this.borderStyle.width||1,c=2*o,l=[1/0,1/0,-1/0,-1/0];for(let e=0,t=i.length;e<t;e+=2)Util.rectBoundingBox(i[e]-c,i[e+1]-c,i[e]+c,i[e+1]+c,l);Util.intersect(this.rectangle,l)||(this.rectangle=l);this._setDefaultAppearance({xref:a,extra:`${o} w`,strokeColor:e,strokeAlpha:r,fillColor:s,fillAlpha:s?r:null,pointsCallback:(e,t)=>{for(let t=0,a=i.length;t<a;t+=2)e.push(`${i[t]} ${i[t+1]} ${0===t?"m":"l"}`);e.push(n);return[t[0],t[7],t[2],t[3]]}})}}}class PolygonAnnotation extends PolylineAnnotation{constructor(e){super(e);this.data.annotationType=N}}class CaretAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=q}}class InkAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;const{dict:t,xref:a}=e;this.data.annotationType=H;this.data.inkLists=[];this.data.isEditable=!this.data.noHTML;this.data.noHTML=!1;this.data.opacity=t.get("CA")||1;const r=t.getArray("InkList");if(Array.isArray(r)){for(let e=0,t=r.length;e<t;++e){if(!Array.isArray(r[e]))continue;const t=new Float32Array(r[e].length);this.data.inkLists.push(t);for(let i=0,n=r[e].length;i<n;i+=2){const n=a.fetchIfRef(r[e][i]),s=a.fetchIfRef(r[e][i+1]);if("number"==typeof n&&"number"==typeof s){t[i]=n;t[i+1]=s}}}if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA"),i=this.borderStyle.width||1,n=2*i,s=[1/0,1/0,-1/0,-1/0];for(const e of this.data.inkLists)for(let t=0,a=e.length;t<a;t+=2)Util.rectBoundingBox(e[t]-n,e[t+1]-n,e[t]+n,e[t+1]+n,s);Util.intersect(this.rectangle,s)||(this.rectangle=s);this._setDefaultAppearance({xref:a,extra:`${i} w`,strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{for(const t of this.data.inkLists){for(let a=0,r=t.length;a<r;a+=2)e.push(`${t[a]} ${t[a+1]} ${0===a?"m":"l"}`);e.push("S")}return[t[0],t[7],t[2],t[3]]}})}}}static createNewDict(e,t,{apRef:a,ap:r}){const{oldAnnotation:i,color:n,date:s,opacity:o,paths:c,outlines:l,rect:h,rotation:u,thickness:d,user:f}=e,g=i||new Dict(t);g.setIfNotExists("Type",Name.get("Annot"));g.setIfNotExists("Subtype",Name.get("Ink"));g.set(i?"M":"CreationDate",`D:${getModificationDate(s)}`);g.setIfArray("Rect",h);g.setIfArray("InkList",l?.points||c?.points);g.setIfNotExists("F",4);g.setIfNumber("Rotate",u);g.setIfDefined("T",stringToAsciiOrUTF16BE(f));l&&g.setIfName("IT","InkHighlight");if(d>0){const e=new Dict(t);g.set("BS",e);e.set("W",d)}g.setIfArray("C",getPdfColorArray(n));g.setIfNumber("CA",o);if(r||a){const e=new Dict(t);g.set("AP",e);e.set("N",a||r)}return g}static async createNewAppearanceStream(e,t,a){if(e.outlines)return this.createNewAppearanceStreamForHighlight(e,t,a);const{color:r,rect:i,paths:n,thickness:s,opacity:o}=e;if(!r)return null;const c=[`${s} w 1 J 1 j`,`${getPdfColor(r,!1)}`];1!==o&&c.push("/R0 gs");for(const e of n.lines){c.push(`${numberToString(e[4])} ${numberToString(e[5])} m`);for(let t=6,a=e.length;t<a;t+=6)if(isNaN(e[t]))c.push(`${numberToString(e[t+4])} ${numberToString(e[t+5])} l`);else{const[a,r,i,n,s,o]=e.slice(t,t+6);c.push([a,r,i,n,s,o].map(numberToString).join(" ")+" c")}6===e.length&&c.push(`${numberToString(e[4])} ${numberToString(e[5])} l`)}c.push("S");const l=c.join("\\n"),h=new Dict(t);h.set("FormType",1);h.setIfName("Subtype","Form");h.setIfName("Type","XObject");h.set("BBox",i);h.set("Length",l.length);if(1!==o){const e=new Dict(t),a=new Dict(t),r=new Dict(t);r.set("CA",o);r.setIfName("Type","ExtGState");a.set("R0",r);e.set("ExtGState",a);h.set("Resources",e)}const u=new StringStream(l);u.dict=h;return u}static async createNewAppearanceStreamForHighlight(e,t,a){const{color:r,rect:i,outlines:{outline:n},opacity:s}=e;if(!r)return null;const o=[`${getPdfColor(r,!0)}`,"/R0 gs"];o.push(`${numberToString(n[4])} ${numberToString(n[5])} m`);for(let e=6,t=n.length;e<t;e+=6)if(isNaN(n[e]))o.push(`${numberToString(n[e+4])} ${numberToString(n[e+5])} l`);else{const[t,a,r,i,s,c]=n.slice(e,e+6);o.push([t,a,r,i,s,c].map(numberToString).join(" ")+" c")}o.push("h f");const c=o.join("\\n"),l=new Dict(t);l.set("FormType",1);l.setIfName("Subtype","Form");l.setIfName("Type","XObject");l.set("BBox",i);l.set("Length",c.length);const h=new Dict(t),u=new Dict(t);h.set("ExtGState",u);l.set("Resources",h);const d=new Dict(t);u.set("R0",d);d.setIfName("BM","Multiply");if(1!==s){d.set("ca",s);d.setIfName("Type","ExtGState")}const f=new StringStream(c);f.dict=l;return f}}class HighlightAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=L;this.data.isEditable=!this.data.noHTML;this.data.noHTML=!1;this.data.opacity=t.get("CA")||1;if(this.data.quadPoints=getQuadPoints(t,null)){const e=this.appearance?.dict.get("Resources");if(!this.appearance||!e?.has("ExtGState")){this.appearance&&warn("HighlightAnnotation - ignoring built-in appearance stream.");const e=getPdfColorArray(this.color,[1,1,0]),r=t.get("CA");this._setDefaultAppearance({xref:a,fillColor:e,blendMode:"Multiply",fillAlpha:r,pointsCallback:(e,t)=>{e.push(`${t[0]} ${t[1]} m`,`${t[2]} ${t[3]} l`,`${t[6]} ${t[7]} l`,`${t[4]} ${t[5]} l`,"f");return[t[0],t[7],t[2],t[3]]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}static createNewDict(e,t,{apRef:a,ap:r}){const{color:i,date:n,oldAnnotation:s,opacity:o,rect:c,rotation:l,user:h,quadPoints:u}=e,d=s||new Dict(t);d.setIfNotExists("Type",Name.get("Annot"));d.setIfNotExists("Subtype",Name.get("Highlight"));d.set(s?"M":"CreationDate",`D:${getModificationDate(n)}`);d.setIfArray("Rect",c);d.setIfNotExists("F",4);d.setIfNotExists("Border",[0,0,0]);d.setIfNumber("Rotate",l);d.setIfArray("QuadPoints",u);d.setIfArray("C",getPdfColorArray(i));d.setIfNumber("CA",o);d.setIfDefined("T",stringToAsciiOrUTF16BE(h));if(a||r){const e=new Dict(t);d.set("AP",e);e.set("N",a||r)}return d}static async createNewAppearanceStream(e,t,a){const{color:r,rect:i,outlines:n,opacity:s}=e;if(!r)return null;const o=[`${getPdfColor(r,!0)}`,"/R0 gs"],c=[];for(const e of n){c.length=0;c.push(`${numberToString(e[0])} ${numberToString(e[1])} m`);for(let t=2,a=e.length;t<a;t+=2)c.push(`${numberToString(e[t])} ${numberToString(e[t+1])} l`);c.push("h");o.push(c.join("\\n"))}o.push("f*");const l=o.join("\\n"),h=new Dict(t);h.set("FormType",1);h.setIfName("Subtype","Form");h.setIfName("Type","XObject");h.set("BBox",i);h.set("Length",l.length);const u=new Dict(t),d=new Dict(t);u.set("ExtGState",d);h.set("Resources",u);const f=new Dict(t);d.set("R0",f);f.setIfName("BM","Multiply");if(1!==s){f.set("ca",s);f.setIfName("Type","ExtGState")}const g=new StringStream(l);g.dict=h;return g}}class UnderlineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=j;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 0.571 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{e.push(`${t[4]} ${t[5]+1.3} m`,`${t[6]} ${t[7]+1.3} l`,"S");return[t[0],t[7],t[2],t[3]]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class SquigglyAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=_;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{const a=(t[1]-t[5])/6;let r=a,i=t[4];const n=t[5],s=t[6];e.push(`${i} ${n+r} m`);do{i+=2;r=0===r?a:0;e.push(`${i} ${n+r} l`)}while(i<s);e.push("S");return[t[4],n-2*a,s,n+2*a]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class StrikeOutAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=U;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{e.push((t[0]+t[4])/2+" "+(t[1]+t[5])/2+" m",(t[2]+t[6])/2+" "+(t[3]+t[7])/2+" l","S");return[t[0],t[7],t[2],t[3]]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class StampAnnotation extends MarkupAnnotation{#pe=null;constructor(e){super(e);this.data.annotationType=X;this.data.hasOwnCanvas=this.data.noRotate;this.data.isEditable=!this.data.noHTML;this.data.noHTML=!1}mustBeViewedWhenEditing(e,t=null){if(e){if(!this.data.isEditable)return!0;this.#pe??=this.data.hasOwnCanvas;this.data.hasOwnCanvas=!0;return!0}if(null!==this.#pe){this.data.hasOwnCanvas=this.#pe;this.#pe=null}return!t?.has(this.data.id)}static async createImage(e,t){const{width:a,height:r}=e,i=new OffscreenCanvas(a,r),n=i.getContext("2d",{alpha:!0});n.drawImage(e,0,0);const s=n.getImageData(0,0,a,r).data,o=new Uint32Array(s.buffer),c=o.some(FeatureTest.isLittleEndian?e=>e>>>24!=255:e=>!!(255&~e));if(c){n.fillStyle="white";n.fillRect(0,0,a,r);n.drawImage(e,0,0)}const l=i.convertToBlob({type:"image/jpeg",quality:1}).then((e=>e.arrayBuffer())),h=Name.get("XObject"),u=Name.get("Image"),d=new Dict(t);d.set("Type",h);d.set("Subtype",u);d.set("BitsPerComponent",8);d.setIfName("ColorSpace","DeviceRGB");d.setIfName("Filter","DCTDecode");d.set("BBox",[0,0,a,r]);d.set("Width",a);d.set("Height",r);let f=null;if(c){const e=new Uint8Array(o.length);if(FeatureTest.isLittleEndian)for(let t=0,a=o.length;t<a;t++)e[t]=o[t]>>>24;else for(let t=0,a=o.length;t<a;t++)e[t]=255&o[t];const i=new Dict(t);i.set("Type",h);i.set("Subtype",u);i.set("BitsPerComponent",8);i.setIfName("ColorSpace","DeviceGray");i.set("Width",a);i.set("Height",r);f=new Stream(e,0,0,i)}return{imageStream:new Stream(await l,0,0,d),smaskStream:f,width:a,height:r}}static createNewDict(e,t,{apRef:a,ap:r}){const{date:i,oldAnnotation:n,rect:s,rotation:o,user:c}=e,l=n||new Dict(t);l.setIfNotExists("Type",Name.get("Annot"));l.setIfNotExists("Subtype",Name.get("Stamp"));l.set(n?"M":"CreationDate",`D:${getModificationDate(i)}`);l.setIfArray("Rect",s);l.setIfNotExists("F",4);l.setIfNotExists("Border",[0,0,0]);l.setIfNumber("Rotate",o);l.setIfDefined("T",stringToAsciiOrUTF16BE(c));if(a||r){const e=new Dict(t);l.set("AP",e);e.set("N",a||r)}return l}static async#me(e,t){const{areContours:a,color:r,rect:i,lines:n,thickness:s}=e;if(!r)return null;const o=[`${s} w 1 J 1 j`,`${getPdfColor(r,a)}`];for(const e of n){o.push(`${numberToString(e[4])} ${numberToString(e[5])} m`);for(let t=6,a=e.length;t<a;t+=6)if(isNaN(e[t]))o.push(`${numberToString(e[t+4])} ${numberToString(e[t+5])} l`);else{const[a,r,i,n,s,c]=e.slice(t,t+6);o.push([a,r,i,n,s,c].map(numberToString).join(" ")+" c")}6===e.length&&o.push(`${numberToString(e[4])} ${numberToString(e[5])} l`)}o.push(a?"F":"S");const c=o.join("\\n"),l=new Dict(t);l.set("FormType",1);l.setIfName("Subtype","Form");l.setIfName("Type","XObject");l.set("BBox",i);l.set("Length",c.length);const h=new StringStream(c);h.dict=l;return h}static async createNewAppearanceStream(e,t,a){if(e.oldAnnotation)return null;if(e.isSignature)return this.#me(e,t);const{rotation:r}=e,{imageRef:i,width:n,height:s}=a.image,o=new Dict(t),c=new Dict(t);o.set("XObject",c);c.set("Im0",i);const l=`q ${n} 0 0 ${s} 0 0 cm /Im0 Do Q`,h=new Dict(t);h.set("FormType",1);h.setIfName("Subtype","Form");h.setIfName("Type","XObject");h.set("BBox",[0,0,n,s]);h.set("Resources",o);if(r){const e=getRotationMatrix(r,n,s);h.set("Matrix",e)}const u=new StringStream(l);u.dict=h;return u}}class FileAttachmentAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e,r=new FileSpec(t.get("FS"),a);this.data.annotationType=z;this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;this.data.file=r.serializable;const i=t.get("Name");this.data.name=i instanceof Name?stringToPDFString(i.name):"PushPin";const n=t.get("ca");this.data.fillAlpha="number"==typeof n&&n>=0&&n<=1?n:null}}const pc={get r(){return shadow(this,"r",new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]))},get k(){return shadow(this,"k",new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]))}};function calculateMD5(e,t,a){let r=1732584193,i=-271733879,n=-1732584194,s=271733878;const o=a+72&-64,c=new Uint8Array(o);let l,h;for(l=0;l<a;++l)c[l]=e[t++];c[l++]=128;const u=o-8;l<u&&(l=u);c[l++]=a<<3&255;c[l++]=a>>5&255;c[l++]=a>>13&255;c[l++]=a>>21&255;c[l++]=a>>>29&255;l+=3;const d=new Int32Array(16),{k:f,r:g}=pc;for(l=0;l<o;){for(h=0;h<16;++h,l+=4)d[h]=c[l]|c[l+1]<<8|c[l+2]<<16|c[l+3]<<24;let e,t,a=r,o=i,u=n,p=s;for(h=0;h<64;++h){if(h<16){e=o&u|~o&p;t=h}else if(h<32){e=p&o|~p&u;t=5*h+1&15}else if(h<48){e=o^u^p;t=3*h+5&15}else{e=u^(o|~p);t=7*h&15}const r=p,i=a+e+f[h]+d[t]|0,n=g[h];p=u;u=o;o=o+(i<<n|i>>>32-n)|0;a=r}r=r+a|0;i=i+o|0;n=n+u|0;s=s+p|0}return new Uint8Array([255&r,r>>8&255,r>>16&255,r>>>24&255,255&i,i>>8&255,i>>16&255,i>>>24&255,255&n,n>>8&255,n>>16&255,n>>>24&255,255&s,s>>8&255,s>>16&255,s>>>24&255])}function decodeString(e){try{return stringToUTF8String(e)}catch(t){warn(`UTF-8 decoding failed: "${t}".`);return e}}class DatasetXMLParser extends SimpleXMLParser{constructor(e){super(e);this.node=null}onEndElement(e){const t=super.onEndElement(e);if(t&&"xfa:datasets"===e){this.node=t;throw new Error("Aborting DatasetXMLParser.")}}}class DatasetReader{constructor(e){if(e.datasets)this.node=new SimpleXMLParser({hasAttributes:!0}).parseFromString(e.datasets).documentElement;else{const t=new DatasetXMLParser({hasAttributes:!0});try{t.parseFromString(e["xdp:xdp"])}catch{}this.node=t.node}}getValue(e){if(!this.node||!e)return"";const t=this.node.searchNode(parseXFAPath(e),0);if(!t)return"";const a=t.firstChild;return"value"===a?.nodeName?t.children.map((e=>decodeString(e.textContent))):decodeString(t.textContent)}}class SingleIntersector{#be;#ye=1/0;#we=1/0;#xe=-1/0;#Se=-1/0;#Ae=null;#ke=[];#Ce=[];#ve=-1;#Fe=!1;constructor(e){this.#be=e;const t=e.data.quadPoints;if(t){for(let e=0,a=t.length;e<a;e+=8){this.#ye=Math.min(this.#ye,t[e]);this.#xe=Math.max(this.#xe,t[e+2]);this.#we=Math.min(this.#we,t[e+5]);this.#Se=Math.max(this.#Se,t[e+1])}t.length>8&&(this.#Ae=t)}else[this.#ye,this.#we,this.#xe,this.#Se]=e.data.rect}overlaps(e){return!(this.#ye>=e.#xe||this.#xe<=e.#ye||this.#we>=e.#Se||this.#Se<=e.#we)}#Ie(e,t){if(this.#ye>=e||this.#xe<=e||this.#we>=t||this.#Se<=t)return!1;const a=this.#Ae;if(!a)return!0;if(this.#ve>=0){const r=this.#ve;if(!(a[r]>=e||a[r+2]<=e||a[r+5]>=t||a[r+1]<=t))return!0;this.#ve=-1}for(let r=0,i=a.length;r<i;r+=8)if(!(a[r]>=e||a[r+2]<=e||a[r+5]>=t||a[r+1]<=t)){this.#ve=r;return!0}return!1}addGlyph(e,t,a){if(!this.#Ie(e,t)){this.disableExtraChars();return!1}if(this.#Ce.length>0){this.#ke.push(this.#Ce.join(""));this.#Ce.length=0}this.#ke.push(a);this.#Fe=!0;return!0}addExtraChar(e){this.#Fe&&this.#Ce.push(e)}disableExtraChars(){if(this.#Fe){this.#Fe=!1;this.#Ce.length=0}}setText(){this.#be.data.overlaidText=this.#ke.join("")}}class Intersector{#Te=new Map;constructor(e){for(const t of e){if(!t.data.quadPoints&&!t.data.rect)continue;const e=new SingleIntersector(t);for(const[t,a]of this.#Te)t.overlaps(e)&&(a?a.add(e):this.#Te.set(t,new Set([e])));this.#Te.set(e,null)}}addGlyph(e,t,a,r){const i=e[4]+t/2,n=e[5]+a/2;let s;for(const[e,t]of this.#Te)s?s.has(e)?e.addGlyph(i,n,r):e.disableExtraChars():e.addGlyph(i,n,r)&&(s=t)}addExtraChar(e){for(const t of this.#Te.keys())t.addExtraChar(e)}setText(){for(const e of this.#Te.keys())e.setText()}}class Word64{constructor(e,t){this.high=0|e;this.low=0|t}and(e){this.high&=e.high;this.low&=e.low}xor(e){this.high^=e.high;this.low^=e.low}shiftRight(e){if(e>=32){this.low=this.high>>>e-32|0;this.high=0}else{this.low=this.low>>>e|this.high<<32-e;this.high=this.high>>>e|0}}rotateRight(e){let t,a;if(32&e){a=this.low;t=this.high}else{t=this.low;a=this.high}e&=31;this.low=t>>>e|a<<32-e;this.high=a>>>e|t<<32-e}not(){this.high=~this.high;this.low=~this.low}add(e){const t=(this.low>>>0)+(e.low>>>0);let a=(this.high>>>0)+(e.high>>>0);t>4294967295&&(a+=1);this.low=0|t;this.high=0|a}copyTo(e,t){e[t]=this.high>>>24&255;e[t+1]=this.high>>16&255;e[t+2]=this.high>>8&255;e[t+3]=255&this.high;e[t+4]=this.low>>>24&255;e[t+5]=this.low>>16&255;e[t+6]=this.low>>8&255;e[t+7]=255&this.low}assign(e){this.high=e.high;this.low=e.low}}const mc={get k(){return shadow(this,"k",[new Word64(1116352408,3609767458),new Word64(1899447441,602891725),new Word64(3049323471,3964484399),new Word64(3921009573,2173295548),new Word64(961987163,4081628472),new Word64(1508970993,3053834265),new Word64(2453635748,2937671579),new Word64(2870763221,3664609560),new Word64(3624381080,2734883394),new Word64(310598401,1164996542),new Word64(607225278,1323610764),new Word64(1426881987,3590304994),new Word64(1925078388,4068182383),new Word64(2162078206,991336113),new Word64(2614888103,633803317),new Word64(3248222580,3479774868),new Word64(3835390401,2666613458),new Word64(4022224774,944711139),new Word64(264347078,2341262773),new Word64(604807628,2007800933),new Word64(770255983,1495990901),new Word64(1249150122,1856431235),new Word64(1555081692,3175218132),new Word64(1996064986,2198950837),new Word64(2554220882,3999719339),new Word64(2821834349,766784016),new Word64(2952996808,2566594879),new Word64(3210313671,3203337956),new Word64(3336571891,1034457026),new Word64(3584528711,2466948901),new Word64(113926993,3758326383),new Word64(338241895,168717936),new Word64(666307205,1188179964),new Word64(773529912,1546045734),new Word64(1294757372,1522805485),new Word64(1396182291,2643833823),new Word64(1695183700,2343527390),new Word64(1986661051,1014477480),new Word64(2177026350,1206759142),new Word64(2456956037,344077627),new Word64(2730485921,1290863460),new Word64(2820302411,3158454273),new Word64(3259730800,3505952657),new Word64(3345764771,106217008),new Word64(3516065817,3606008344),new Word64(3600352804,1432725776),new Word64(4094571909,1467031594),new Word64(275423344,851169720),new Word64(430227734,3100823752),new Word64(506948616,1363258195),new Word64(659060556,3750685593),new Word64(883997877,3785050280),new Word64(958139571,3318307427),new Word64(1322822218,3812723403),new Word64(1537002063,2003034995),new Word64(1747873779,3602036899),new Word64(1955562222,1575990012),new Word64(2024104815,1125592928),new Word64(2227730452,2716904306),new Word64(2361852424,442776044),new Word64(2428436474,593698344),new Word64(2756734187,3733110249),new Word64(3204031479,2999351573),new Word64(3329325298,3815920427),new Word64(3391569614,3928383900),new Word64(3515267271,566280711),new Word64(3940187606,3454069534),new Word64(4118630271,4000239992),new Word64(116418474,1914138554),new Word64(174292421,2731055270),new Word64(289380356,3203993006),new Word64(460393269,320620315),new Word64(685471733,587496836),new Word64(852142971,1086792851),new Word64(1017036298,365543100),new Word64(1126000580,2618297676),new Word64(1288033470,3409855158),new Word64(1501505948,4234509866),new Word64(1607167915,987167468),new Word64(1816402316,1246189591)])}};function ch(e,t,a,r,i){e.assign(t);e.and(a);i.assign(t);i.not();i.and(r);e.xor(i)}function maj(e,t,a,r,i){e.assign(t);e.and(a);i.assign(t);i.and(r);e.xor(i);i.assign(a);i.and(r);e.xor(i)}function sigma(e,t,a){e.assign(t);e.rotateRight(28);a.assign(t);a.rotateRight(34);e.xor(a);a.assign(t);a.rotateRight(39);e.xor(a)}function sigmaPrime(e,t,a){e.assign(t);e.rotateRight(14);a.assign(t);a.rotateRight(18);e.xor(a);a.assign(t);a.rotateRight(41);e.xor(a)}function littleSigma(e,t,a){e.assign(t);e.rotateRight(1);a.assign(t);a.rotateRight(8);e.xor(a);a.assign(t);a.shiftRight(7);e.xor(a)}function littleSigmaPrime(e,t,a){e.assign(t);e.rotateRight(19);a.assign(t);a.rotateRight(61);e.xor(a);a.assign(t);a.shiftRight(6);e.xor(a)}function calculateSHA512(e,t,a,r=!1){let i,n,s,o,c,l,h,u;if(r){i=new Word64(3418070365,3238371032);n=new Word64(1654270250,914150663);s=new Word64(2438529370,812702999);o=new Word64(355462360,4144912697);c=new Word64(1731405415,4290775857);l=new Word64(2394180231,1750603025);h=new Word64(3675008525,1694076839);u=new Word64(1203062813,3204075428)}else{i=new Word64(1779033703,4089235720);n=new Word64(3144134277,2227873595);s=new Word64(1013904242,4271175723);o=new Word64(2773480762,1595750129);c=new Word64(1359893119,2917565137);l=new Word64(2600822924,725511199);h=new Word64(528734635,4215389547);u=new Word64(1541459225,327033209)}const d=128*Math.ceil((a+17)/128),f=new Uint8Array(d);let g,p;for(g=0;g<a;++g)f[g]=e[t++];f[g++]=128;const m=d-16;g<m&&(g=m);g+=11;f[g++]=a>>>29&255;f[g++]=a>>21&255;f[g++]=a>>13&255;f[g++]=a>>5&255;f[g++]=a<<3&255;const b=new Array(80);for(g=0;g<80;g++)b[g]=new Word64(0,0);const{k:y}=mc;let w=new Word64(0,0),x=new Word64(0,0),S=new Word64(0,0),k=new Word64(0,0),C=new Word64(0,0),v=new Word64(0,0),F=new Word64(0,0),T=new Word64(0,0);const O=new Word64(0,0),M=new Word64(0,0),D=new Word64(0,0),R=new Word64(0,0);let N,E;for(g=0;g<d;){for(p=0;p<16;++p){b[p].high=f[g]<<24|f[g+1]<<16|f[g+2]<<8|f[g+3];b[p].low=f[g+4]<<24|f[g+5]<<16|f[g+6]<<8|f[g+7];g+=8}for(p=16;p<80;++p){N=b[p];littleSigmaPrime(N,b[p-2],R);N.add(b[p-7]);littleSigma(D,b[p-15],R);N.add(D);N.add(b[p-16])}w.assign(i);x.assign(n);S.assign(s);k.assign(o);C.assign(c);v.assign(l);F.assign(h);T.assign(u);for(p=0;p<80;++p){O.assign(T);sigmaPrime(D,C,R);O.add(D);ch(D,C,v,F,R);O.add(D);O.add(y[p]);O.add(b[p]);sigma(M,w,R);maj(D,w,x,S,R);M.add(D);N=T;T=F;F=v;v=C;k.add(O);C=k;k=S;S=x;x=w;N.assign(O);N.add(M);w=N}i.add(w);n.add(x);s.add(S);o.add(k);c.add(C);l.add(v);h.add(F);u.add(T)}if(r){E=new Uint8Array(48);i.copyTo(E,0);n.copyTo(E,8);s.copyTo(E,16);o.copyTo(E,24);c.copyTo(E,32);l.copyTo(E,40)}else{E=new Uint8Array(64);i.copyTo(E,0);n.copyTo(E,8);s.copyTo(E,16);o.copyTo(E,24);c.copyTo(E,32);l.copyTo(E,40);h.copyTo(E,48);u.copyTo(E,56)}return E}const bc={get k(){return shadow(this,"k",[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])}};function rotr(e,t){return e>>>t|e<<32-t}function calculate_sha256_ch(e,t,a){return e&t^~e&a}function calculate_sha256_maj(e,t,a){return e&t^e&a^t&a}function calculate_sha256_sigma(e){return rotr(e,2)^rotr(e,13)^rotr(e,22)}function calculate_sha256_sigmaPrime(e){return rotr(e,6)^rotr(e,11)^rotr(e,25)}function calculate_sha256_littleSigma(e){return rotr(e,7)^rotr(e,18)^e>>>3}function calculateSHA256(e,t,a){let r=1779033703,i=3144134277,n=1013904242,s=2773480762,o=1359893119,c=2600822924,l=528734635,h=1541459225;const u=64*Math.ceil((a+9)/64),d=new Uint8Array(u);let f,g;for(f=0;f<a;++f)d[f]=e[t++];d[f++]=128;const p=u-8;f<p&&(f=p);f+=3;d[f++]=a>>>29&255;d[f++]=a>>21&255;d[f++]=a>>13&255;d[f++]=a>>5&255;d[f++]=a<<3&255;const m=new Uint32Array(64),{k:b}=bc;for(f=0;f<u;){for(g=0;g<16;++g){m[g]=d[f]<<24|d[f+1]<<16|d[f+2]<<8|d[f+3];f+=4}for(g=16;g<64;++g)m[g]=(rotr(y=m[g-2],17)^rotr(y,19)^y>>>10)+m[g-7]+calculate_sha256_littleSigma(m[g-15])+m[g-16]|0;let e,t,a=r,u=i,p=n,w=s,x=o,S=c,k=l,C=h;for(g=0;g<64;++g){e=C+calculate_sha256_sigmaPrime(x)+calculate_sha256_ch(x,S,k)+b[g]+m[g];t=calculate_sha256_sigma(a)+calculate_sha256_maj(a,u,p);C=k;k=S;S=x;x=w+e|0;w=p;p=u;u=a;a=e+t|0}r=r+a|0;i=i+u|0;n=n+p|0;s=s+w|0;o=o+x|0;c=c+S|0;l=l+k|0;h=h+C|0}var y;return new Uint8Array([r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,o>>24&255,o>>16&255,o>>8&255,255&o,c>>24&255,c>>16&255,c>>8&255,255&c,l>>24&255,l>>16&255,l>>8&255,255&l,h>>24&255,h>>16&255,h>>8&255,255&h])}class DecryptStream extends DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;this.decrypt=a;this.nextChunk=null;this.initialized=!1}readBlock(){let e;if(this.initialized)e=this.nextChunk;else{e=this.str.getBytes(512);this.initialized=!0}if(!e?.length){this.eof=!0;return}this.nextChunk=this.str.getBytes(512);const t=this.nextChunk?.length>0;e=(0,this.decrypt)(e,!t);const a=this.bufferLength,r=a+e.length;this.ensureBuffer(r).set(e,a);this.bufferLength=r}}class ARCFourCipher{constructor(e){this.a=0;this.b=0;const t=new Uint8Array(256),a=e.length;for(let e=0;e<256;++e)t[e]=e;for(let r=0,i=0;r<256;++r){const n=t[r];i=i+n+e[r%a]&255;t[r]=t[i];t[i]=n}this.s=t}encryptBlock(e){let t=this.a,a=this.b;const r=this.s,i=e.length,n=new Uint8Array(i);for(let s=0;s<i;++s){t=t+1&255;const i=r[t];a=a+i&255;const o=r[a];r[t]=o;r[a]=i;n[s]=e[s]^r[i+o&255]}this.a=t;this.b=a;return n}decryptBlock(e){return this.encryptBlock(e)}encrypt(e){return this.encryptBlock(e)}}class NullCipher{decryptBlock(e){return e}encrypt(e){return e}}class AESBaseCipher{_s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);_inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);_mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);_mixCol=new Uint8Array(256).map(((e,t)=>t<128?t<<1:t<<1^27));constructor(){this.buffer=new Uint8Array(16);this.bufferPosition=0}_expandKey(e){unreachable("Cannot call `_expandKey` on the base class")}_decrypt(e,t){let a,r,i;const n=new Uint8Array(16);n.set(e);for(let e=0,a=this._keySize;e<16;++e,++a)n[e]^=t[a];for(let e=this._cyclesOfRepetition-1;e>=1;--e){a=n[13];n[13]=n[9];n[9]=n[5];n[5]=n[1];n[1]=a;a=n[14];r=n[10];n[14]=n[6];n[10]=n[2];n[6]=a;n[2]=r;a=n[15];r=n[11];i=n[7];n[15]=n[3];n[11]=a;n[7]=r;n[3]=i;for(let e=0;e<16;++e)n[e]=this._inv_s[n[e]];for(let a=0,r=16*e;a<16;++a,++r)n[a]^=t[r];for(let e=0;e<16;e+=4){const t=this._mix[n[e]],r=this._mix[n[e+1]],i=this._mix[n[e+2]],s=this._mix[n[e+3]];a=t^r>>>8^r<<24^i>>>16^i<<16^s>>>24^s<<8;n[e]=a>>>24&255;n[e+1]=a>>16&255;n[e+2]=a>>8&255;n[e+3]=255&a}}a=n[13];n[13]=n[9];n[9]=n[5];n[5]=n[1];n[1]=a;a=n[14];r=n[10];n[14]=n[6];n[10]=n[2];n[6]=a;n[2]=r;a=n[15];r=n[11];i=n[7];n[15]=n[3];n[11]=a;n[7]=r;n[3]=i;for(let e=0;e<16;++e){n[e]=this._inv_s[n[e]];n[e]^=t[e]}return n}_encrypt(e,t){const a=this._s;let r,i,n;const s=new Uint8Array(16);s.set(e);for(let e=0;e<16;++e)s[e]^=t[e];for(let e=1;e<this._cyclesOfRepetition;e++){for(let e=0;e<16;++e)s[e]=a[s[e]];n=s[1];s[1]=s[5];s[5]=s[9];s[9]=s[13];s[13]=n;n=s[2];i=s[6];s[2]=s[10];s[6]=s[14];s[10]=n;s[14]=i;n=s[3];i=s[7];r=s[11];s[3]=s[15];s[7]=n;s[11]=i;s[15]=r;for(let e=0;e<16;e+=4){const t=s[e],a=s[e+1],i=s[e+2],n=s[e+3];r=t^a^i^n;s[e]^=r^this._mixCol[t^a];s[e+1]^=r^this._mixCol[a^i];s[e+2]^=r^this._mixCol[i^n];s[e+3]^=r^this._mixCol[n^t]}for(let a=0,r=16*e;a<16;++a,++r)s[a]^=t[r]}for(let e=0;e<16;++e)s[e]=a[s[e]];n=s[1];s[1]=s[5];s[5]=s[9];s[9]=s[13];s[13]=n;n=s[2];i=s[6];s[2]=s[10];s[6]=s[14];s[10]=n;s[14]=i;n=s[3];i=s[7];r=s[11];s[3]=s[15];s[7]=n;s[11]=i;s[15]=r;for(let e=0,a=this._keySize;e<16;++e,++a)s[e]^=t[a];return s}_decryptBlock2(e,t){const a=e.length;let r=this.buffer,i=this.bufferPosition;const n=[];let s=this.iv;for(let t=0;t<a;++t){r[i]=e[t];++i;if(i<16)continue;const a=this._decrypt(r,this._key);for(let e=0;e<16;++e)a[e]^=s[e];s=r;n.push(a);r=new Uint8Array(16);i=0}this.buffer=r;this.bufferLength=i;this.iv=s;if(0===n.length)return new Uint8Array(0);let o=16*n.length;if(t){const e=n.at(-1);let t=e[15];if(t<=16){for(let a=15,r=16-t;a>=r;--a)if(e[a]!==t){t=0;break}o-=t;n[n.length-1]=e.subarray(0,16-t)}}const c=new Uint8Array(o);for(let e=0,t=0,a=n.length;e<a;++e,t+=16)c.set(n[e],t);return c}decryptBlock(e,t,a=null){const r=e.length,i=this.buffer;let n=this.bufferPosition;if(a)this.iv=a;else{for(let t=0;n<16&&t<r;++t,++n)i[n]=e[t];if(n<16){this.bufferLength=n;return new Uint8Array(0)}this.iv=i;e=e.subarray(16)}this.buffer=new Uint8Array(16);this.bufferLength=0;this.decryptBlock=this._decryptBlock2;return this.decryptBlock(e,t)}encrypt(e,t){const a=e.length;let r=this.buffer,i=this.bufferPosition;const n=[];t||=new Uint8Array(16);for(let s=0;s<a;++s){r[i]=e[s];++i;if(i<16)continue;for(let e=0;e<16;++e)r[e]^=t[e];const a=this._encrypt(r,this._key);t=a;n.push(a);r=new Uint8Array(16);i=0}this.buffer=r;this.bufferLength=i;this.iv=t;if(0===n.length)return new Uint8Array(0);const s=16*n.length,o=new Uint8Array(s);for(let e=0,t=0,a=n.length;e<a;++e,t+=16)o.set(n[e],t);return o}}class AES128Cipher extends AESBaseCipher{_rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]);constructor(e){super();this._cyclesOfRepetition=10;this._keySize=160;this._key=this._expandKey(e)}_expandKey(e){const t=this._s,a=this._rcon,r=new Uint8Array(176);r.set(e);for(let e=16,i=1;e<176;++i){let n=r[e-3],s=r[e-2],o=r[e-1],c=r[e-4];n=t[n];s=t[s];o=t[o];c=t[c];n^=a[i];for(let t=0;t<4;++t){r[e]=n^=r[e-16];e++;r[e]=s^=r[e-16];e++;r[e]=o^=r[e-16];e++;r[e]=c^=r[e-16];e++}}return r}}class AES256Cipher extends AESBaseCipher{constructor(e){super();this._cyclesOfRepetition=14;this._keySize=224;this._key=this._expandKey(e)}_expandKey(e){const t=this._s,a=new Uint8Array(240);a.set(e);let r,i,n,s,o=1;for(let e=32,c=1;e<240;++c){if(e%32==16){r=t[r];i=t[i];n=t[n];s=t[s]}else if(e%32==0){r=a[e-3];i=a[e-2];n=a[e-1];s=a[e-4];r=t[r];i=t[i];n=t[n];s=t[s];r^=o;(o<<=1)>=256&&(o=255&(27^o))}for(let t=0;t<4;++t){a[e]=r^=a[e-32];e++;a[e]=i^=a[e-32];e++;a[e]=n^=a[e-32];e++;a[e]=s^=a[e-32];e++}}return a}}class PDFBase{_hash(e,t,a){unreachable("Abstract method `_hash` called")}checkOwnerPassword(e,t,a,r){const i=new Uint8Array(e.length+56);i.set(e,0);i.set(t,e.length);i.set(a,e.length+t.length);return isArrayEqual(this._hash(e,i,a),r)}checkUserPassword(e,t,a){const r=new Uint8Array(e.length+8);r.set(e,0);r.set(t,e.length);return isArrayEqual(this._hash(e,r,[]),a)}getOwnerKey(e,t,a,r){const i=new Uint8Array(e.length+56);i.set(e,0);i.set(t,e.length);i.set(a,e.length+t.length);const n=this._hash(e,i,a);return new AES256Cipher(n).decryptBlock(r,!1,new Uint8Array(16))}getUserKey(e,t,a){const r=new Uint8Array(e.length+8);r.set(e,0);r.set(t,e.length);const i=this._hash(e,r,[]);return new AES256Cipher(i).decryptBlock(a,!1,new Uint8Array(16))}}class PDF17 extends PDFBase{_hash(e,t,a){return calculateSHA256(t,0,t.length)}}class PDF20 extends PDFBase{_hash(e,t,a){let r=calculateSHA256(t,0,t.length).subarray(0,32),i=[0],n=0;for(;n<64||i.at(-1)>n-32;){const t=e.length+r.length+a.length,l=new Uint8Array(t);let h=0;l.set(e,h);h+=e.length;l.set(r,h);h+=r.length;l.set(a,h);const u=new Uint8Array(64*t);for(let e=0,a=0;e<64;e++,a+=t)u.set(l,a);i=new AES128Cipher(r.subarray(0,16)).encrypt(u,r.subarray(16,32));const d=Math.sumPrecise(i.slice(0,16))%3;0===d?r=calculateSHA256(i,0,i.length):1===d?r=(s=i,o=0,c=i.length,calculateSHA512(s,o,c,!0)):2===d&&(r=calculateSHA512(i,0,i.length));n++}var s,o,c;return r.subarray(0,32)}}class CipherTransform{constructor(e,t){this.StringCipherConstructor=e;this.StreamCipherConstructor=t}createStream(e,t){const a=new this.StreamCipherConstructor;return new DecryptStream(e,t,(function cipherTransformDecryptStream(e,t){return a.decryptBlock(e,t)}))}decryptString(e){const t=new this.StringCipherConstructor;let a=stringToBytes(e);a=t.decryptBlock(a,!0);return bytesToString(a)}encryptString(e){const t=new this.StringCipherConstructor;if(t instanceof AESBaseCipher){const a=16-e.length%16;e+=String.fromCharCode(a).repeat(a);const r=new Uint8Array(16);crypto.getRandomValues(r);let i=stringToBytes(e);i=t.encrypt(i,r);const n=new Uint8Array(16+i.length);n.set(r);n.set(i,16);return bytesToString(n)}let a=stringToBytes(e);a=t.encrypt(a);return bytesToString(a)}}class CipherTransformFactory{static get _defaultPasswordBytes(){return shadow(this,"_defaultPasswordBytes",new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]))}#Oe(e,t,a,r,i,n,s,o,c,l,h,u){if(t){const e=Math.min(127,t.length);t=t.subarray(0,e)}else t=[];const d=6===e?new PDF20:new PDF17;return d.checkUserPassword(t,o,s)?d.getUserKey(t,c,h):t.length&&d.checkOwnerPassword(t,r,n,a)?d.getOwnerKey(t,i,n,l):null}#Me(e,t,a,r,i,n,s,o){const c=40+a.length+e.length,l=new Uint8Array(c);let h,u,d=0;if(t){u=Math.min(32,t.length);for(;d<u;++d)l[d]=t[d]}h=0;for(;d<32;)l[d++]=CipherTransformFactory._defaultPasswordBytes[h++];l.set(a,d);d+=a.length;l[d++]=255&i;l[d++]=i>>8&255;l[d++]=i>>16&255;l[d++]=i>>>24&255;l.set(e,d);d+=e.length;if(n>=4&&!o){l.fill(255,d,d+4);d+=4}let f=calculateMD5(l,0,d);const g=s>>3;if(n>=3)for(h=0;h<50;++h)f=calculateMD5(f,0,g);const p=f.subarray(0,g);let m,b;if(n>=3){d=0;l.set(CipherTransformFactory._defaultPasswordBytes,d);d+=32;l.set(e,d);d+=e.length;m=new ARCFourCipher(p);b=m.encryptBlock(calculateMD5(l,0,d));u=p.length;const t=new Uint8Array(u);for(h=1;h<=19;++h){for(let e=0;e<u;++e)t[e]=p[e]^h;m=new ARCFourCipher(t);b=m.encryptBlock(b)}}else{m=new ARCFourCipher(p);b=m.encryptBlock(CipherTransformFactory._defaultPasswordBytes)}return b.every(((e,t)=>r[t]===e))?p:null}#De(e,t,a,r){const i=new Uint8Array(32);let n=0;const s=Math.min(32,e.length);for(;n<s;++n)i[n]=e[n];let o=0;for(;n<32;)i[n++]=CipherTransformFactory._defaultPasswordBytes[o++];let c=calculateMD5(i,0,n);const l=r>>3;if(a>=3)for(o=0;o<50;++o)c=calculateMD5(c,0,c.length);let h,u;if(a>=3){u=t;const e=new Uint8Array(l);for(o=19;o>=0;o--){for(let t=0;t<l;++t)e[t]=c[t]^o;h=new ARCFourCipher(e);u=h.encryptBlock(u)}}else{h=new ARCFourCipher(c.subarray(0,l));u=h.encryptBlock(t)}return u}#Be(e,t,a,r=!1){const i=a.length,n=new Uint8Array(i+9);n.set(a);let s=i;n[s++]=255&e;n[s++]=e>>8&255;n[s++]=e>>16&255;n[s++]=255&t;n[s++]=t>>8&255;if(r){n[s++]=115;n[s++]=65;n[s++]=108;n[s++]=84}return calculateMD5(n,0,s).subarray(0,Math.min(i+5,16))}#Re(e,t,a,r,i){if(!(t instanceof Name))throw new FormatError("Invalid crypt filter name.");const n=this,s=e.get(t.name),o=s?.get("CFM");if(!o||"None"===o.name)return function(){return new NullCipher};if("V2"===o.name)return function(){return new ARCFourCipher(n.#Be(a,r,i,!1))};if("AESV2"===o.name)return function(){return new AES128Cipher(n.#Be(a,r,i,!0))};if("AESV3"===o.name)return function(){return new AES256Cipher(i)};throw new FormatError("Unknown crypto method")}constructor(e,t,a){const r=e.get("Filter");if(!isName(r,"Standard"))throw new FormatError("unknown encryption method");this.filterName=r.name;this.dict=e;const i=e.get("V");if(!Number.isInteger(i)||1!==i&&2!==i&&4!==i&&5!==i)throw new FormatError("unsupported encryption algorithm");this.algorithm=i;let n=e.get("Length");if(!n)if(i<=3)n=40;else{const t=e.get("CF"),a=e.get("StmF");if(t instanceof Dict&&a instanceof Name){t.suppressEncryption=!0;const e=t.get(a.name);n=e?.get("Length")||128;n<40&&(n<<=3)}}if(!Number.isInteger(n)||n<40||n%8!=0)throw new FormatError("invalid key length");const s=stringToBytes(e.get("O")),o=stringToBytes(e.get("U")),c=s.subarray(0,32),l=o.subarray(0,32),h=e.get("P"),u=e.get("R"),d=(4===i||5===i)&&!1!==e.get("EncryptMetadata");this.encryptMetadata=d;const f=stringToBytes(t);let g,p;if(a){if(6===u)try{a=utf8StringToString(a)}catch{warn("CipherTransformFactory: Unable to convert UTF8 encoded password.")}g=stringToBytes(a)}if(5!==i)p=this.#Me(f,g,c,l,h,u,n,d);else{const t=s.subarray(32,40),a=s.subarray(40,48),r=o.subarray(0,48),i=o.subarray(32,40),n=o.subarray(40,48),h=stringToBytes(e.get("OE")),d=stringToBytes(e.get("UE")),f=stringToBytes(e.get("Perms"));p=this.#Oe(u,g,c,t,a,r,l,i,n,h,d,f)}if(!p){if(!a)throw new PasswordException("No password given",ha);const e=this.#De(g,c,u,n);p=this.#Me(f,e,c,l,h,u,n,d)}if(!p)throw new PasswordException("Incorrect Password",ua);if(4===i&&p.length<16){this.encryptionKey=new Uint8Array(16);this.encryptionKey.set(p)}else this.encryptionKey=p;if(i>=4){const t=e.get("CF");t instanceof Dict&&(t.suppressEncryption=!0);this.cf=t;this.stmf=e.get("StmF")||Name.get("Identity");this.strf=e.get("StrF")||Name.get("Identity");this.eff=e.get("EFF")||this.stmf}}createCipherTransform(e,t){if(4===this.algorithm||5===this.algorithm)return new CipherTransform(this.#Re(this.cf,this.strf,e,t,this.encryptionKey),this.#Re(this.cf,this.stmf,e,t,this.encryptionKey));const a=this.#Be(e,t,this.encryptionKey,!1),cipherConstructor=function(){return new ARCFourCipher(a)};return new CipherTransform(cipherConstructor,cipherConstructor)}}class XRef{#Ne=null;constructor(e,t){this.stream=e;this.pdfManager=t;this.entries=[];this._xrefStms=new Set;this._cacheMap=new Map;this._pendingRefs=new RefSet;this._newPersistentRefNum=null;this._newTemporaryRefNum=null;this._persistentRefsCache=null}getNewPersistentRef(e){null===this._newPersistentRefNum&&(this._newPersistentRefNum=this.entries.length||1);const t=this._newPersistentRefNum++;this._cacheMap.set(t,e);return Ref.get(t,0)}getNewTemporaryRef(){if(null===this._newTemporaryRefNum){this._newTemporaryRefNum=this.entries.length||1;if(this._newPersistentRefNum){this._persistentRefsCache=new Map;for(let e=this._newTemporaryRefNum;e<this._newPersistentRefNum;e++){this._persistentRefsCache.set(e,this._cacheMap.get(e));this._cacheMap.delete(e)}}}return Ref.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){this._newTemporaryRefNum=null;if(this._persistentRefsCache)for(const[e,t]of this._persistentRefsCache)this._cacheMap.set(e,t);this._persistentRefsCache=null}setStartXRef(e){this.startXRefQueue=[e]}parse(e=!1){let t,a,r;if(e){warn("Indexing all PDF objects");t=this.indexObjects()}else t=this.readXRef();t.assignXref(this);this.trailer=t;try{a=t.get("Encrypt")}catch(e){if(e instanceof MissingDataException)throw e;warn(`XRef.parse - Invalid "Encrypt" reference: "${e}".`)}if(a instanceof Dict){const e=t.get("ID"),r=e?.length?e[0]:"";a.suppressEncryption=!0;this.encrypt=new CipherTransformFactory(a,r,this.pdfManager.password)}try{r=t.get("Root")}catch(e){if(e instanceof MissingDataException)throw e;warn(`XRef.parse - Invalid "Root" reference: "${e}".`)}if(r instanceof Dict)try{if(r.get("Pages")instanceof Dict){this.root=r;return}}catch(e){if(e instanceof MissingDataException)throw e;warn(`XRef.parse - Invalid "Pages" reference: "${e}".`)}if(!e)throw new XRefParseException;throw new InvalidPDFException("Invalid Root reference.")}processXRefTable(e){"tableState"in this||(this.tableState={entryNum:0,streamPos:e.lexer.stream.pos,parserBuf1:e.buf1,parserBuf2:e.buf2});if(!isCmd(this.readXRefTable(e),"trailer"))throw new FormatError("Invalid XRef table: could not find trailer dictionary");let t=e.getObj();t instanceof Dict||!t.dict||(t=t.dict);if(!(t instanceof Dict))throw new FormatError("Invalid XRef table: could not parse trailer dictionary");delete this.tableState;return t}readXRefTable(e){const t=e.lexer.stream,a=this.tableState;t.pos=a.streamPos;e.buf1=a.parserBuf1;e.buf2=a.parserBuf2;let r;for(;;){if(!("firstEntryNum"in a)||!("entryCount"in a)){if(isCmd(r=e.getObj(),"trailer"))break;a.firstEntryNum=r;a.entryCount=e.getObj()}let i=a.firstEntryNum;const n=a.entryCount;if(!Number.isInteger(i)||!Number.isInteger(n))throw new FormatError("Invalid XRef table: wrong types in subsection header");for(let r=a.entryNum;r<n;r++){a.streamPos=t.pos;a.entryNum=r;a.parserBuf1=e.buf1;a.parserBuf2=e.buf2;const s={};s.offset=e.getObj();s.gen=e.getObj();const o=e.getObj();if(o instanceof Cmd)switch(o.cmd){case"f":s.free=!0;break;case"n":s.uncompressed=!0}if(!Number.isInteger(s.offset)||!Number.isInteger(s.gen)||!s.free&&!s.uncompressed)throw new FormatError(`Invalid entry in XRef subsection: ${i}, ${n}`);0===r&&s.free&&1===i&&(i=0);this.entries[r+i]||(this.entries[r+i]=s)}a.entryNum=0;a.streamPos=t.pos;a.parserBuf1=e.buf1;a.parserBuf2=e.buf2;delete a.firstEntryNum;delete a.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new FormatError("Invalid XRef table: unexpected first object");return r}processXRefStream(e){if(!("streamState"in this)){const{dict:t,pos:a}=e,r=t.get("W"),i=t.get("Index")||[0,t.get("Size")];this.streamState={entryRanges:i,byteWidths:r,entryNum:0,streamPos:a}}this.readXRefStream(e);delete this.streamState;return e.dict}readXRefStream(e){const t=this.streamState;e.pos=t.streamPos;const[a,r,i]=t.byteWidths,n=t.entryRanges;for(;n.length>0;){const[s,o]=n;if(!Number.isInteger(s)||!Number.isInteger(o))throw new FormatError(`Invalid XRef range fields: ${s}, ${o}`);if(!Number.isInteger(a)||!Number.isInteger(r)||!Number.isInteger(i))throw new FormatError(`Invalid XRef entry fields length: ${s}, ${o}`);for(let n=t.entryNum;n<o;++n){t.entryNum=n;t.streamPos=e.pos;let o=0,c=0,l=0;for(let t=0;t<a;++t){const t=e.getByte();if(-1===t)throw new FormatError("Invalid XRef byteWidths \'type\'.");o=o<<8|t}0===a&&(o=1);for(let t=0;t<r;++t){const t=e.getByte();if(-1===t)throw new FormatError("Invalid XRef byteWidths \'offset\'.");c=c<<8|t}for(let t=0;t<i;++t){const t=e.getByte();if(-1===t)throw new FormatError("Invalid XRef byteWidths \'generation\'.");l=l<<8|t}const h={};h.offset=c;h.gen=l;switch(o){case 0:h.free=!0;break;case 1:h.uncompressed=!0;break;case 2:break;default:throw new FormatError(`Invalid XRef entry type: ${o}`)}this.entries[s+n]||(this.entries[s+n]=h)}t.entryNum=0;t.streamPos=e.pos;n.splice(0,2)}}indexObjects(){function readToken(e,t){let a="",r=e[t];for(;10!==r&&13!==r&&60!==r&&!(++t>=e.length);){a+=String.fromCharCode(r);r=e[t]}return a}function skipUntil(e,t,a){const r=a.length,i=e.length;let n=0;for(;t<i;){let i=0;for(;i<r&&e[t+i]===a[i];)++i;if(i>=r)break;t++;n++}return n}const e=/\\b(endobj|\\d+\\s+\\d+\\s+obj|xref|trailer\\s*<<)\\b/g,t=/\\b(startxref|\\d+\\s+\\d+\\s+obj)\\b/g,a=/^(\\d+)\\s+(\\d+)\\s+obj\\b/,r=new Uint8Array([116,114,97,105,108,101,114]),i=new Uint8Array([115,116,97,114,116,120,114,101,102]),n=new Uint8Array([47,88,82,101,102]);this.entries.length=0;this._cacheMap.clear();const s=this.stream;s.pos=0;const o=s.getBytes(),c=bytesToString(o),l=o.length;let h=s.start;const u=[],d=[];for(;h<l;){let f=o[h];if(9===f||10===f||13===f||32===f){++h;continue}if(37===f){do{++h;if(h>=l)break;f=o[h]}while(10!==f&&13!==f);continue}const g=readToken(o,h);let p;if(g.startsWith("xref")&&(4===g.length||/\\s/.test(g[4]))){h+=skipUntil(o,h,r);u.push(h);h+=skipUntil(o,h,i)}else if(p=a.exec(g)){const t=0|p[1],a=0|p[2],r=h+g.length;let i,u=!1;if(this.entries[t]){if(this.entries[t].gen===a)try{new Parser({lexer:new Lexer(s.makeSubStream(r))}).getObj();u=!0}catch(e){e instanceof ParserEOFException?warn(`indexObjects -- checking object (${g}): "${e}".`):u=!0}}else u=!0;u&&(this.entries[t]={offset:h-s.start,gen:a,uncompressed:!0});e.lastIndex=r;const f=e.exec(c);if(f){i=e.lastIndex+1-h;if("endobj"!==f[1]){warn(`indexObjects: Found "${f[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`);i-=f[1].length+1}}else i=l-h;const m=o.subarray(h,h+i),b=skipUntil(m,0,n);if(b<i&&m[b+5]<64){d.push(h-s.start);this._xrefStms.add(h-s.start)}h+=i}else if(g.startsWith("trailer")&&(7===g.length||/\\s/.test(g[7]))){u.push(h);const e=h+g.length;let a;t.lastIndex=e;const r=t.exec(c);if(r){a=t.lastIndex+1-h;if("startxref"!==r[1]){warn(`indexObjects: Found "${r[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`);a-=r[1].length+1}}else a=l-h;h+=a}else h+=g.length+1}for(const e of d){this.startXRefQueue.push(e);this.readXRef(!0)}const f=[];let g,p,m=!1;for(const e of u){s.pos=e;const t=new Parser({lexer:new Lexer(s),xref:this,allowStreams:!0,recoveryMode:!0});if(!isCmd(t.getObj(),"trailer"))continue;const a=t.getObj();if(a instanceof Dict){f.push(a);a.has("Encrypt")&&(m=!0)}}for(const e of[...f,"genFallback",...f]){if("genFallback"===e){if(!p)break;this._generationFallback=!0;continue}let t=!1;try{const a=e.get("Root");if(!(a instanceof Dict))continue;const r=a.get("Pages");if(!(r instanceof Dict))continue;const i=r.get("Count");Number.isInteger(i)&&(t=!0)}catch(e){p=e;continue}if(t&&(!m||e.has("Encrypt"))&&e.has("ID"))return e;g=e}if(g)return g;if(this.topDict)return this.topDict;if(!f.length)for(const[e,t]of this.entries.entries()){if(!t)continue;const a=Ref.get(e,t.gen);let r;try{r=this.fetch(a)}catch{continue}r instanceof BaseStream&&(r=r.dict);if(r instanceof Dict&&r.has("Root"))return r}throw new InvalidPDFException("Invalid PDF structure.")}readXRef(e=!1){const t=this.stream,a=new Set;for(;this.startXRefQueue.length;){try{const e=this.startXRefQueue[0];if(a.has(e)){warn("readXRef - skipping XRef table since it was already parsed.");this.startXRefQueue.shift();continue}a.add(e);t.pos=e+t.start;const r=new Parser({lexer:new Lexer(t),xref:this,allowStreams:!0});let i,n=r.getObj();if(isCmd(n,"xref")){i=this.processXRefTable(r);this.topDict||(this.topDict=i);n=i.get("XRefStm");if(Number.isInteger(n)&&!this._xrefStms.has(n)){this._xrefStms.add(n);this.startXRefQueue.push(n);this.#Ne??=n}}else{if(!Number.isInteger(n))throw new FormatError("Invalid XRef stream header");if(!(Number.isInteger(r.getObj())&&isCmd(r.getObj(),"obj")&&(n=r.getObj())instanceof BaseStream))throw new FormatError("Invalid XRef stream");i=this.processXRefStream(n);this.topDict||(this.topDict=i);if(!i)throw new FormatError("Failed to read XRef stream")}n=i.get("Prev");Number.isInteger(n)?this.startXRefQueue.push(n):n instanceof Ref&&this.startXRefQueue.push(n.num)}catch(e){if(e instanceof MissingDataException)throw e;info("(while reading XRef): "+e)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!e)throw new XRefParseException}get lastXRefStreamPos(){return this.#Ne??(this._xrefStms.size>0?Math.max(...this._xrefStms):null)}getEntry(e){const t=this.entries[e];return t&&!t.free&&t.offset?t:null}fetchIfRef(e,t=!1){return e instanceof Ref?this.fetch(e,t):e}fetch(e,t=!1){if(!(e instanceof Ref))throw new Error("ref object is not a reference");const a=e.num,r=this._cacheMap.get(a);if(void 0!==r){r instanceof Dict&&!r.objId&&(r.objId=e.toString());return r}let i=this.getEntry(a);if(null===i)return i;if(this._pendingRefs.has(e)){this._pendingRefs.remove(e);warn(`Ignoring circular reference: ${e}.`);return ya}this._pendingRefs.put(e);try{i=i.uncompressed?this.fetchUncompressed(e,i,t):this.fetchCompressed(e,i,t);this._pendingRefs.remove(e)}catch(t){this._pendingRefs.remove(e);throw t}i instanceof Dict?i.objId=e.toString():i instanceof BaseStream&&(i.dict.objId=e.toString());return i}fetchUncompressed(e,t,a=!1){const r=e.gen;let i=e.num;if(t.gen!==r){const n=`Inconsistent generation in XRef: ${e}`;if(this._generationFallback&&t.gen<r){warn(n);return this.fetchUncompressed(Ref.get(i,t.gen),t,a)}throw new XRefEntryException(n)}const n=this.stream.makeSubStream(t.offset+this.stream.start),s=new Parser({lexer:new Lexer(n),xref:this,allowStreams:!0}),o=s.getObj(),c=s.getObj(),l=s.getObj();if(o!==i||c!==r||!(l instanceof Cmd))throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`);if("obj"!==l.cmd){if(l.cmd.startsWith("obj")){i=parseInt(l.cmd.substring(3),10);if(!Number.isNaN(i))return i}throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`)}(t=this.encrypt&&!a?s.getObj(this.encrypt.createCipherTransform(i,r)):s.getObj())instanceof BaseStream||this._cacheMap.set(i,t);return t}fetchCompressed(e,t,a=!1){const r=t.offset,i=this.fetch(Ref.get(r,0));if(!(i instanceof BaseStream))throw new FormatError("bad ObjStm stream");const n=i.dict.get("First"),s=i.dict.get("N");if(!Number.isInteger(n)||!Number.isInteger(s))throw new FormatError("invalid first and n parameters for ObjStm stream");let o=new Parser({lexer:new Lexer(i),xref:this,allowStreams:!0});const c=new Array(s),l=new Array(s);for(let e=0;e<s;++e){const t=o.getObj();if(!Number.isInteger(t))throw new FormatError(`invalid object number in the ObjStm stream: ${t}`);const a=o.getObj();if(!Number.isInteger(a))throw new FormatError(`invalid object offset in the ObjStm stream: ${a}`);c[e]=t;const i=this.getEntry(t);i?.offset===r&&i.gen!==e&&(i.gen=e);l[e]=a}const h=(i.start||0)+n,u=new Array(s);for(let e=0;e<s;++e){const t=e<s-1?l[e+1]-l[e]:void 0;if(t<0)throw new FormatError("Invalid offset in the ObjStm stream.");o=new Parser({lexer:new Lexer(i.makeSubStream(h+l[e],t,i.dict)),xref:this,allowStreams:!0});const a=o.getObj();u[e]=a;if(a instanceof BaseStream)continue;const n=c[e],d=this.entries[n];d&&d.offset===r&&d.gen===e&&this._cacheMap.set(n,a)}if(void 0===(t=u[t.gen]))throw new XRefEntryException(`Bad (compressed) XRef entry: ${e}`);return t}async fetchIfRefAsync(e,t){return e instanceof Ref?this.fetchAsync(e,t):e}async fetchAsync(e,t){try{return this.fetch(e,t)}catch(a){if(!(a instanceof MissingDataException))throw a;await this.pdfManager.requestRange(a.begin,a.end);return this.fetchAsync(e,t)}}getCatalogObj(){return this.root}}const yc=[0,0,612,792];class Page{#Ee=null;constructor({pdfManager:e,xref:t,pageIndex:a,pageDict:r,ref:i,globalIdFactory:n,fontCache:s,builtInCMapCache:o,standardFontDataCache:c,globalColorSpaceCache:l,globalImageCache:h,systemFontCache:u,nonBlendModesSet:d,xfaFactory:f}){this.pdfManager=e;this.pageIndex=a;this.pageDict=r;this.xref=t;this.ref=i;this.fontCache=s;this.builtInCMapCache=o;this.standardFontDataCache=c;this.globalColorSpaceCache=l;this.globalImageCache=h;this.systemFontCache=u;this.nonBlendModesSet=d;this.evaluatorOptions=e.evaluatorOptions;this.xfaFactory=f;const g={obj:0};this._localIdFactory=class extends n{static createObjId(){return`p${a}_${++g.obj}`}static getPageObjId(){return`p${i.toString()}`}}}#Pe(e){return new PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions})}#Le(e,t=!1){const a=getInheritableProperty({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(a)?1!==a.length&&a[0]instanceof Dict?Dict.merge({xref:this.xref,dictArray:a}):a[0]:a}get content(){return this.pageDict.getArray("Contents")}get resources(){const e=this.#Le("Resources");return shadow(this,"resources",e instanceof Dict?e:Dict.empty)}#je(e){if(this.xfaData)return this.xfaData.bbox;const t=lookupNormalRect(this.#Le(e,!0),null);if(t){if(t[2]-t[0]>0&&t[3]-t[1]>0)return t;warn(`Empty, or invalid, /${e} entry.`)}return null}get mediaBox(){return shadow(this,"mediaBox",this.#je("MediaBox")||yc)}get cropBox(){return shadow(this,"cropBox",this.#je("CropBox")||this.mediaBox)}get userUnit(){const e=this.pageDict.get("UserUnit");return shadow(this,"userUnit","number"==typeof e&&e>0?e:1)}get view(){const{cropBox:e,mediaBox:t}=this;if(e!==t&&!isArrayEqual(e,t)){const a=Util.intersect(e,t);if(a&&a[2]-a[0]>0&&a[3]-a[1]>0)return shadow(this,"view",a);warn("Empty /CropBox and /MediaBox intersection.")}return shadow(this,"view",t)}get rotate(){let e=this.#Le("Rotate")||0;e%90!=0?e=0:e>=360?e%=360:e<0&&(e=(e%360+360)%360);return shadow(this,"rotate",e)}#_e(e,t){if(!this.evaluatorOptions.ignoreErrors)throw e;warn(`getContentStream - ignoring sub-stream (${t}): "${e}".`)}async getContentStream(){const e=await this.pdfManager.ensure(this,"content");return e instanceof BaseStream?e:Array.isArray(e)?new StreamsSequenceStream(e,this.#_e.bind(this)):new NullStream}get xfaData(){return shadow(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async#Ue(e,t,a){const r=[];for(const i of e)if(i.id){const e=Ref.fromString(i.id);if(!e){warn(`A non-linked annotation cannot be modified: ${i.id}`);continue}if(i.deleted){t.put(e,e);if(i.popupRef){const e=Ref.fromString(i.popupRef);e&&t.put(e,e)}continue}if(i.popup?.deleted){const e=Ref.fromString(i.popupRef);e&&t.put(e,e)}a?.put(e);i.ref=e;r.push(this.xref.fetchAsync(e).then((e=>{e instanceof Dict&&(i.oldAnnotation=e.clone())}),(()=>{warn(`Cannot fetch \\`oldAnnotation\\` for: ${e}.`)})));delete i.id}await Promise.all(r)}async saveNewAnnotations(e,t,a,r,i){if(this.xfaFactory)throw new Error("XFA: Cannot save new annotations.");const n=this.#Pe(e),s=new RefSetCache,o=new RefSet;await this.#Ue(a,s,o);const c=this.pageDict,l=this.annotations.filter((e=>!(e instanceof Ref&&s.has(e)))),h=await AnnotationFactory.saveNewAnnotations(n,t,a,r,i);for(const{ref:e}of h.annotations)e instanceof Ref&&!o.has(e)&&l.push(e);const u=c.clone();u.set("Annots",l);i.put(this.ref,{data:u});for(const e of s)i.put(e,{data:null})}async save(e,t,a,r){const i=this.#Pe(e),n=await this._parsedAnnotations,s=[];for(const e of n)s.push(e.save(i,t,a,r).catch((function(e){warn(`save - ignoring annotation data during "${t.name}" task: "${e}".`);return null})));return Promise.all(s)}async loadResources(e){await(this.#Ee??=this.pdfManager.ensure(this,"resources"));await ObjectLoader.load(this.resources,e,this.xref)}async#Xe(e,t){const a=e?.get("Resources");if(!(a instanceof Dict&&a.size))return this.resources;await ObjectLoader.load(a,t,this.xref);return Dict.merge({xref:this.xref,dictArray:[a,this.resources],mergeSubDicts:!0})}async getOperatorList({handler:e,sink:t,task:a,intent:r,cacheKey:i,annotationStorage:c=null,modifiedIds:d=null}){const g=this.getContentStream(),p=this.loadResources(Ia),m=this.#Pe(e),b=this.xfaFactory?null:getNewAnnotationsMap(c),y=b?.get(this.pageIndex);let w=Promise.resolve(null),x=null;if(y){const e=this.pdfManager.ensureDoc("annotationGlobals");let t;const r=new Set;for(const{bitmapId:e,bitmap:t}of y)!e||t||r.has(e)||r.add(e);const{isOffscreenCanvasSupported:i}=this.evaluatorOptions;if(r.size>0){const e=y.slice();for(const[t,a]of c)t.startsWith(f)&&a.bitmap&&r.has(a.bitmapId)&&e.push(a);t=AnnotationFactory.generateImages(e,this.xref,i)}else t=AnnotationFactory.generateImages(y,this.xref,i);x=new RefSet;w=Promise.all([e,this.#Ue(y,x,null)]).then((([e])=>e?AnnotationFactory.printNewAnnotations(e,m,a,y,t):null))}const S=Promise.all([g,p]).then((async([n])=>{const s=await this.#Xe(n.dict,Ia),o=new OperatorList(r,t);e.send("StartRenderPage",{transparency:m.hasBlendModes(s,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:i});await m.getOperatorList({stream:n,task:a,resources:s,operatorList:o});return o}));let[k,C,v]=await Promise.all([S,this._parsedAnnotations,w]);if(v){C=C.filter((e=>!(e.ref&&x.has(e.ref))));for(let e=0,t=v.length;e<t;e++){const a=v[e];if(a.refToReplace){const r=C.findIndex((e=>e.ref&&isRefsEqual(e.ref,a.refToReplace)));if(r>=0){C.splice(r,1,a);v.splice(e--,1);t--}}}C=C.concat(v)}if(0===C.length||r&h){k.flush(!0);return{length:k.totalLength}}const F=!!(r&l),T=!!(r&u),O=!!(r&n),M=!!(r&s),D=!!(r&o),R=[];for(const e of C)(O||M&&e.mustBeViewed(c,F)&&e.mustBeViewedWhenEditing(T,d)||D&&e.mustBePrinted(c))&&R.push(e.getOperatorList(m,a,r,c).catch((function(e){warn(`getOperatorList - ignoring annotation data during "${a.name}" task: "${e}".`);return{opList:null,separateForm:!1,separateCanvas:!1}})));const N=await Promise.all(R);let E=!1,L=!1;for(const{opList:e,separateForm:t,separateCanvas:a}of N){k.addOpList(e);E||=t;L||=a}k.flush(!0,{form:E,canvas:L});return{length:k.totalLength}}async extractTextContent({handler:e,task:t,includeMarkedContent:a,disableNormalization:r,sink:i,intersector:n=null}){const s=this.getContentStream(),o=this.loadResources(Ta),c=this.pdfManager.ensureCatalog("lang"),[l,,h]=await Promise.all([s,o,c]),u=await this.#Xe(l.dict,Ta);return this.#Pe(e).getTextContent({stream:l,task:t,resources:u,includeMarkedContent:a,disableNormalization:r,sink:i,viewBox:this.view,lang:h,intersector:n})}async getStructTree(){const e=await this.pdfManager.ensureCatalog("structTreeRoot");if(!e)return null;await this._parsedAnnotations;try{const t=await this.pdfManager.ensure(this,"_parseStructTree",[e]);return await this.pdfManager.ensure(t,"serializable")}catch(e){warn(`getStructTree: "${e}".`);return null}}_parseStructTree(e){const t=new StructTreePage(e,this.pageDict);t.parse(this.ref);return t}async getAnnotationsData(e,t,a){const r=await this._parsedAnnotations;if(0===r.length)return r;const i=[],c=[];let l;const h=!!(a&n),u=!!(a&s),d=!!(a&o),f=[];for(const a of r){const r=h||u&&a.viewable;(r||d&&a.printable)&&i.push(a.data);if(a.hasTextContent&&r){l??=this.#Pe(e);c.push(a.extractTextContent(l,t,[-1/0,-1/0,1/0,1/0]).catch((function(e){warn(`getAnnotationsData - ignoring textContent during "${t.name}" task: "${e}".`)})))}else a.overlaysTextContent&&r&&f.push(a)}if(f.length>0){const a=new Intersector(f);c.push(this.extractTextContent({handler:e,task:t,includeMarkedContent:!1,disableNormalization:!1,sink:null,viewBox:this.view,lang:null,intersector:a}).then((()=>{a.setText()})))}await Promise.all(c);return i}get annotations(){const e=this.#Le("Annots");return shadow(this,"annotations",Array.isArray(e)?e:[])}get _parsedAnnotations(){return shadow(this,"_parsedAnnotations",this.pdfManager.ensure(this,"annotations").then((async e=>{if(0===e.length)return e;const[t,a]=await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"),this.pdfManager.ensureDoc("fieldObjects")]);if(!t)return[];const r=a?.orphanFields,i=[];for(const a of e)i.push(AnnotationFactory.create(this.xref,a,t,this._localIdFactory,!1,r,this.ref).catch((function(e){warn(`_parsedAnnotations: "${e}".`);return null})));const n=[];let s,o;for(const e of await Promise.all(i))e&&(e instanceof WidgetAnnotation?(o||=[]).push(e):e instanceof PopupAnnotation?(s||=[]).push(e):n.push(e));o&&n.push(...o);s&&n.push(...s);return n})))}get jsActions(){return shadow(this,"jsActions",collectActions(this.xref,this.pageDict,xe))}}const wc=new Uint8Array([37,80,68,70,45]),xc=new Uint8Array([115,116,97,114,116,120,114,101,102]),Sc=new Uint8Array([101,110,100,111,98,106]);function find(e,t,a=1024,r=!1){const i=t.length,n=e.peekBytes(a),s=n.length-i;if(s<=0)return!1;if(r){const a=i-1;let r=n.length-1;for(;r>=a;){let s=0;for(;s<i&&n[r-s]===t[a-s];)s++;if(s>=i){e.pos+=r-a;return!0}r--}}else{let a=0;for(;a<=s;){let r=0;for(;r<i&&n[a+r]===t[r];)r++;if(r>=i){e.pos+=a;return!0}a++}}return!1}class PDFDocument{#qe=new Map;#He=null;constructor(e,t){if(t.length<=0)throw new InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=e;this.stream=t;this.xref=new XRef(t,e);const a={font:0};this._globalIdFactory=class{static getDocId(){return`g_${e.docId}`}static createFontId(){return"f"+ ++a.font}static createObjId(){unreachable("Abstract method `createObjId` called.")}static getPageObjId(){unreachable("Abstract method `getPageObjId` called.")}}}parse(e){this.xref.parse(e);this.catalog=new Catalog(this.pdfManager,this.xref)}get linearization(){let e=null;try{e=Linearization.create(this.stream)}catch(e){if(e instanceof MissingDataException)throw e;info(e)}return shadow(this,"linearization",e)}get startXRef(){const e=this.stream;let t=0;if(this.linearization){e.reset();if(find(e,Sc)){e.skip(6);let a=e.peekByte();for(;isWhiteSpace(a);){e.pos++;a=e.peekByte()}t=e.pos-e.start}}else{const a=1024,r=xc.length;let i=!1,n=e.end;for(;!i&&n>0;){n-=a-r;n<0&&(n=0);e.pos=n;i=find(e,xc,a,!0)}if(i){e.skip(9);let a;do{a=e.getByte()}while(isWhiteSpace(a));let r="";for(;a>=32&&a<=57;){r+=String.fromCharCode(a);a=e.getByte()}t=parseInt(r,10);isNaN(t)&&(t=0)}}return shadow(this,"startXRef",t)}checkHeader(){const e=this.stream;e.reset();if(!find(e,wc))return;e.moveStart();e.skip(wc.length);let t,a="";for(;(t=e.getByte())>32&&a.length<7;)a+=String.fromCharCode(t);Ca.test(a)?this.#He=a:warn(`Invalid PDF header version: ${a}`)}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){let e=0;e=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():this.linearization?this.linearization.numPages:this.catalog.numPages;return shadow(this,"numPages",e)}#We(e,t=0){return!!Array.isArray(e)&&e.every((e=>{if(!((e=this.xref.fetchIfRef(e))instanceof Dict))return!1;if(e.has("Kids")){if(++t>10){warn("#hasOnlyDocumentSignatures: maximum recursion depth reached");return!1}return this.#We(e.get("Kids"),t)}const a=isName(e.get("FT"),"Sig"),r=e.get("Rect"),i=Array.isArray(r)&&r.every((e=>0===e));return a&&i}))}#ze(e,t,a=new RefSet){if(Array.isArray(e))for(let r of e){if(r instanceof Ref){if(a.has(r))continue;a.put(r)}r=this.xref.fetchIfRef(r);if(!(r instanceof Dict))continue;if(r.has("Kids")){this.#ze(r.get("Kids"),t,a);continue}if(!isName(r.get("FT"),"Sig"))continue;const e=r.get("V");if(!(e instanceof Dict))continue;const i=e.get("SubFilter");i instanceof Name&&t.add(i.name)}}get _xfaStreams(){const{acroForm:e}=this.catalog;if(!e)return null;const t=e.get("XFA"),a=new Map(["xdp:xdp","template","datasets","config","connectionSet","localeSet","stylesheet","/xdp:xdp"].map((e=>[e,null])));if(t instanceof BaseStream&&!t.isEmpty){a.set("xdp:xdp",t);return a}if(!Array.isArray(t)||0===t.length)return null;for(let e=0,r=t.length;e<r;e+=2){let i;i=0===e?"xdp:xdp":e===r-2?"/xdp:xdp":t[e];if(!a.has(i))continue;const n=this.xref.fetchIfRef(t[e+1]);n instanceof BaseStream&&!n.isEmpty&&a.set(i,n)}return a}get xfaDatasets(){const e=this._xfaStreams;if(!e)return shadow(this,"xfaDatasets",null);for(const t of["datasets","xdp:xdp"]){const a=e.get(t);if(a)try{const e=stringToUTF8String(a.getString());return shadow(this,"xfaDatasets",new DatasetReader({[t]:e}))}catch{warn("XFA - Invalid utf-8 string.");break}}return shadow(this,"xfaDatasets",null)}get xfaData(){const e=this._xfaStreams;if(!e)return null;const t=Object.create(null);for(const[a,r]of e)if(r)try{t[a]=stringToUTF8String(r.getString())}catch{warn("XFA - Invalid utf-8 string.");return null}return t}get xfaFactory(){let e;this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&(e=this.xfaData);return shadow(this,"xfaFactory",e?new XFAFactory(e):null)}get isPureXfa(){return!!this.xfaFactory&&this.xfaFactory.isValid()}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}async#$e(){const e=await this.pdfManager.ensureCatalog("xfaImages");e&&this.xfaFactory.setImages(e)}async#Ge(e,t){const a=await this.pdfManager.ensureCatalog("acroForm");if(!a)return;const r=await a.getAsync("DR");if(!(r instanceof Dict))return;await ObjectLoader.load(r,["Font"],this.xref);const i=r.get("Font");if(!(i instanceof Dict))return;const n=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions,{useSystemFonts:!1}),{builtInCMapCache:s,fontCache:o,standardFontDataCache:c}=this.catalog,l=new PartialEvaluator({xref:this.xref,handler:e,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:o,builtInCMapCache:s,standardFontDataCache:c,options:n}),h=new OperatorList,u=[],d={get font(){return u.at(-1)},set font(e){u.push(e)},clone(){return this}},parseFont=(e,a,i)=>l.handleSetFont(r,[Name.get(e),1],null,h,t,d,a,i).catch((e=>{warn(`loadXfaFonts: "${e}".`);return null})),f=[];for(const[e,t]of i){const a=t.get("FontDescriptor");if(!(a instanceof Dict))continue;let r=a.get("FontFamily");r=r.replaceAll(/[ ]+(\\d)/g,"$1");const i={fontFamily:r,fontWeight:a.get("FontWeight"),italicAngle:-a.get("ItalicAngle")};validateCSSFont(i)&&f.push(parseFont(e,null,i))}await Promise.all(f);const g=this.xfaFactory.setFonts(u);if(!g)return;n.ignoreErrors=!0;f.length=0;u.length=0;const p=new Set;for(const e of g)getXfaFontName(`${e}-Regular`)||p.add(e);p.size&&g.push("PdfJS-Fallback");for(const e of g)if(!p.has(e))for(const t of[{name:"Regular",fontWeight:400,italicAngle:0},{name:"Bold",fontWeight:700,italicAngle:0},{name:"Italic",fontWeight:400,italicAngle:12},{name:"BoldItalic",fontWeight:700,italicAngle:12}]){const a=`${e}-${t.name}`;f.push(parseFont(a,getXfaFontDict(a),{fontFamily:e,fontWeight:t.fontWeight,italicAngle:t.italicAngle}))}await Promise.all(f);this.xfaFactory.appendFonts(u,p)}loadXfaResources(e,t){return Promise.all([this.#Ge(e,t).catch((()=>{})),this.#$e()])}serializeXfaData(e){return this.xfaFactory?this.xfaFactory.serializeData(e):null}get version(){return this.catalog.version||this.#He}get formInfo(){const e={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},{acroForm:t}=this.catalog;if(!t)return shadow(this,"formInfo",e);try{const a=t.get("Fields"),r=Array.isArray(a)&&a.length>0;e.hasFields=r;const i=t.get("XFA");e.hasXfa=Array.isArray(i)&&i.length>0||i instanceof BaseStream&&!i.isEmpty;const n=!!(1&t.get("SigFlags")),s=n&&this.#We(a);e.hasAcroForm=r&&!s;e.hasSignatures=n}catch(e){if(e instanceof MissingDataException)throw e;warn(`Cannot fetch form information: "${e}".`)}return shadow(this,"formInfo",e)}get documentInfo(){const{catalog:e,formInfo:t,xref:a}=this,r={PDFFormatVersion:this.version,Language:e.lang,EncryptFilterName:a.encrypt?.filterName??null,IsLinearized:!!this.linearization,IsAcroFormPresent:t.hasAcroForm,IsXFAPresent:t.hasXfa,IsCollectionPresent:!!e.collection,IsSignaturesPresent:t.hasSignatures};let i;try{i=a.trailer.get("Info")}catch(e){if(e instanceof MissingDataException)throw e;info("The document information dictionary is invalid.")}if(!(i instanceof Dict))return shadow(this,"documentInfo",r);for(const[e,t]of i){switch(e){case"Title":case"Author":case"Subject":case"Keywords":case"Creator":case"Producer":case"CreationDate":case"ModDate":if("string"==typeof t){r[e]=stringToPDFString(t);continue}break;case"Trapped":if(t instanceof Name){r[e]=t;continue}break;default:let a;switch(typeof t){case"string":a=stringToPDFString(t);break;case"number":case"boolean":a=t;break;default:t instanceof Name&&(a=t)}if(void 0===a){warn(`Bad value, for custom key "${e}", in Info: ${t}.`);continue}r.Custom??=Object.create(null);r.Custom[e]=a;continue}warn(`Bad value, for key "${e}", in Info: ${t}.`)}return shadow(this,"documentInfo",r)}get fingerprints(){const e="\\0".repeat(16);function validate(t){return"string"==typeof t&&16===t.length&&t!==e}const t=this.xref.trailer.get("ID");let a,r;if(Array.isArray(t)&&validate(t[0])){a=stringToBytes(t[0]);t[1]!==t[0]&&validate(t[1])&&(r=stringToBytes(t[1]))}else a=calculateMD5(this.stream.getByteRange(0,1024),0,1024);return shadow(this,"fingerprints",[toHexUtil(a),r?toHexUtil(r):null])}async#Ve(e){const{catalog:t,linearization:a,xref:r}=this,i=Ref.get(a.objectNumberFirst,0);try{const e=await r.fetchAsync(i);if(e instanceof Dict){let a=e.getRaw("Type");a instanceof Ref&&(a=await r.fetchAsync(a));if(isName(a,"Page")||!e.has("Type")&&!e.has("Kids")&&e.has("Contents")){t.pageKidsCountCache.has(i)||t.pageKidsCountCache.put(i,1);t.pageIndexCache.has(i)||t.pageIndexCache.put(i,0);return[e,i]}}throw new FormatError("The Linearization dictionary doesn\'t point to a valid Page dictionary.")}catch(a){warn(`_getLinearizationPage: "${a.message}".`);return t.getPageDict(e)}}getPage(e){const t=this.#qe.get(e);if(t)return t;const{catalog:a,linearization:r,xfaFactory:i}=this;let n;n=i?Promise.resolve([Dict.empty,null]):r?.pageFirst===e?this.#Ve(e):a.getPageDict(e);n=n.then((([t,r])=>new Page({pdfManager:this.pdfManager,xref:this.xref,pageIndex:e,pageDict:t,ref:r,globalIdFactory:this._globalIdFactory,fontCache:a.fontCache,builtInCMapCache:a.builtInCMapCache,standardFontDataCache:a.standardFontDataCache,globalColorSpaceCache:a.globalColorSpaceCache,globalImageCache:a.globalImageCache,systemFontCache:a.systemFontCache,nonBlendModesSet:a.nonBlendModesSet,xfaFactory:i})));this.#qe.set(e,n);return n}async checkFirstPage(e=!1){if(!e)try{await this.getPage(0)}catch(e){if(e instanceof XRefEntryException){this.#qe.delete(0);await this.cleanup();throw new XRefParseException}}}async checkLastPage(e=!1){const{catalog:t,pdfManager:a}=this;t.setActualNumPages();let r;try{await Promise.all([a.ensureDoc("xfaFactory"),a.ensureDoc("linearization"),a.ensureCatalog("numPages")]);if(this.xfaFactory)return;r=this.linearization?this.linearization.numPages:t.numPages;if(!Number.isInteger(r))throw new FormatError("Page count is not an integer.");if(r<=1)return;await this.getPage(r-1)}catch(i){this.#qe.delete(r-1);await this.cleanup();if(i instanceof XRefEntryException&&!e)throw new XRefParseException;warn(`checkLastPage - invalid /Pages tree /Count: ${r}.`);let n;try{n=await t.getAllPageDicts(e)}catch(a){if(a instanceof XRefEntryException&&!e)throw new XRefParseException;t.setActualNumPages(1);return}for(const[e,[r,i]]of n){let n;if(r instanceof Error){n=Promise.reject(r);n.catch((()=>{}))}else n=Promise.resolve(new Page({pdfManager:a,xref:this.xref,pageIndex:e,pageDict:r,ref:i,globalIdFactory:this._globalIdFactory,fontCache:t.fontCache,builtInCMapCache:t.builtInCMapCache,standardFontDataCache:t.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:t.globalImageCache,systemFontCache:t.systemFontCache,nonBlendModesSet:t.nonBlendModesSet,xfaFactory:null}));this.#qe.set(e,n)}t.setActualNumPages(n.size)}}async fontFallback(e,t){const{catalog:a,pdfManager:r}=this;for(const i of await Promise.all(a.fontCache))if(i.loadedName===e){i.fallback(t,r.evaluatorOptions);return}}async cleanup(e=!1){return this.catalog?this.catalog.cleanup(e):clearGlobalCaches()}async#Ke(e,t,a,r,i,n,s){const{xref:o}=this;if(!(a instanceof Ref)||n.has(a))return;n.put(a);const c=await o.fetchAsync(a);if(!(c instanceof Dict))return;let l=await c.getAsync("Subtype");l=l instanceof Name?l.name:null;if("Link"===l)return;if(c.has("T")){const t=stringToPDFString(await c.getAsync("T"));e=""===e?t:`${e}.${t}`}else{let a=c;for(;;){a=a.getRaw("Parent")||t;if(a instanceof Ref){if(n.has(a))break;a=await o.fetchAsync(a)}if(!(a instanceof Dict))break;if(a.has("T")){const t=stringToPDFString(await a.getAsync("T"));e=""===e?t:`${e}.${t}`;break}}}t&&!c.has("Parent")&&isName(c.get("Subtype"),"Widget")&&s.put(a,t);r.has(e)||r.set(e,[]);r.get(e).push(AnnotationFactory.create(o,a,i,null,!0,s,null).then((e=>e?.getFieldObject())).catch((function(e){warn(`#collectFieldObjects: "${e}".`);return null})));if(!c.has("Kids"))return;const h=await c.getAsync("Kids");if(Array.isArray(h))for(const t of h)await this.#Ke(e,a,t,r,i,n,s)}get fieldObjects(){return shadow(this,"fieldObjects",this.pdfManager.ensureDoc("formInfo").then((async e=>{if(!e.hasFields)return null;const t=await this.annotationGlobals;if(!t)return null;const{acroForm:a}=t,r=new RefSet,i=Object.create(null),n=new Map,s=new RefSetCache;for(const e of a.get("Fields"))await this.#Ke("",null,e,n,t,r,s);const o=[];for(const[e,t]of n)o.push(Promise.all(t).then((t=>{(t=t.filter((e=>!!e))).length>0&&(i[e]=t)})));await Promise.all(o);return{allFields:objectSize(i)>0?i:null,orphanFields:s}})))}get hasJSActions(){return shadow(this,"hasJSActions",this.pdfManager.ensureDoc("_parseHasJSActions"))}async _parseHasJSActions(){const[e,t]=await Promise.all([this.pdfManager.ensureCatalog("jsActions"),this.pdfManager.ensureDoc("fieldObjects")]);return!!e||!!t?.allFields&&Object.values(t.allFields).some((e=>e.some((e=>null!==e.actions))))}get calculationOrderIds(){const e=this.catalog.acroForm?.get("CO");if(!Array.isArray(e)||0===e.length)return shadow(this,"calculationOrderIds",null);const t=[];for(const a of e)a instanceof Ref&&t.push(a.toString());return shadow(this,"calculationOrderIds",t.length?t:null)}get annotationGlobals(){return shadow(this,"annotationGlobals",AnnotationFactory.createGlobals(this.pdfManager))}}class BasePdfManager{constructor({docBaseUrl:e,docId:t,enableXfa:a,evaluatorOptions:r,handler:i,password:n}){this._docBaseUrl=function parseDocBaseUrl(e){if(e){const t=createValidAbsoluteUrl(e);if(t)return t.href;warn(`Invalid absolute docBaseUrl: "${e}".`)}return null}(e);this._docId=t;this._password=n;this.enableXfa=a;r.isOffscreenCanvasSupported&&=FeatureTest.isOffscreenCanvasSupported;r.isImageDecoderSupported&&=FeatureTest.isImageDecoderSupported;this.evaluatorOptions=Object.freeze(r);ImageResizer.setOptions(r);JpegStream.setOptions(r);OperatorList.setOptions(r);const s={...r,handler:i};JpxImage.setOptions(s);IccColorSpace.setOptions(s);CmykICCBasedCS.setOptions(s)}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){return this._docBaseUrl}ensureDoc(e,t){return this.ensure(this.pdfDocument,e,t)}ensureXRef(e,t){return this.ensure(this.pdfDocument.xref,e,t)}ensureCatalog(e,t){return this.ensure(this.pdfDocument.catalog,e,t)}getPage(e){return this.pdfDocument.getPage(e)}fontFallback(e,t){return this.pdfDocument.fontFallback(e,t)}cleanup(e=!1){return this.pdfDocument.cleanup(e)}async ensure(e,t,a){unreachable("Abstract method `ensure` called")}requestRange(e,t){unreachable("Abstract method `requestRange` called")}requestLoadedStream(e=!1){unreachable("Abstract method `requestLoadedStream` called")}sendProgressiveData(e){unreachable("Abstract method `sendProgressiveData` called")}updatePassword(e){this._password=e}terminate(e){unreachable("Abstract method `terminate` called")}}class LocalPdfManager extends BasePdfManager{constructor(e){super(e);const t=new Stream(e.source);this.pdfDocument=new PDFDocument(this,t);this._loadedStreamPromise=Promise.resolve(t)}async ensure(e,t,a){const r=e[t];return"function"==typeof r?r.apply(e,a):r}requestRange(e,t){return Promise.resolve()}requestLoadedStream(e=!1){return this._loadedStreamPromise}terminate(e){}}class NetworkPdfManager extends BasePdfManager{constructor(e){super(e);this.streamManager=new ChunkedStreamManager(e.source,{msgHandler:e.handler,length:e.length,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize});this.pdfDocument=new PDFDocument(this,this.streamManager.getStream())}async ensure(e,t,a){try{const r=e[t];return"function"==typeof r?r.apply(e,a):r}catch(r){if(!(r instanceof MissingDataException))throw r;await this.requestRange(r.begin,r.end);return this.ensure(e,t,a)}}requestRange(e,t){return this.streamManager.requestRange(e,t)}requestLoadedStream(e=!1){return this.streamManager.requestAllChunks(e)}sendProgressiveData(e){this.streamManager.onReceiveData({chunk:e})}terminate(e){this.streamManager.abort(e)}}const Ac=1,kc=2,Cc=1,vc=2,Fc=3,Ic=4,Tc=5,Oc=6,Mc=7,Dc=8;function onFn(){}function wrapReason(e){if(e instanceof AbortException||e instanceof InvalidPDFException||e instanceof PasswordException||e instanceof ResponseException||e instanceof UnknownErrorException)return e;e instanceof Error||"object"==typeof e&&null!==e||unreachable(\'wrapReason: Expected "reason" to be a (possibly cloned) Error.\');switch(e.name){case"AbortException":return new AbortException(e.message);case"InvalidPDFException":return new InvalidPDFException(e.message);case"PasswordException":return new PasswordException(e.message,e.code);case"ResponseException":return new ResponseException(e.message,e.status,e.missing);case"UnknownErrorException":return new UnknownErrorException(e.message,e.details)}return new UnknownErrorException(e.message,e.toString())}class MessageHandler{#Je=new AbortController;constructor(e,t,a){this.sourceName=e;this.targetName=t;this.comObj=a;this.callbackId=1;this.streamId=1;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);a.addEventListener("message",this.#Ye.bind(this),{signal:this.#Je.signal})}#Ye({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#Ze(e);return}if(e.callback){const t=e.callbackId,a=this.callbackCapabilities[t];if(!a)throw new Error(`Cannot resolve callback ${t}`);delete this.callbackCapabilities[t];if(e.callback===Ac)a.resolve(e.data);else{if(e.callback!==kc)throw new Error("Unexpected callback case");a.reject(wrapReason(e.reason))}return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const a=this.sourceName,r=e.sourceName,i=this.comObj;Promise.try(t,e.data).then((function(t){i.postMessage({sourceName:a,targetName:r,callback:Ac,callbackId:e.callbackId,data:t})}),(function(t){i.postMessage({sourceName:a,targetName:r,callback:kc,callbackId:e.callbackId,reason:wrapReason(t)})}))}else e.streamId?this.#Qe(e):t(e.data)}on(e,t){const a=this.actionHandler;if(a[e])throw new Error(`There is already an actionName called "${e}"`);a[e]=t}send(e,t,a){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},a)}sendWithPromise(e,t,a){const r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},a)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,a,r){const i=this.streamId++,n=this.sourceName,s=this.targetName,o=this.comObj;return new ReadableStream({start:a=>{const c=Promise.withResolvers();this.streamControllers[i]={controller:a,startCall:c,pullCall:null,cancelCall:null,isClosed:!1};o.postMessage({sourceName:n,targetName:s,action:e,streamId:i,data:t,desiredSize:a.desiredSize},r);return c.promise},pull:e=>{const t=Promise.withResolvers();this.streamControllers[i].pullCall=t;o.postMessage({sourceName:n,targetName:s,stream:Oc,streamId:i,desiredSize:e.desiredSize});return t.promise},cancel:e=>{assert(e instanceof Error,"cancel must have a valid reason");const t=Promise.withResolvers();this.streamControllers[i].cancelCall=t;this.streamControllers[i].isClosed=!0;o.postMessage({sourceName:n,targetName:s,stream:Cc,streamId:i,reason:wrapReason(e)});return t.promise}},a)}#Qe(e){const t=e.streamId,a=this.sourceName,r=e.sourceName,i=this.comObj,n=this,s=this.actionHandler[e.action],o={enqueue(e,n=1,s){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=n;if(o>0&&this.desiredSize<=0){this.sinkCapability=Promise.withResolvers();this.ready=this.sinkCapability.promise}i.postMessage({sourceName:a,targetName:r,stream:Ic,streamId:t,chunk:e},s)},close(){if(!this.isCancelled){this.isCancelled=!0;i.postMessage({sourceName:a,targetName:r,stream:Fc,streamId:t});delete n.streamSinks[t]}},error(e){assert(e instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;i.postMessage({sourceName:a,targetName:r,stream:Tc,streamId:t,reason:wrapReason(e)})}},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};o.sinkCapability.resolve();o.ready=o.sinkCapability.promise;this.streamSinks[t]=o;Promise.try(s,e.data,o).then((function(){i.postMessage({sourceName:a,targetName:r,stream:Dc,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:r,stream:Dc,streamId:t,reason:wrapReason(e)})}))}#Ze(e){const t=e.streamId,a=this.sourceName,r=e.sourceName,i=this.comObj,n=this.streamControllers[t],s=this.streamSinks[t];switch(e.stream){case Dc:e.success?n.startCall.resolve():n.startCall.reject(wrapReason(e.reason));break;case Mc:e.success?n.pullCall.resolve():n.pullCall.reject(wrapReason(e.reason));break;case Oc:if(!s){i.postMessage({sourceName:a,targetName:r,stream:Mc,streamId:t,success:!0});break}s.desiredSize<=0&&e.desiredSize>0&&s.sinkCapability.resolve();s.desiredSize=e.desiredSize;Promise.try(s.onPull||onFn).then((function(){i.postMessage({sourceName:a,targetName:r,stream:Mc,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:r,stream:Mc,streamId:t,reason:wrapReason(e)})}));break;case Ic:assert(n,"enqueue should have stream controller");if(n.isClosed)break;n.controller.enqueue(e.chunk);break;case Fc:assert(n,"close should have stream controller");if(n.isClosed)break;n.isClosed=!0;n.controller.close();this.#et(n,t);break;case Tc:assert(n,"error should have stream controller");n.controller.error(wrapReason(e.reason));this.#et(n,t);break;case vc:e.success?n.cancelCall.resolve():n.cancelCall.reject(wrapReason(e.reason));this.#et(n,t);break;case Cc:if(!s)break;const o=wrapReason(e.reason);Promise.try(s.onCancel||onFn,o).then((function(){i.postMessage({sourceName:a,targetName:r,stream:vc,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:r,stream:vc,streamId:t,reason:wrapReason(e)})}));s.sinkCapability.reject(o);s.isCancelled=!0;delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#et(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]);delete this.streamControllers[t]}destroy(){this.#Je?.abort();this.#Je=null}}async function writeObject(e,t,a,{encrypt:r=null}){const i=r?.createCipherTransform(e.num,e.gen);a.push(`${e.num} ${e.gen} obj\\n`);t instanceof Dict?await writeDict(t,a,i):t instanceof BaseStream?await writeStream(t,a,i):(Array.isArray(t)||ArrayBuffer.isView(t))&&await writeArray(t,a,i);a.push("\\nendobj\\n")}async function writeDict(e,t,a){t.push("<<");for(const r of e.getKeys()){t.push(` /${escapePDFName(r)} `);await writeValue(e.getRaw(r),t,a)}t.push(">>")}async function writeStream(e,t,a){let r=e.getBytes();const{dict:i}=e,[n,s]=await Promise.all([i.getAsync("Filter"),i.getAsync("DecodeParms")]),o=isName(Array.isArray(n)?await i.xref.fetchIfRefAsync(n[0]):n,"FlateDecode");if(r.length>=256||o)try{const e=new CompressionStream("deflate"),t=e.writable.getWriter();await t.ready;t.write(r).then((async()=>{await t.ready;await t.close()})).catch((()=>{}));const a=await new Response(e.readable).arrayBuffer();r=new Uint8Array(a);let c,l;if(n){if(!o){c=Array.isArray(n)?[Name.get("FlateDecode"),...n]:[Name.get("FlateDecode"),n];s&&(l=Array.isArray(s)?[null,...s]:[null,s])}}else c=Name.get("FlateDecode");c&&i.set("Filter",c);l&&i.set("DecodeParms",l)}catch(e){info(`writeStream - cannot compress data: "${e}".`)}let c=bytesToString(r);a&&(c=a.encryptString(c));i.set("Length",c.length);await writeDict(i,t,a);t.push(" stream\\n",c,"\\nendstream")}async function writeArray(e,t,a){t.push("[");let r=!0;for(const i of e){r?r=!1:t.push(" ");await writeValue(i,t,a)}t.push("]")}async function writeValue(e,t,a){if(e instanceof Name)t.push(`/${escapePDFName(e.name)}`);else if(e instanceof Ref)t.push(`${e.num} ${e.gen} R`);else if(Array.isArray(e)||ArrayBuffer.isView(e))await writeArray(e,t,a);else if("string"==typeof e){a&&(e=a.encryptString(e));t.push(`(${escapeString(e)})`)}else"number"==typeof e?t.push(numberToString(e)):"boolean"==typeof e?t.push(e.toString()):e instanceof Dict?await writeDict(e,t,a):e instanceof BaseStream?await writeStream(e,t,a):null===e?t.push("null"):warn(`Unhandled value in writer: ${typeof e}, please file a bug.`)}function writeInt(e,t,a,r){for(let i=t+a-1;i>a-1;i--){r[i]=255&e;e>>=8}return a+t}function writeString(e,t,a){const r=e.length;for(let i=0;i<r;i++)a[t+i]=255&e.charCodeAt(i);return t+r}function updateXFA({xfaData:e,xfaDatasetsRef:t,changes:a,xref:r}){if(null===e){e=function writeXFADataForAcroform(e,t){const a=new SimpleXMLParser({hasAttributes:!0}).parseFromString(e);for(const{xfa:e}of t){if(!e)continue;const{path:t,value:r}=e;if(!t)continue;const i=parseXFAPath(t);let n=a.documentElement.searchNode(i,0);!n&&i.length>1&&(n=a.documentElement.searchNode([i.at(-1)],0));n?n.childNodes=Array.isArray(r)?r.map((e=>new SimpleDOMNode("value",e))):[new SimpleDOMNode("#text",r)]:warn(`Node not found for path: ${t}`)}const r=[];a.documentElement.dump(r);return r.join("")}(r.fetchIfRef(t).getString(),a)}const i=new StringStream(e);i.dict=new Dict(r);i.dict.setIfName("Type","EmbeddedFile");a.put(t,{data:i})}function getIndexes(e){const t=[];for(const{ref:a}of e)a.num===t.at(-2)+t.at(-1)?t[t.length-1]+=1:t.push(a.num,1);return t}function computeIDs(e,t,a){if(Array.isArray(t.fileIds)&&t.fileIds.length>0){const r=function computeMD5(e,t){const a=Math.floor(Date.now()/1e3),r=t.filename||"",i=[a.toString(),r,e.toString(),...t.infoMap.values()],n=Math.sumPrecise(i.map((e=>e.length))),s=new Uint8Array(n);let o=0;for(const e of i)o=writeString(e,o,s);return bytesToString(calculateMD5(s,0,s.length))}(e,t);a.set("ID",[t.fileIds[0],r])}}async function incrementalUpdate({originalData:e,xrefInfo:t,changes:a,xref:r=null,hasXfa:i=!1,xfaDatasetsRef:n=null,hasXfaDatasetsEntry:s=!1,needAppearances:o,acroFormRef:c=null,acroForm:l=null,xfaData:h=null,useXrefStream:u=!1}){await async function updateAcroform({xref:e,acroForm:t,acroFormRef:a,hasXfa:r,hasXfaDatasetsEntry:i,xfaDatasetsRef:n,needAppearances:s,changes:o}){!r||i||n||warn("XFA - Cannot save it");if(!s&&(!r||!n||i))return;const c=t.clone();if(r&&!i){const e=t.get("XFA").slice();e.splice(2,0,"datasets");e.splice(3,0,n);c.set("XFA",e)}s&&c.set("NeedAppearances",!0);o.put(a,{data:c})}({xref:r,acroForm:l,acroFormRef:c,hasXfa:i,hasXfaDatasetsEntry:s,xfaDatasetsRef:n,needAppearances:o,changes:a});i&&updateXFA({xfaData:h,xfaDatasetsRef:n,changes:a,xref:r});const d=function getTrailerDict(e,t,a){const r=new Dict(null);r.set("Prev",e.startXRef);const i=e.newRef;if(a){t.put(i,{data:""});r.set("Size",i.num+1);r.setIfName("Type","XRef")}else r.set("Size",i.num);null!==e.rootRef&&r.set("Root",e.rootRef);null!==e.infoRef&&r.set("Info",e.infoRef);null!==e.encryptRef&&r.set("Encrypt",e.encryptRef);return r}(t,a,u),f=[],g=await async function writeChanges(e,t,a=[]){const r=[];for(const[i,{data:n}]of e.items())if(null!==n&&"string"!=typeof n){await writeObject(i,n,a,t);r.push({ref:i,data:a.join("")});a.length=0}else r.push({ref:i,data:n});return r.sort(((e,t)=>e.ref.num-t.ref.num))}(a,r,f);let p=e.length;const m=e.at(-1);if(10!==m&&13!==m){f.push("\\n");p+=1}for(const{data:e}of g)null!==e&&f.push(e);await(u?async function getXRefStreamTable(e,t,a,r,i){const n=[];let s=0,o=0;for(const{ref:e,data:r}of a){let a;s=Math.max(s,t);if(null!==r){a=Math.min(e.gen,65535);n.push([1,t,a]);t+=r.length}else{a=Math.min(e.gen+1,65535);n.push([0,0,a])}o=Math.max(o,a)}r.set("Index",getIndexes(a));const c=[1,getSizeInBytes(s),getSizeInBytes(o)];r.set("W",c);computeIDs(t,e,r);const l=Math.sumPrecise(c),h=new Uint8Array(l*n.length),u=new Stream(h);u.dict=r;let d=0;for(const[e,t,a]of n){d=writeInt(e,c[0],d,h);d=writeInt(t,c[1],d,h);d=writeInt(a,c[2],d,h)}await writeObject(e.newRef,u,i,{});i.push("startxref\\n",t.toString(),"\\n%%EOF\\n")}(t,p,g,d,f):async function getXRefTable(e,t,a,r,i){i.push("xref\\n");const n=getIndexes(a);let s=0;for(const{ref:e,data:r}of a){if(e.num===n[s]){i.push(`${n[s]} ${n[s+1]}\\n`);s+=2}if(null!==r){i.push(`${t.toString().padStart(10,"0")} ${Math.min(e.gen,65535).toString().padStart(5,"0")} n\\r\\n`);t+=r.length}else i.push(`0000000000 ${Math.min(e.gen+1,65535).toString().padStart(5,"0")} f\\r\\n`)}computeIDs(t,e,r);i.push("trailer\\n");await writeDict(r,i);i.push("\\nstartxref\\n",t.toString(),"\\n%%EOF\\n")}(t,p,g,d,f));const b=e.length+Math.sumPrecise(f.map((e=>e.length))),y=new Uint8Array(b);y.set(e);let w=e.length;for(const e of f)w=writeString(e,w,y);return y}class PDFWorkerStream{constructor(e){this._msgHandler=e;this._contentLength=null;this._fullRequestReader=null;this._rangeRequestReaders=[]}getFullReader(){assert(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once.");this._fullRequestReader=new PDFWorkerStreamReader(this._msgHandler);return this._fullRequestReader}getRangeReader(e,t){const a=new PDFWorkerStreamRangeReader(e,t,this._msgHandler);this._rangeRequestReaders.push(a);return a}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class PDFWorkerStreamReader{constructor(e){this._msgHandler=e;this.onProgress=null;this._contentLength=null;this._isRangeSupported=!1;this._isStreamingSupported=!1;const t=this._msgHandler.sendWithStream("GetReader");this._reader=t.getReader();this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then((e=>{this._isStreamingSupported=e.isStreamingSupported;this._isRangeSupported=e.isRangeSupported;this._contentLength=e.contentLength}))}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class PDFWorkerStreamRangeReader{constructor(e,t,a){this._msgHandler=a;this.onProgress=null;const r=this._msgHandler.sendWithStream("GetRangeReader",{begin:e,end:t});this._reader=r.getReader()}get isStreamingSupported(){return!1}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class WorkerTask{constructor(e){this.name=e;this.terminated=!1;this._capability=Promise.withResolvers()}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}class WorkerMessageHandler{static{"undefined"==typeof window&&!e&&"undefined"!=typeof self&&"function"==typeof self.postMessage&&"onmessage"in self&&this.initializeFromPort(self)}static setup(e,t){let a=!1;e.on("test",(t=>{if(!a){a=!0;e.send("test",t instanceof Uint8Array)}}));e.on("configure",(e=>{!function setVerbosityLevel(e){Number.isInteger(e)&&(da=e)}(e.verbosity)}));e.on("GetDocRequest",(e=>this.createDocumentHandler(e,t)))}static createDocumentHandler(e,t){let a,r=!1,i=null;const n=new Set,s=getVerbosityLevel(),{docId:o,apiVersion:c}=e,l="5.4.54";if(c!==l)throw new Error(`The API version "${c}" does not match the Worker version "${l}".`);const buildMsg=(e,t)=>`The \\`${e}.prototype\\` contains unexpected enumerable property "${t}", thus breaking e.g. \\`for...in\\` iteration of ${e}s.`;for(const e in{})throw new Error(buildMsg("Object",e));for(const e in[])throw new Error(buildMsg("Array",e));const h=o+"_worker";let u=new MessageHandler(h,o,t);function ensureNotTerminated(){if(r)throw new Error("Worker was terminated")}function startWorkerTask(e){n.add(e)}function finishWorkerTask(e){e.finish();n.delete(e)}async function loadDocument(e){await a.ensureDoc("checkHeader");await a.ensureDoc("parseStartXRef");await a.ensureDoc("parse",[e]);await a.ensureDoc("checkFirstPage",[e]);await a.ensureDoc("checkLastPage",[e]);const t=await a.ensureDoc("isPureXfa");if(t){const e=new WorkerTask("loadXfaResources");startWorkerTask(e);await a.ensureDoc("loadXfaResources",[u,e]);finishWorkerTask(e)}const[r,i]=await Promise.all([a.ensureDoc("numPages"),a.ensureDoc("fingerprints")]);return{numPages:r,fingerprints:i,htmlForXfa:t?await a.ensureDoc("htmlForXfa"):null}}function setupDoc(e){function onSuccess(e){ensureNotTerminated();u.send("GetDoc",{pdfInfo:e})}function onFailure(e){ensureNotTerminated();if(e instanceof PasswordException){const t=new WorkerTask(`PasswordException: response ${e.code}`);startWorkerTask(t);u.sendWithPromise("PasswordRequest",e).then((function({password:e}){finishWorkerTask(t);a.updatePassword(e);pdfManagerReady()})).catch((function(){finishWorkerTask(t);u.send("DocException",e)}))}else u.send("DocException",wrapReason(e))}function pdfManagerReady(){ensureNotTerminated();loadDocument(!1).then(onSuccess,(function(e){ensureNotTerminated();e instanceof XRefParseException?a.requestLoadedStream().then((function(){ensureNotTerminated();loadDocument(!0).then(onSuccess,onFailure)})):onFailure(e)}))}ensureNotTerminated();(async function getPdfManager({data:e,password:t,disableAutoFetch:a,rangeChunkSize:r,length:n,docBaseUrl:s,enableXfa:c,evaluatorOptions:l}){const h={source:null,disableAutoFetch:a,docBaseUrl:s,docId:o,enableXfa:c,evaluatorOptions:l,handler:u,length:n,password:t,rangeChunkSize:r};if(e){h.source=e;return new LocalPdfManager(h)}const d=new PDFWorkerStream(u),f=d.getFullReader(),g=Promise.withResolvers();let p,m=[],b=0;f.headersReady.then((function(){if(f.isRangeSupported){h.source=d;h.length=f.contentLength;h.disableAutoFetch||=f.isStreamingSupported;p=new NetworkPdfManager(h);for(const e of m)p.sendProgressiveData(e);m=[];g.resolve(p);i=null}})).catch((function(e){g.reject(e);i=null}));new Promise((function(e,t){const readChunk=function({value:e,done:a}){try{ensureNotTerminated();if(a){if(!p){const e=arrayBuffersToBytes(m);m=[];n&&e.length!==n&&warn("reported HTTP length is different from actual");h.source=e;p=new LocalPdfManager(h);g.resolve(p)}i=null;return}b+=e.byteLength;f.isStreamingSupported||u.send("DocProgress",{loaded:b,total:Math.max(b,f.contentLength||0)});p?p.sendProgressiveData(e):m.push(e);f.read().then(readChunk,t)}catch(e){t(e)}};f.read().then(readChunk,t)})).catch((function(e){g.reject(e);i=null}));i=e=>{d.cancelAllRequests(e)};return g.promise})(e).then((function(e){if(r){e.terminate(new AbortException("Worker was terminated."));throw new Error("Worker was terminated")}a=e;a.requestLoadedStream(!0).then((e=>{u.send("DataLoaded",{length:e.bytes.byteLength})}))})).then(pdfManagerReady,onFailure)}u.on("GetPage",(function(e){return a.getPage(e.pageIndex).then((function(e){return Promise.all([a.ensure(e,"rotate"),a.ensure(e,"ref"),a.ensure(e,"userUnit"),a.ensure(e,"view")]).then((function([e,t,a,r]){return{rotate:e,ref:t,refStr:t?.toString()??null,userUnit:a,view:r}}))}))}));u.on("GetPageIndex",(function(e){const t=Ref.get(e.num,e.gen);return a.ensureCatalog("getPageIndex",[t])}));u.on("GetDestinations",(function(e){return a.ensureCatalog("destinations")}));u.on("GetDestination",(function(e){return a.ensureCatalog("getDestination",[e.id])}));u.on("GetPageLabels",(function(e){return a.ensureCatalog("pageLabels")}));u.on("GetPageLayout",(function(e){return a.ensureCatalog("pageLayout")}));u.on("GetPageMode",(function(e){return a.ensureCatalog("pageMode")}));u.on("GetViewerPreferences",(function(e){return a.ensureCatalog("viewerPreferences")}));u.on("GetOpenAction",(function(e){return a.ensureCatalog("openAction")}));u.on("GetAttachments",(function(e){return a.ensureCatalog("attachments")}));u.on("GetDocJSActions",(function(e){return a.ensureCatalog("jsActions")}));u.on("GetPageJSActions",(function({pageIndex:e}){return a.getPage(e).then((e=>a.ensure(e,"jsActions")))}));u.on("GetOutline",(function(e){return a.ensureCatalog("documentOutline")}));u.on("GetOptionalContentConfig",(function(e){return a.ensureCatalog("optionalContentConfig")}));u.on("GetPermissions",(function(e){return a.ensureCatalog("permissions")}));u.on("GetMetadata",(function(e){return Promise.all([a.ensureDoc("documentInfo"),a.ensureCatalog("metadata")])}));u.on("GetMarkInfo",(function(e){return a.ensureCatalog("markInfo")}));u.on("GetData",(function(e){return a.requestLoadedStream().then((e=>e.bytes))}));u.on("GetAnnotations",(function({pageIndex:e,intent:t}){return a.getPage(e).then((function(a){const r=new WorkerTask(`GetAnnotations: page ${e}`);startWorkerTask(r);return a.getAnnotationsData(u,r,t).then((e=>{finishWorkerTask(r);return e}),(e=>{finishWorkerTask(r);throw e}))}))}));u.on("GetFieldObjects",(function(e){return a.ensureDoc("fieldObjects").then((e=>e?.allFields||null))}));u.on("HasJSActions",(function(e){return a.ensureDoc("hasJSActions")}));u.on("GetCalculationOrderIds",(function(e){return a.ensureDoc("calculationOrderIds")}));u.on("SaveDocument",(async function({isPureXfa:e,numPages:t,annotationStorage:r,filename:i}){const n=[a.requestLoadedStream(),a.ensureCatalog("acroForm"),a.ensureCatalog("acroFormRef"),a.ensureDoc("startXRef"),a.ensureDoc("xref"),a.ensureDoc("linearization"),a.ensureCatalog("structTreeRoot")],s=new RefSetCache,o=[],c=e?null:getNewAnnotationsMap(r),[l,h,d,f,g,p,m]=await Promise.all(n),b=g.trailer.getRaw("Root")||null;let y;if(c){m?await m.canUpdateStructTree({pdfManager:a,newAnnotationsByPage:c})&&(y=m):await StructTreeRoot.canCreateStructureTree({catalogRef:b,pdfManager:a,newAnnotationsByPage:c})&&(y=null);const e=AnnotationFactory.generateImages(r.values(),g,a.evaluatorOptions.isOffscreenCanvasSupported),t=void 0===y?o:[];for(const[r,i]of c)t.push(a.getPage(r).then((t=>{const a=new WorkerTask(`Save (editor): page ${r}`);startWorkerTask(a);return t.saveNewAnnotations(u,a,i,e,s).finally((function(){finishWorkerTask(a)}))})));null===y?o.push(Promise.all(t).then((async()=>{await StructTreeRoot.createStructureTree({newAnnotationsByPage:c,xref:g,catalogRef:b,pdfManager:a,changes:s})}))):y&&o.push(Promise.all(t).then((async()=>{await y.updateStructureTree({newAnnotationsByPage:c,pdfManager:a,changes:s})})))}if(e)o.push(a.ensureDoc("serializeXfaData",[r]));else for(let e=0;e<t;e++)o.push(a.getPage(e).then((function(t){const a=new WorkerTask(`Save: page ${e}`);startWorkerTask(a);return t.save(u,a,r,s).finally((function(){finishWorkerTask(a)}))})));const w=await Promise.all(o);let x=null;if(e){x=w[0];if(!x)return l.bytes}else if(0===s.size)return l.bytes;const S=d&&h instanceof Dict&&s.values().some((e=>e.needAppearances)),k=h instanceof Dict&&h.get("XFA")||null;let C=null,v=!1;if(Array.isArray(k)){for(let e=0,t=k.length;e<t;e+=2)if("datasets"===k[e]){C=k[e+1];v=!0}null===C&&(C=g.getNewTemporaryRef())}else k&&warn("Unsupported XFA type.");let F=Object.create(null);if(g.trailer){const e=new Map,t=g.trailer.get("Info")||null;if(t instanceof Dict)for(const[a,r]of t)"string"==typeof r&&e.set(a,stringToPDFString(r));F={rootRef:b,encryptRef:g.trailer.getRaw("Encrypt")||null,newRef:g.getNewTemporaryRef(),infoRef:g.trailer.getRaw("Info")||null,infoMap:e,fileIds:g.trailer.get("ID")||null,startXRef:p?f:g.lastXRefStreamPos??f,filename:i}}return incrementalUpdate({originalData:l.bytes,xrefInfo:F,changes:s,xref:g,hasXfa:!!k,xfaDatasetsRef:C,hasXfaDatasetsEntry:v,needAppearances:S,acroFormRef:d,acroForm:h,xfaData:x,useXrefStream:isDict(g.topDict,"XRef")}).finally((()=>{g.resetNewTemporaryRef()}))}));u.on("GetOperatorList",(function(e,t){const r=e.pageIndex;a.getPage(r).then((function(a){const i=new WorkerTask(`GetOperatorList: page ${r}`);startWorkerTask(i);const n=s>=Ae?Date.now():0;a.getOperatorList({handler:u,sink:t,task:i,intent:e.intent,cacheKey:e.cacheKey,annotationStorage:e.annotationStorage,modifiedIds:e.modifiedIds}).then((function(e){finishWorkerTask(i);n&&info(`page=${r+1} - getOperatorList: time=${Date.now()-n}ms, len=${e.length}`);t.close()}),(function(e){finishWorkerTask(i);i.terminated||t.error(e)}))}))}));u.on("GetTextContent",(function(e,t){const{pageIndex:r,includeMarkedContent:i,disableNormalization:n}=e;a.getPage(r).then((function(e){const a=new WorkerTask("GetTextContent: page "+r);startWorkerTask(a);const o=s>=Ae?Date.now():0;e.extractTextContent({handler:u,task:a,sink:t,includeMarkedContent:i,disableNormalization:n}).then((function(){finishWorkerTask(a);o&&info(`page=${r+1} - getTextContent: time=`+(Date.now()-o)+"ms");t.close()}),(function(e){finishWorkerTask(a);a.terminated||t.error(e)}))}))}));u.on("GetStructTree",(function(e){return a.getPage(e.pageIndex).then((e=>a.ensure(e,"getStructTree")))}));u.on("FontFallback",(function(e){return a.fontFallback(e.id,u)}));u.on("Cleanup",(function(e){return a.cleanup(!0)}));u.on("Terminate",(function(e){r=!0;const t=[];if(a){a.terminate(new AbortException("Worker was terminated."));const e=a.cleanup();t.push(e);a=null}else clearGlobalCaches();i?.(new AbortException("Worker was terminated."));for(const e of n){t.push(e.finished);e.terminate()}return Promise.all(t).then((function(){u.destroy();u=null}))}));u.on("Ready",(function(t){setupDoc(e);e=null}));return h}static initializeFromPort(e){const t=new MessageHandler("worker","main",e);this.setup(t,e);t.send("ready",null)}}globalThis.pdfjsWorker={WorkerMessageHandler};export{WorkerMessageHandler};'},Symbol.toStringTag,{value:"Module"}));return kn.app=zv,kn.start=wE,Object.defineProperty(kn,Symbol.toStringTag,{value:"Module"}),kn}({});
__sveltekit_b3qtxx.app.start(element);
}
</script>
</div>
</body>
</html>